Gaudi Framework, version v25r2

Home   Generated: Wed Jun 4 2014
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ThreadGaudi Class Reference

singleton mapping the pthread ID to the Gaudi thread ID More...

#include <GaudiKernel/ThreadGaudi.h>

Collaboration diagram for ThreadGaudi:
Collaboration graph
[legend]

Public Types

typedef std::map
< System::ThreadHandle,
std::string > 
ThreadMap
 

Public Member Functions

void setThreadID (const std::string &threadID)
 associate Gaudi ID to pthread
 
ThreadMapgetThreadMap ()
 access the whole map
 
const std::string & getThreadID ()
 get Gaudi ID of current pthread
 

Static Public Member Functions

static ThreadGaudiinstance ()
 singleton access
 

Protected Member Functions

 ThreadGaudi ()
 
virtual ~ThreadGaudi ()
 

Protected Attributes

ThreadMapm_threadMap
 

Detailed Description

singleton mapping the pthread ID to the Gaudi thread ID

Author
Werner Wiedenmann
Id:
ThreadGaudi.h,v 1.3 2003/06/25 15:45:10 mato Exp

Definition at line 15 of file ThreadGaudi.h.

Member Typedef Documentation

typedef std::map< System::ThreadHandle , std::string > ThreadGaudi::ThreadMap

Definition at line 17 of file ThreadGaudi.h.

Constructor & Destructor Documentation

ThreadGaudi::ThreadGaudi ( )
protected

Definition at line 85 of file ThreadGaudi.cpp.

{
(*m_threadMap)[0] = "" ;
}
ThreadGaudi::~ThreadGaudi ( )
protectedvirtual

Definition at line 90 of file ThreadGaudi.cpp.

{
delete m_threadMap;
}

Member Function Documentation

const std::string & ThreadGaudi::getThreadID ( )

get Gaudi ID of current pthread

Definition at line 117 of file ThreadGaudi.cpp.

{
ThreadMap* p_threadMap = getThreadMap() ;
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.

ThreadGaudi * ThreadGaudi::instance ( )
static

singleton access

Definition at line 94 of file ThreadGaudi.cpp.

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
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
}
}

Member Data Documentation

ThreadMap* ThreadGaudi::m_threadMap
protected

Definition at line 30 of file ThreadGaudi.h.


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

Generated at Wed Jun 4 2014 14:49:04 for Gaudi Framework, version v25r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004