OFThreadSpecificData Class Reference

provides an operating system independent abstraction for thread specific data. More...

List of all members.

Public Member Functions

 OFThreadSpecificData ()
 default constructor
 ~OFThreadSpecificData ()
 destructor.
OFBool initialized () const
 checks whether creation of the object was successful.
int set (void *value)
 sets the thread specific value for this object.
int get (void *&value)
 retrieves the thread specific value for this object.

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.

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.

Definition at line 206 of file ofthread.h.


Constructor & Destructor Documentation

OFThreadSpecificData::~OFThreadSpecificData (  ) 

destructor.

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


Member Function Documentation

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:
value new pointer to thread-specific data for this object.
Returns:
0 if successful, an error code otherwise.

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:
value new pointer to thread-specific data for this object returned in this parameter.
Returns:
0 if successful, an error code otherwise.

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:
description string object into which the error description is written.
code error code


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


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1