blocxx
BLOCXX_NAMESPACE::COWIntrusiveCountableBase Class Reference

#include <COWIntrusiveCountableBase.hpp>

Inheritance diagram for BLOCXX_NAMESPACE::COWIntrusiveCountableBase:
BLOCXX_NAMESPACE::String::ByteBuf

Protected Member Functions

 COWIntrusiveCountableBase (COWIntrusiveCountableBase const &)
 Copy constructor.
 
COWIntrusiveCountableBaseoperator= (COWIntrusiveCountableBase const &x)
 Assignment operator.
 
 COWIntrusiveCountableBase ()
 Default constructor.
 
virtual ~COWIntrusiveCountableBase ()
 Destroy this COWIntrusiveCountableBase object.
 
RefCount getRefCount () const
 

Private Attributes

RefCount m_usecount
 

Friends

void COWIntrusiveReferenceAddRef (COWIntrusiveCountableBase *p)
 Increment the reference count for a COWIntrusiveCountableBase object.
 
void COWIntrusiveReferenceRelease (COWIntrusiveCountableBase *p)
 Release a reference on a COWIntrusiveCountableBase.
 
bool COWIntrusiveReferenceUnique (COWIntrusiveCountableBase *p)
 Determine of a COWIntrusiveCountableBase only has one reference.
 
template<typename T>
T * COWIntrusiveReferenceClone (T *p)
 Have a COWIntrusiveCountableBase object create a clone of itself.
 

Detailed Description

Definition at line 78 of file COWIntrusiveCountableBase.hpp.

Constructor & Destructor Documentation

◆ COWIntrusiveCountableBase() [1/2]

BLOCXX_NAMESPACE::COWIntrusiveCountableBase::COWIntrusiveCountableBase ( COWIntrusiveCountableBase const & )
inlineprotected

◆ COWIntrusiveCountableBase() [2/2]

BLOCXX_NAMESPACE::COWIntrusiveCountableBase::COWIntrusiveCountableBase ( )
inlineprotected

Default constructor.

Definition at line 105 of file COWIntrusiveCountableBase.hpp.

References m_usecount.

◆ ~COWIntrusiveCountableBase()

BLOCXX_NAMESPACE::COWIntrusiveCountableBase::~COWIntrusiveCountableBase ( )
protectedvirtual

Destroy this COWIntrusiveCountableBase object.

Definition at line 44 of file COWIntrusiveCountableBase.cpp.

Member Function Documentation

◆ getRefCount()

RefCount BLOCXX_NAMESPACE::COWIntrusiveCountableBase::getRefCount ( ) const
inlineprotected
Returns
The RefCount object for this object.

Definition at line 117 of file COWIntrusiveCountableBase.hpp.

References m_usecount.

◆ operator=()

COWIntrusiveCountableBase & BLOCXX_NAMESPACE::COWIntrusiveCountableBase::operator= ( COWIntrusiveCountableBase const & x)
inlineprotected

Assignment operator.

This method does NOTHING.

Parameters
xThe COWIntrusiveCountableBase to assign to this one.
Returns
A reference to this COWIntrusiveCountableBase object.

Definition at line 96 of file COWIntrusiveCountableBase.hpp.

References COWIntrusiveCountableBase().

Friends And Related Symbol Documentation

◆ COWIntrusiveReferenceAddRef

void COWIntrusiveReferenceAddRef ( COWIntrusiveCountableBase * p)
friend

Increment the reference count for a COWIntrusiveCountableBase object.

Parameters
pThe COWIntrusiveCountableBase to increment the reference count for.

Definition at line 128 of file COWIntrusiveCountableBase.hpp.

References COWIntrusiveCountableBase(), BLOCXX_NAMESPACE::RefCount::inc(), and m_usecount.

◆ COWIntrusiveReferenceClone

template<typename T>
T * COWIntrusiveReferenceClone ( T * p)
friend

Have a COWIntrusiveCountableBase object create a clone of itself.

Parameters
pThe COWIntrusiveCountableBase object to clone.
Returns
A pointer to the new COWIntrusiveCountableBase object.

Definition at line 167 of file COWIntrusiveCountableBase.hpp.

References BLOCXX_NAMESPACE::COWIntrusiveReferenceAddRef().

◆ COWIntrusiveReferenceRelease

void COWIntrusiveReferenceRelease ( COWIntrusiveCountableBase * p)
friend

Release a reference on a COWIntrusiveCountableBase.

If the reference count is zero after the release, the COWIntrusiveCountableBase object will be deleted.

Parameters
pThe COWIntrusiveCountableBase object to release the reference for.

Definition at line 140 of file COWIntrusiveCountableBase.hpp.

References COWIntrusiveCountableBase(), BLOCXX_NAMESPACE::RefCount::decAndTest(), and m_usecount.

◆ COWIntrusiveReferenceUnique

bool COWIntrusiveReferenceUnique ( COWIntrusiveCountableBase * p)
friend

Determine of a COWIntrusiveCountableBase only has one reference.

Parameters
pThe COWIntrusiveCountableBase object to check for a single reference.
Returns
true if is COWIntrusiveCountableBase has only one reference.

Definition at line 152 of file COWIntrusiveCountableBase.hpp.

References COWIntrusiveCountableBase(), BLOCXX_NAMESPACE::RefCount::get(), and m_usecount.

Member Data Documentation

◆ m_usecount

RefCount BLOCXX_NAMESPACE::COWIntrusiveCountableBase::m_usecount
private

The documentation for this class was generated from the following files: