The C++ framework for developing highly scalable, high performance servers on Windows platforms.

TReleaseOnlyReferenceCountedSmartPointer Class Template Reference
[TemplatesSmart Pointer]

Collaboration diagram for TReleaseOnlyReferenceCountedSmartPointer:

List of all members.


Detailed Description

template<class T>
class JetByteTools::Core::TReleaseOnlyReferenceCountedSmartPointer< T >

A template smart pointer class that manages objects that support Release() style reference counting.

Public Member Functions

 TReleaseOnlyReferenceCountedSmartPointer ()
 Construct an empty smart pointer.
 TReleaseOnlyReferenceCountedSmartPointer (T *ref)
 Construct a smart pointer that takes ownership of the supplied object.
 TReleaseOnlyReferenceCountedSmartPointer (T &ref)
 Construct a smart pointer that takes ownership of the supplied object.
 TReleaseOnlyReferenceCountedSmartPointer (TReleaseOnlyReferenceCountedSmartPointer< T > &rhs)
 Copy construct a smart pointer from the supplied smart pointer. Note that ownership moves from the rhs' pointer to the newly constructed pointer, the 'rhs' pointer ends up with a 0 reference.
TReleaseOnlyReferenceCountedSmartPointeroperator= (TReleaseOnlyReferenceCountedSmartPointer< T > &rhs)
TReleaseOnlyReferenceCountedSmartPointeroperator= (T *ref)
 ~TReleaseOnlyReferenceCountedSmartPointer ()
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!
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 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.

Static Public Member Functions

static T * SafeRelease (T *ref)

Constructor & Destructor Documentation

Construct an empty smart pointer.

TReleaseOnlyReferenceCountedSmartPointer ( T *  ref  )  [inline, explicit]

Construct a smart pointer that takes ownership of the supplied object.

TReleaseOnlyReferenceCountedSmartPointer ( T &  ref  )  [inline, explicit]

Construct a smart pointer that takes ownership of the supplied object.

Copy construct a smart pointer from the supplied smart pointer. Note that ownership moves from the rhs' pointer to the newly constructed pointer, the 'rhs' pointer ends up with a 0 reference.


Member Function Documentation

TReleaseOnlyReferenceCountedSmartPointer< T > & operator= ( T *  ref  )  [inline]

T * operator-> (  )  [inline]

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]

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]

const T * Get (  )  const [inline]

T & GetRef (  )  [inline]

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]

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!

T * Detach (  )  [inline]

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 Release (  )  [inline]

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 * SafeRelease ( T *  ref  )  [inline, static]


Generated on Sun Sep 12 19:08:48 2021 for The Server Framework - v7.4 by doxygen 1.5.3