DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
OFThreadSpecificData Class Reference

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
 
OFThreadSpecificDataoperator= (const OFThreadSpecificData &arg)
 unimplemented private assignment operator
 

Private Attributes

void * theKey
 thread specific data key resource
 

Detailed Description

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.

Constructor & Destructor Documentation

OFThreadSpecificData::~OFThreadSpecificData ( )

destructor.

Deletes all thread specific key values (pointers), but not the objects pointed to.

Member Function Documentation

static void OFThreadSpecificData::errorstr ( OFString description,
int  code 
)
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.

Parameters
descriptionstring object into which the error description is written.
codeerror 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.

Parameters
valuenew pointer to thread-specific data for this object returned in this parameter.
Returns
0 if successful, an error code otherwise.
OFBool OFThreadSpecificData::initialized ( ) const

checks whether creation of the object was successful.

Returns
OFTrue if the object was successfully created, OFFalse otherwise.
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.

Parameters
valuenew pointer to thread-specific data for this object.
Returns
0 if successful, an error code otherwise.

The documentation for this class was generated from the following file:


Generated on Tue Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8