Murl::SharedPointerPrivate::SharedCounter Class Reference

The shared pointer counter class. More...

#include "murl_shared_pointer_private.h"

Public Member Functions

 SharedCounter ()
 The default constructor.
 
template<class RawType , class DeleterType >
 SharedCounter (RawType *rawPointer, DeleterType deleter)
 Construct with pointer and create a pointer specific counter. More...
 
 SharedCounter (const SharedCounter &counter)
 Copy constructor adding a shared pointer reference. More...
 
 SharedCounter (const WeakCounter &counter)
 Copy constructor with a weak pointer counter adding a shared pointer reference. More...
 
 ~SharedCounter ()
 Destructor releasing a shared pointer reference.
 
SharedCounteroperator= (const SharedCounter &counter)
 Assignment operator releasing the old shared pointer reference and adding a shared pointer reference to the new counter. More...
 
UInt32 GetCount () const
 Get current usage count. More...
 
void Swap (SharedCounter &counter)
 Swap with anoter shared counter. More...
 
bool operator< (const SharedCounter &rhs) const
 Less than operator. More...
 

Detailed Description

The shared pointer counter class.

Constructor & Destructor Documentation

◆ SharedCounter() [1/3]

template<class RawType , class DeleterType >
Murl::SharedPointerPrivate::SharedCounter::SharedCounter ( RawType *  rawPointer,
DeleterType  deleter 
)
inline

Construct with pointer and create a pointer specific counter.

Parameters
rawPointerThe raw memory pointer.
deleterThe deleter functor.

◆ SharedCounter() [2/3]

Murl::SharedPointerPrivate::SharedCounter::SharedCounter ( const SharedCounter counter)
inlineexplicit

Copy constructor adding a shared pointer reference.

Parameters
counterThe shared counter to copy.

◆ SharedCounter() [3/3]

Murl::SharedPointerPrivate::SharedCounter::SharedCounter ( const WeakCounter counter)
inlineexplicit

Copy constructor with a weak pointer counter adding a shared pointer reference.

Parameters
counterThe weak counter to copy.

References Murl::SharedPointerPrivate::CounterBase::AddReference().

Member Function Documentation

◆ operator=()

SharedCounter& Murl::SharedPointerPrivate::SharedCounter::operator= ( const SharedCounter counter)
inline

Assignment operator releasing the old shared pointer reference and adding a shared pointer reference to the new counter.

Parameters
counterThe shared counter to assign.
Returns
The object itself.

References Murl::SharedPointerPrivate::CounterBase::AddReference().

◆ GetCount()

UInt32 Murl::SharedPointerPrivate::SharedCounter::GetCount ( ) const
inline

Get current usage count.

Returns
The number of shared pointer references.

Referenced by Murl::SharedPointer< IProcessor >::GetCount(), and Murl::SharedPointer< IProcessor >::IsUnique().

◆ Swap()

void Murl::SharedPointerPrivate::SharedCounter::Swap ( SharedCounter counter)
inline

Swap with anoter shared counter.

Parameters
counterThe shared counter to swap with.

Referenced by Murl::SharedPointer< IProcessor >::Swap().

◆ operator<()

bool Murl::SharedPointerPrivate::SharedCounter::operator< ( const SharedCounter rhs) const
inline

Less than operator.

Parameters
rhsThe right hand side SharedCounter to compare.
Returns
true if the left hand side (this) is less than the right hand side.

The documentation for this class was generated from the following file:
  • murl_shared_pointer_private.h


Copyright © 2011-2018 Spraylight GmbH.