"L. Spiro Engine"
Classes | Public Types | Public Member Functions | Protected Attributes

lstl::CSharedPtr< _tType > Class Template Reference

A standard shared pointer. More...

#include <LSTLSharedPtr.h>

List of all members.

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_CONTAINERm_pcCont
_tType * m_ptDirect

Detailed Description

template<typename _tType>
class lstl::CSharedPtr< _tType >

A standard shared pointer.

Class CSharedPtr Description: A standard shared pointer.


Member Typedef Documentation

template<typename _tType>
typedef struct lstl::CSharedPtr::LSSTL_CONTAINER * lstl::CSharedPtr< _tType >::LPLSSTL_CONTAINER

Encapsulates our reference count and the object into a structure.


Member Function Documentation

template<typename _tType>
_tType* LSE_CALL lstl::CSharedPtr< _tType >::Get ( ) [inline]

Returns the raw pointer to the object that it shares.

Returns:
Returns the raw pointer to the object that it shares.
template<typename _tType>
const _tType* LSE_CALL lstl::CSharedPtr< _tType >::Get ( ) const [inline]

Returns the read-only raw pointer to the object that it shares.

Returns:
Returns the read-only raw pointer to the object that it shares.
template<typename _tType>
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.

Returns:
Returns a constant reference to the container used by this shared pointer.
template<typename _tType>
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.

Returns:
Returns true if a new object could be made.
template<typename _tType>
LSE_CALL lstl::CSharedPtr< _tType >::operator LSUINTPTR ( ) const [inline]

Casting to type LSUINTPTR.

Returns:
Returns the LSUINTPTR reporesentation of this shared pointer.
template<typename _tType>
_tType& LSE_CALL lstl::CSharedPtr< _tType >::operator* ( ) [inline]

Dereference operator.

Returns:
Returns a reference to the object that it shares.
template<typename _tType>
const _tType& LSE_CALL lstl::CSharedPtr< _tType >::operator* ( ) const [inline]

Constant dereference operator.

Returns:
Returns a read-only reference to the object that it shares.
template<typename _tType>
_tType* LSE_CALL lstl::CSharedPtr< _tType >::operator-> ( ) [inline]

Arrow operator.

Returns:
Returns the raw pointer to the object that it shares.
template<typename _tType>
const _tType* LSE_CALL lstl::CSharedPtr< _tType >::operator-> ( ) const [inline]

Constant arrow operator.

Returns:
Returns the read-only raw pointer to the object that it shares.
template<typename _tType>
CSharedPtr<_tType>& LSE_CALL lstl::CSharedPtr< _tType >::operator= ( const CSharedPtr< _tType > &  _spOther) [inline]

Copy operator.

Parameters:
_spOtherThe object to copy.
Returns:
Returns this object after the copy.
template<typename _tType>
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.

Returns:
Returns the reference count of the object to which it points. 0 is returned if the pointer is invalid.
template<typename _tType>
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.

template<typename _tType>
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.

template<typename _tType>
LSBOOL LSE_CALL lstl::CSharedPtr< _tType >::Valid ( ) const [inline]

Returns true or false depending on whether or not the shared pointer points to something.

Returns:
Returns true if the shared pointer is valid.

Member Data Documentation

template<typename _tType>
LSSTL_CONTAINER* lstl::CSharedPtr< _tType >::m_pcCont [protected]

The container we encapsulate.

template<typename _tType>
_tType* lstl::CSharedPtr< _tType >::m_ptDirect [protected]

Pointer directly to the object. Important for cleaning up.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator