"L. Spiro Engine"
|
A standard shared pointer. More...
#include <LSTLSharedPtr.h>
Classes | |
struct | LSSTL_CONTAINER |
Public Types | |
typedef struct lstl::CSharedPtr::LSSTL_CONTAINER * | LPLSSTL_CONTAINER |
typedef struct lstl::CSharedPtr::LSSTL_CONTAINER | LPCLSSTL_CONTAINER |
Public Member Functions | |
LSE_CALLCTOR | CSharedPtr (LSSTL_SHARED_PTR) |
LSE_CALLCTOR | CSharedPtr (CAllocator *_paAllocator) |
LSE_CALLCTOR | CSharedPtr (const CSharedPtr< _tType > &_spOther) |
template<typename _tCastType > | |
LSE_CALLCTOR | CSharedPtr (const CSharedPtr< _tCastType > &_spOther) |
CSharedPtr< _tType > &LSE_CALL | operator= (const CSharedPtr< _tType > &_spOther) |
_tType &LSE_CALL | operator* () |
const _tType &LSE_CALL | operator* () const |
_tType *LSE_CALL | operator-> () |
const _tType *LSE_CALL | operator-> () const |
LSE_CALL | operator LSUINTPTR () const |
LSBOOL LSE_CALL | New () |
_tType *LSE_CALL | Get () |
const _tType *LSE_CALL | Get () const |
LSUINT32 LSE_CALL | RefCount () const |
LSBOOL LSE_CALL | Valid () const |
LSVOID LSE_CALL | Reset () |
LSVOID LSE_CALL | Trash () |
const LSSTL_CONTAINER *LSE_CALL | GetContainer () const |
Protected Attributes | |
LSSTL_CONTAINER * | m_pcCont |
_tType * | m_ptDirect |
A standard shared pointer.
Class CSharedPtr Description: A standard shared pointer.
typedef struct lstl::CSharedPtr::LSSTL_CONTAINER * lstl::CSharedPtr< _tType >::LPLSSTL_CONTAINER |
Encapsulates our reference count and the object into a structure.
_tType* LSE_CALL lstl::CSharedPtr< _tType >::Get | ( | ) | [inline] |
Returns the raw pointer to the object that it shares.
const _tType* LSE_CALL lstl::CSharedPtr< _tType >::Get | ( | ) | const [inline] |
Returns the read-only raw pointer to the object that it shares.
const LSSTL_CONTAINER* LSE_CALL lstl::CSharedPtr< _tType >::GetContainer | ( | ) | const [inline] |
Get the container held by this shared pointer which is used for maintaining the reference count. This should never be accessed. The only reason it is a public function is to allow the casting operator to access the protected data of other types of shared pointers. Beyond that, this function is prohibed from use.
LSBOOL LSE_CALL lstl::CSharedPtr< _tType >::New | ( | ) | [inline] |
Creates a new object. The previous object, if any, will be deleted if its reference count reaches 0. If this was pointing to a previous object, the same allocator will be used.
LSE_CALL lstl::CSharedPtr< _tType >::operator LSUINTPTR | ( | ) | const [inline] |
Casting to type LSUINTPTR.
_tType& LSE_CALL lstl::CSharedPtr< _tType >::operator* | ( | ) | [inline] |
Dereference operator.
const _tType& LSE_CALL lstl::CSharedPtr< _tType >::operator* | ( | ) | const [inline] |
Constant dereference operator.
_tType* LSE_CALL lstl::CSharedPtr< _tType >::operator-> | ( | ) | [inline] |
Arrow operator.
const _tType* LSE_CALL lstl::CSharedPtr< _tType >::operator-> | ( | ) | const [inline] |
Constant arrow operator.
CSharedPtr<_tType>& LSE_CALL lstl::CSharedPtr< _tType >::operator= | ( | const CSharedPtr< _tType > & | _spOther | ) | [inline] |
Copy operator.
_spOther | The object to copy. |
LSUINT32 LSE_CALL lstl::CSharedPtr< _tType >::RefCount | ( | ) | const [inline] |
Returns the reference count of the object to which it points. 0 is returned if the pointer is invalid.
LSVOID LSE_CALL lstl::CSharedPtr< _tType >::Reset | ( | ) | [inline] |
Decreases the reference count by one on the object to which this points and frees it if it reaches 0.
LSVOID LSE_CALL lstl::CSharedPtr< _tType >::Trash | ( | ) | [inline] |
Decreases the reference count by one on the object to which this points and trashes the object if it reaches 0.
LSBOOL LSE_CALL lstl::CSharedPtr< _tType >::Valid | ( | ) | const [inline] |
Returns true or false depending on whether or not the shared pointer points to something.
LSSTL_CONTAINER* lstl::CSharedPtr< _tType >::m_pcCont [protected] |
The container we encapsulate.
_tType* lstl::CSharedPtr< _tType >::m_ptDirect [protected] |
Pointer directly to the object. Important for cleaning up.