Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

IDEA::ThreadNames Class Reference
[UtilitiesUtilities]

Singleton class for threads to map a thread to a string for tracing purposes. More...

#include <ThreadTools.hh>

Inheritance diagram for IDEA::ThreadNames:

IDEA::Singleton< ThreadNames > List of all members.

Public Methods

 ~ThreadNames ()
 Destructor.


Static Public Methods

void registerThread (const std::string &name)
 Registers the thread thread under the name name.

const std::string getName ()
 Returns the name of thread, if the thread has not been registered the thread-number will be returned as string.

ThreadNames * instance ()

Static Protected Methods

ThreadNames *& getInstance ()
 The instance.

void release ()

Private Types

typedef std::map< ACE_thread_t,
std::string > 
Thread2String
 Container definition for the mapping threads to string.


Private Methods

 ThreadNames ()
 Constructor.


Static Private Attributes

Thread2String m_RegisteredThreads = ThreadNames::Thread2String()

Friends

class Singleton< ThreadNames >

Detailed Description

Singleton class for threads to map a thread to a string for tracing purposes.

The single global point of access for this singleton class is ThreadNames::instance() which returns a pointer to the ThreadNames instance.


Member Typedef Documentation

typedef std::map< ACE_thread_t, std::string > IDEA::ThreadNames::Thread2String [private]
 

Container definition for the mapping threads to string.


Constructor & Destructor Documentation

IDEA::ThreadNames::~ThreadNames  
 

Destructor.

IDEA::ThreadNames::ThreadNames   [private]
 

Constructor.


Member Function Documentation

ThreadNames*& IDEA::Singleton< ThreadNames >::getInstance   [inline, static, protected, inherited]
 

The instance.

This pattern is used to prevent "static initialization order fiasco" (Google this for better understanding)

const std::string IDEA::ThreadNames::getName   [static]
 

Returns the name of thread, if the thread has not been registered the thread-number will be returned as string.

ThreadNames* IDEA::Singleton< ThreadNames >::instance   [inline, static, inherited]
 

void IDEA::ThreadNames::registerThread const std::string &    name [static]
 

Registers the thread thread under the name name.

void IDEA::Singleton< ThreadNames >::release   [inline, static, protected, inherited]
 


Friends And Related Function Documentation

friend class Singleton< ThreadNames > [friend]
 


Member Data Documentation

ThreadNames::Thread2String IDEA::ThreadNames::m_RegisteredThreads = ThreadNames::Thread2String() [static, private]
 


Contact information
© IDEA
Generated on Fri Feb 3 17:09:49 2006 for IDEA.