DCMTK
Version 3.6.5
OFFIS DICOM Toolkit
|
Helper class containing the reference to the managed object and the reference counter. More...
Public Member Functions | |
Data (T *const pt) | |
Construct reference and counter from a raw pointer. More... | |
~Data () | |
Delete the managed object. More... | |
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. More... | |
T * | pointer () const |
Get the managed object. More... | |
Private Attributes | |
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. | |
Helper class containing the reference to the managed object and the reference counter.
|
inline |
Construct reference and counter from a raw pointer.
pt | the raw pointer that becomes the managed object. |
|
inline |
Delete the managed object.
We are deleted only if the reference counter reached zero, so we now have to delete the managed object.
References OFshared_ptr< T >::Data::m_pT.
|
inline |
Decrement the reference counter in a thread-safe and (if possible) lock-free fashion.
References OFMutex::lock(), OFshared_ptr< T >::Data::m_Count, OFshared_ptr< T >::Data::m_Mutex, and OFMutex::unlock().
Referenced by OFshared_ptr< DcmItem >::destroy().
|
inline |
Get the managed object.
References OFshared_ptr< T >::Data::m_pT.
Referenced by OFshared_ptr< DcmItem >::get(), OFshared_ptr< DcmItem >::operator OFBool(), OFshared_ptr< DcmItem >::operator!(), OFshared_ptr< DcmItem >::operator*(), and OFshared_ptr< DcmItem >::operator->().