#include <cRefPtr.h>
base class for some derived object that is to be reference counted via cRefPtr. similar to std::shared_ptr<TYPE> ?
- Note
- These objects are normally cHeapObject, but NOT ALWAYS ! (allow static versions using StaticConstruct() and k_REFCOUNT_STATIC)
-
These objects emulate the COM IUnknown. we may use cIUnkPtr<> for this also. Use IUNKNOWN_DISAMBIG(cRefBase) with this
◆ cRefBase()
Gray::cRefBase::cRefBase |
( |
int |
iRefCount = 0 | ) |
|
|
inlineexplicitnoexcept |
◆ ~cRefBase()
virtual Gray::cRefBase::~cRefBase |
( |
| ) |
|
|
inlinevirtual |
◆ DecRefCount()
void Gray::cRefBase::DecRefCount |
( |
| ) |
|
|
inline |
◆ get_HashCode()
get a unique (only on this machine/process instance) hash code.
◆ get_RefCount()
int Gray::cRefBase::get_RefCount |
( |
| ) |
const |
|
inlinenoexcept |
◆ IncRefCount()
void Gray::cRefBase::IncRefCount |
( |
| ) |
|
|
inline |
◆ isDestructing()
bool Gray::cRefBase::isDestructing |
( |
| ) |
|
|
inlinenoexcept |
◆ isStaticConstruct()
bool Gray::cRefBase::isStaticConstruct |
( |
| ) |
const |
|
inlinenoexcept |
◆ isValidObj()
bool Gray::cRefBase::isValidObj |
( |
| ) |
const |
|
inlinenoexcept |
◆ onFinalRelease()
virtual void Gray::cRefBase::onFinalRelease |
( |
| ) |
|
|
inlinevirtual |
Zero references to this exist so we can destroy it.
- Note
- Obviously this should NEVER be called for a static or stack based object. use StaticConstruct() for these. MFC CCmdTarget has similar OnFinalRelease()
◆ QueryInterface()
STDMETHOD() Gray::cRefBase::QueryInterface |
( |
const IID & |
riid, |
|
|
void __RPC_FAR *__RPC_FAR * |
ppvObject |
|
) |
| |
|
inlineoverride |
like COM IUnknown::QueryInterface
◆ SetDestructing()
void Gray::cRefBase::SetDestructing |
( |
| ) |
|
|
inline |
object is in the act of destruction.
◆ StaticConstruct()
void Gray::cRefBase::StaticConstruct |
( |
| ) |
|
|
inline |
If this is static, not dynamic. Call this in parents constructor or main (if global).
◆ StaticDestruct()
void Gray::cRefBase::StaticDestruct |
( |
| ) |
|
|
inline |
static objects can fix themselves this way. ASSUME StaticConstruct() called for this.
◆ STDMETHOD_() [1/3]
Gray::cRefBase::STDMETHOD_ |
( |
HASHCODE_t |
, |
|
|
get_HashCodeX |
|
|
) |
| const |
|
inlinenoexcept |
virtualized version of get_HashCode.
◆ STDMETHOD_() [2/3]
Gray::cRefBase::STDMETHOD_ |
( |
ULONG |
, |
|
|
AddRef |
|
|
) |
| |
|
inlineoverride |
like COM IUnknown::AddRef
◆ STDMETHOD_() [3/3]
Gray::cRefBase::STDMETHOD_ |
( |
ULONG |
, |
|
|
Release |
|
|
) |
| |
|
inlineoverride |
like COM IUnknown::Release
The documentation for this class was generated from the following file:
- c:/Dennis/Source/Gray/GrayCore/include/cRefPtr.h