Helper class containing the reference to the managed object and the reference counter.
More...
|
| Data (T *const pt) |
| Construct reference and counter from a raw pointer.
|
|
| ~Data () |
| Delete the managed object.
|
|
void | increment_count () |
| Increment the reference counter in a thread-safe and (if possible) lock-free fashion.
|
|
OFBool | decrement_count () |
| Decrement the reference counter in a thread-safe and (if possible) lock-free fashion.
|
|
T * | pointer () const |
| Get the managed object.
|
|
|
OF_SHARED_PTR_COUNTER_TYPE | m_Count |
| The counter.
|
|
T *const | m_pT |
| The pointer to the managed object.
|
|
OFMutex | m_Mutex |
| A mutex for platforms that don't support lock-free counters.
|
|
template<typename T>
class OFshared_ptr< T >::Data
Helper class containing the reference to the managed object and the reference counter.
◆ Data()
Construct reference and counter from a raw pointer.
- Parameters
-
pt | the raw pointer that becomes the managed object. |
References m_Count, m_Mutex, and m_pT.
◆ ~Data()
Delete the managed object.
We are deleted only if the reference counter reached zero, so we now have to delete the managed object.
References m_pT.
◆ decrement_count()
Decrement the reference counter in a thread-safe and (if possible) lock-free fashion.
- Returns
- OFTrue if the reference counter reached zero, OFFalse otherwise.
References m_Count, and m_Mutex.
◆ pointer()
Get the managed object.
- Returns
- a pointer to the managed object.
References m_pT.
The documentation for this class was generated from the following file:
- ofstd/include/dcmtk/ofstd/ofmem.h