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. | |
SharedCounter & | operator= (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]
|
inline |
Construct with pointer and create a pointer specific counter.
- Parameters
-
rawPointer The raw memory pointer. deleter The deleter functor.
◆ SharedCounter() [2/3]
|
inlineexplicit |
Copy constructor adding a shared pointer reference.
- Parameters
-
counter The shared counter to copy.
References Murl::SharedPointerPrivate::CounterBase::AddReference().
◆ SharedCounter() [3/3]
|
inlineexplicit |
Copy constructor with a weak pointer counter adding a shared pointer reference.
- Parameters
-
counter The weak counter to copy.
References Murl::SharedPointerPrivate::CounterBase::AddReference().
Member Function Documentation
◆ operator=()
|
inline |
Assignment operator releasing the old shared pointer reference and adding a shared pointer reference to the new counter.
- Parameters
-
counter The shared counter to assign.
- Returns
- The object itself.
References Murl::SharedPointerPrivate::CounterBase::AddReference(), and Murl::SharedPointerPrivate::CounterBase::ReleaseReference().
◆ GetCount()
|
inline |
Get current usage count.
- Returns
- The number of shared pointer references.
References Murl::SharedPointerPrivate::CounterBase::GetCount().
Referenced by Murl::SharedPointer< DataType >::GetCount(), and Murl::SharedPointer< DataType >::IsUnique().
◆ Swap()
|
inline |
Swap with anoter shared counter.
- Parameters
-
counter The shared counter to swap with.
Referenced by Murl::SharedPointer< DataType >::Swap().
◆ operator<()
|
inline |
Less than operator.
- Parameters
-
rhs The 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