|
Gaudi Framework, version v22r2 |
| Home | Generated: Tue May 10 2011 |
singleton mapping the pthread ID to the Gaudi thread ID More...
#include <GaudiKernel/ThreadGaudi.h>

Public Types | |
| typedef std::map < System::ThreadHandle, std::string > | ThreadMap |
Public Member Functions | |
| void | setThreadID (const std::string &threadID) |
| associate Gaudi ID to pthread | |
| ThreadMap * | getThreadMap () |
| access the whole map | |
| const std::string & | getThreadID () |
| get Gaudi ID of current pthread | |
Static Public Member Functions | |
| static ThreadGaudi * | instance () |
| singleton access | |
Protected Member Functions | |
| ThreadGaudi () | |
| virtual | ~ThreadGaudi () |
Protected Attributes | |
| ThreadMap * | m_threadMap |
singleton mapping the pthread ID to the Gaudi thread ID
Definition at line 15 of file ThreadGaudi.h.
| typedef std::map< System::ThreadHandle , std::string > ThreadGaudi::ThreadMap |
Definition at line 17 of file ThreadGaudi.h.
| ThreadGaudi::ThreadGaudi | ( | ) | [protected] |
Definition at line 85 of file ThreadGaudi.cpp.
{
m_threadMap = new ThreadMap();
(*m_threadMap)[0] = "" ;
}
| ThreadGaudi::~ThreadGaudi | ( | ) | [protected, virtual] |
Definition at line 90 of file ThreadGaudi.cpp.
{
delete m_threadMap;
}
| const std::string & ThreadGaudi::getThreadID | ( | ) |
get Gaudi ID of current pthread
Definition at line 117 of file ThreadGaudi.cpp.
{
ThreadMap* p_threadMap = getThreadMap() ;
System::ThreadHandle s_pid = System::threadSelf() ;
if ( p_threadMap->find(s_pid) != p_threadMap->end() ) {
return (*p_threadMap->find(s_pid)).second ;
} else {
return (*p_threadMap->find(0)).second ; ;
}
}
| ThreadGaudi::ThreadMap * ThreadGaudi::getThreadMap | ( | ) |
access the whole map
Definition at line 113 of file ThreadGaudi.cpp.
{
return ThreadGaudi::instance()->m_threadMap;
}
| ThreadGaudi * ThreadGaudi::instance | ( | ) | [static] |
singleton access
Definition at line 94 of file ThreadGaudi.cpp.
{
if ( 0 == ThreadGaudiInstance ) {
ThreadGaudiInstance = new ThreadGaudi();
}
return ThreadGaudiInstance ;
}
| void ThreadGaudi::setThreadID | ( | const std::string & | threadID ) |
associate Gaudi ID to pthread
Definition at line 101 of file ThreadGaudi.cpp.
{
ThreadMap* p_threadMap = getThreadMap() ;
// get from name thread ID
System::ThreadHandle s_pid = System::threadSelf() ;
if (p_threadMap->count(s_pid) == 0 ) {
(*p_threadMap)[s_pid] = threadID ;
#ifdef THREAD_GAUDI__DEBUG
std::cout << " *** ThreadGaudi setThreadID *** value set for *** " << threadID << " thread ID : " << s_pid << std::endl ;
#endif
}
}
ThreadMap* ThreadGaudi::m_threadMap [protected] |
Definition at line 30 of file ThreadGaudi.h.