DCMTK
Version 3.6.4
OFFIS DICOM Toolkit
|
Template class which allows to declare global objects that are protected by a Mutex if used in multi-thread applications. More...
Public Member Functions | |
OFGlobal (const T &arg) | |
constructor. More... | |
virtual | ~OFGlobal () |
destructor. | |
void | set (const T &arg) |
assigns new value to this object. More... | |
void | xget (T &arg) |
gets the value of this object. More... | |
T | get () |
returns the value of this object. More... | |
Private Member Functions | |
OFGlobal () | |
unimplemented private default constructor | |
OFGlobal (const OFGlobal< T > &arg) | |
unimplemented private copy constructor | |
const OFGlobal< T > & | operator= (const OFGlobal< T > &arg) |
unimplemented private assignment operator | |
Private Attributes | |
T | val |
value of this object | |
OFMutex | theMutex |
if compiled for multi-thread operation, the Mutex protecting access to the value of this object. | |
Template class which allows to declare global objects that are protected by a Mutex if used in multi-thread applications.
Must be compiled with -DWITH_THREADS for multi-thread-operation. Template class T must have copy constructor and assignment operator.
constructor.
arg | value to which this object is initialised |
|
inline |
returns the value of this object.
If compiled for multi-thread operation, access to the value of the object is protected by a Mutex. The result is returned by value, not by reference.
References OFMutex::lock(), OFGlobal< T >::theMutex, OFMutex::unlock(), and OFGlobal< T >::val.
|
inline |
assigns new value to this object.
If compiled for multi-thread operation, access to the value of the object is protected by a Mutex.
arg | new value |
References OFMutex::lock(), OFGlobal< T >::theMutex, OFMutex::unlock(), and OFGlobal< T >::val.
|
inline |
gets the value of this object.
If compiled for multi-thread operation, access to the value of the object is protected by a Mutex.
arg | return value is assigned to this parameter. |
References OFMutex::lock(), OFGlobal< T >::theMutex, OFMutex::unlock(), and OFGlobal< T >::val.