Public Types | |
enum | ConstructionOwnershipSemantics { TakeOwnershipOfExistingReference, CreateNewReference } |
Public Member Functions | |
CCustomPoolSmartBuffer (IAddBuffersToPool &pool) | |
CCustomPoolSmartBuffer (IBuffer *ref, IAddBuffersToPool &pool, ConstructionOwnershipSemantics semantics=TakeOwnershipOfExistingReference) | |
Construct a smart pointer that takes ownership of the supplied object according to the supplied ownership semantics. | |
CCustomPoolSmartBuffer (IBuffer &ref, IAddBuffersToPool &pool, ConstructionOwnershipSemantics semantics=TakeOwnershipOfExistingReference) | |
Construct a smart pointer that takes ownership of the supplied object according to the supplied ownership semantics. | |
CCustomPoolSmartBuffer (CCustomPoolSmartBuffer &&rhs) noexcept | |
CCustomPoolSmartBuffer (const CCustomPoolSmartBuffer &rhs) | |
CCustomPoolSmartBuffer (const CCustomPoolSmartBuffer &rhs, IAddBuffersToPool &pool) | |
CCustomPoolSmartBuffer (const CSmartBuffer &rhs, IAddBuffersToPool &pool) | |
CCustomPoolSmartBuffer & | operator= (CCustomPoolSmartBuffer &&rhs) noexcept |
CCustomPoolSmartBuffer & | operator= (const CCustomPoolSmartBuffer &rhs) |
CCustomPoolSmartBuffer & | operator= (CSmartBuffer &&rhs) noexcept override |
CCustomPoolSmartBuffer & | operator= (const CSmartBuffer &rhs) override |
CCustomPoolSmartBuffer & | operator= (IBuffer *rhs) override |
This has the same ownership semantics as TakeOwnershipOfExistingReference, we take ownership of the current reference... | |
~CCustomPoolSmartBuffer () override | |
IBuffer * | SafeRelease (IBuffer *ref) override |
T * | operator-> () |
Access the managed object. If JETBYTE_REFERENCE_COUNTED_SMART_POINTER_THROW_ON_NULL_REFERENCE is defined as 1 then this will throw an exception if the smart pointer is not currently managing an object! | |
const T * | operator-> () const |
Access the managed object. If JETBYTE_REFERENCE_COUNTED_SMART_POINTER_THROW_ON_NULL_REFERENCE is defined as 1 then this will throw an exception if the smart pointer is not currently managing an object! | |
T * | Get () |
const T * | Get () const |
T & | GetRef () |
Obtain a reference to the managed object. If JETBYTE_REFERENCE_COUNTED_SMART_POINTER_THROW_ON_NULL_REFERENCE is defined as 1 then this will throw an exception if the smart pointer is not currently managing an object! | |
const T & | GetRef () const |
Obtain a reference to the managed object. If JETBYTE_REFERENCE_COUNTED_SMART_POINTER_THROW_ON_NULL_REFERENCE is defined as 1 then this will throw an exception if the smart pointer is not currently managing an object! | |
void | SilentDetach () |
Detach the managed object from the smart pointer. It's assumed that the object's ownership has been given to something else before this call. This smart pointer no longer owns a reference and so we a) don't return one to the caller and b) don't do any clever stuff when in debug mode. | |
T * | Detach () |
Detach the managed object from the smart pointer and return it to the caller. The caller now owns the object and is responsible for calling Release() on it when it is finished with it. | |
void | Attach (T *ref, ConstructionOwnershipSemantics semantics) |
void | AddRef () |
Call AddRef() on the managed object if there is one. Note that it's safe to call this on an object even if it isn't currently managing an object. | |
void | Release () |
Detach the managed object from the smart pointer and call release on it. Note that it's safe to call this on an object even if it isn't currently managing an object. | |
virtual T * | SafeRelease (T *ref) |
Static Public Member Functions | |
static T * | SafeAddRef (T *ref) |
enum ConstructionOwnershipSemantics [inherited] |
TakeOwnershipOfExistingReference | Construct a smart pointer that takes ownership of the supplied object. The pointer does NOT call AddRef() in the constructor but DOES call Release() in the destructor. |
CreateNewReference | Construct a smart pointer that takes creates a new reference to the supplied object. The pointer DOES call AddRef() in the constructor and DOES call Release() in the destructor. |
CCustomPoolSmartBuffer | ( | IAddBuffersToPool & | pool | ) | [explicit] |
CCustomPoolSmartBuffer | ( | IBuffer * | ref, | |
IAddBuffersToPool & | pool, | |||
ConstructionOwnershipSemantics | semantics = TakeOwnershipOfExistingReference | |||
) |
Construct a smart pointer that takes ownership of the supplied object according to the supplied ownership semantics.
CCustomPoolSmartBuffer | ( | IBuffer & | ref, | |
IAddBuffersToPool & | pool, | |||
ConstructionOwnershipSemantics | semantics = TakeOwnershipOfExistingReference | |||
) |
Construct a smart pointer that takes ownership of the supplied object according to the supplied ownership semantics.
CCustomPoolSmartBuffer | ( | CCustomPoolSmartBuffer && | rhs | ) |
CCustomPoolSmartBuffer | ( | const CCustomPoolSmartBuffer & | rhs | ) |
CCustomPoolSmartBuffer | ( | const CCustomPoolSmartBuffer & | rhs, | |
IAddBuffersToPool & | pool | |||
) |
CCustomPoolSmartBuffer | ( | const CSmartBuffer & | rhs, | |
IAddBuffersToPool & | pool | |||
) |
~CCustomPoolSmartBuffer | ( | ) | [override] |
CCustomPoolSmartBuffer & operator= | ( | CCustomPoolSmartBuffer && | rhs | ) |
CCustomPoolSmartBuffer & operator= | ( | const CCustomPoolSmartBuffer & | rhs | ) |
CCustomPoolSmartBuffer & operator= | ( | CSmartBuffer && | rhs | ) | [override] |
CCustomPoolSmartBuffer & operator= | ( | const CSmartBuffer & | rhs | ) | [override] |
CCustomPoolSmartBuffer & operator= | ( | IBuffer * | rhs | ) | [override] |
This has the same ownership semantics as TakeOwnershipOfExistingReference, we take ownership of the current reference...
IBuffer * SafeRelease | ( | IBuffer * | ref | ) | [override] |
T * operator-> | ( | ) | [inline, inherited] |
Access the managed object. If JETBYTE_REFERENCE_COUNTED_SMART_POINTER_THROW_ON_NULL_REFERENCE is defined as 1 then this will throw an exception if the smart pointer is not currently managing an object!
const T * operator-> | ( | ) | const [inline, inherited] |
Access the managed object. If JETBYTE_REFERENCE_COUNTED_SMART_POINTER_THROW_ON_NULL_REFERENCE is defined as 1 then this will throw an exception if the smart pointer is not currently managing an object!
T * Get | ( | ) | [inline, inherited] |
const T * Get | ( | ) | const [inline, inherited] |
T & GetRef | ( | ) | [inline, inherited] |
Obtain a reference to the managed object. If JETBYTE_REFERENCE_COUNTED_SMART_POINTER_THROW_ON_NULL_REFERENCE is defined as 1 then this will throw an exception if the smart pointer is not currently managing an object!
const T & GetRef | ( | ) | const [inline, inherited] |
Obtain a reference to the managed object. If JETBYTE_REFERENCE_COUNTED_SMART_POINTER_THROW_ON_NULL_REFERENCE is defined as 1 then this will throw an exception if the smart pointer is not currently managing an object!
void SilentDetach | ( | ) | [inline, inherited] |
Detach the managed object from the smart pointer. It's assumed that the object's ownership has been given to something else before this call. This smart pointer no longer owns a reference and so we a) don't return one to the caller and b) don't do any clever stuff when in debug mode.
T * Detach | ( | ) | [inline, inherited] |
Detach the managed object from the smart pointer and return it to the caller. The caller now owns the object and is responsible for calling Release() on it when it is finished with it.
void Attach | ( | T * | ref, | |
ConstructionOwnershipSemantics | semantics | |||
) | [inline, inherited] |
void AddRef | ( | ) | [inline, inherited] |
Call AddRef() on the managed object if there is one. Note that it's safe to call this on an object even if it isn't currently managing an object.
void Release | ( | ) | [inline, inherited] |
Detach the managed object from the smart pointer and call release on it. Note that it's safe to call this on an object even if it isn't currently managing an object.
T * SafeAddRef | ( | T * | ref | ) | [inline, static, inherited] |
T * SafeRelease | ( | T * | ref | ) | [inline, virtual, inherited] |