DCMTK
Version 3.6.1 20170228
OFFIS DICOM Toolkit
|
provides an operating system independent abstraction for thread specific data. More...
Public Member Functions | |
OFThreadSpecificData () | |
default constructor | |
~OFThreadSpecificData () | |
destructor. More... | |
OFBool | initialized () const |
checks whether creation of the object was successful. More... | |
int | set (void *value) |
sets the thread specific value for this object. More... | |
int | get (void *&value) |
retrieves the thread specific value for this object. More... | |
Static Public Member Functions | |
static void | errorstr (OFString &description, int code) |
converts any of the error codes returned by the methods of this class into a textual description, which is written into the string object. More... | |
Private Member Functions | |
OFThreadSpecificData (const OFThreadSpecificData &arg) | |
unimplemented private copy constructor | |
OFThreadSpecificData & | operator= (const OFThreadSpecificData &arg) |
unimplemented private assignment operator | |
Private Attributes | |
void * | theKey |
thread specific data key resource | |
provides an operating system independent abstraction for thread specific data.
An instance of this class manages a key which is global to all threads in the process but locates data specific to each thread. Each thread can set a different value once the object has been created. Upon creation, the value NULL is assigned for all threads. This class does not perform any memory management on the objects pointed to. Threads must ensure on their own that the data pointed to by the thread specific data key is freed upon termination of the thread.
OFThreadSpecificData::~OFThreadSpecificData | ( | ) |
destructor.
Deletes all thread specific key values (pointers), but not the objects pointed to.
|
static |
converts any of the error codes returned by the methods of this class into a textual description, which is written into the string object.
description | string object into which the error description is written. |
code | error code |
int OFThreadSpecificData::get | ( | void *& | value | ) |
retrieves the thread specific value for this object.
If no call to set() has been made for the calling thread before, NULL is returned.
value | new pointer to thread-specific data for this object returned in this parameter. |
OFBool OFThreadSpecificData::initialized | ( | ) | const |
checks whether creation of the object was successful.
int OFThreadSpecificData::set | ( | void * | value | ) |
sets the thread specific value for this object.
No attempt is made to automatically delete the object pointed to at the termination of the thread.
value | new pointer to thread-specific data for this object. |