| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

ThreadGaudi.h
Go to the documentation of this file.
1 #ifndef GAUDI_KERNEL_THREADLIBGAUDI_H
2 #define GAUDI_KERNEL_THREADLIBGAUDI_H
3
4 #include "GaudiKernel/System.h" /* ThreadHandle" */
5 #include <map>
6 #include <memory>
7 #include <string>
8
13 class GAUDI_API ThreadGaudi
14 {
15 public:
16 typedef std::map<System::ThreadHandle, std::string> ThreadMap;
18 static ThreadGaudi* instance();
20 void setThreadID( const std::string& threadID );
22 ThreadMap* getThreadMap();
24 const std::string& getThreadID();
25
26 protected:
27 ThreadGaudi();
28 virtual ~ThreadGaudi() = default;
29 std::unique_ptr<ThreadMap> m_threadMap;
30 };
31
33 GAUDI_API std::string getGaudiThreadIDfromID( int iCopy );
35 GAUDI_API std::string getGaudiThreadIDfromName( const std::string& name );
37 GAUDI_API std::string getGaudiThreadGenericName( const std::string& name );
39 GAUDI_API bool isGaudiThreaded( const std::string& name );
40
41 #endif // GAUDI_KERNEL_THREADLIBGAUDI_H
System.h
ThreadGaudi::m_threadMap
std::unique_ptr< ThreadMap > m_threadMap
Definition: ThreadGaudi.h:29
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
std::map
STL class.
isGaudiThreaded
GAUDI_API bool isGaudiThreaded(const std::string &name)
test if current Gaudi object is running /will run in a thread
Definition: ThreadGaudi.cpp:76
ThreadGaudi
singleton mapping the pthread ID to the Gaudi thread ID
Definition: ThreadGaudi.h:13
std::string
STL class.
ThreadGaudi::ThreadMap
std::map< System::ThreadHandle, std::string > ThreadMap
Definition: ThreadGaudi.h:16
getGaudiThreadIDfromID
GAUDI_API std::string getGaudiThreadIDfromID(int iCopy)
helper function to extract Gaudi Thread ID from thread copy number
Definition: ThreadGaudi.cpp:16
std::unique_ptr
STL class.
getGaudiThreadIDfromName
GAUDI_API std::string getGaudiThreadIDfromName(const std::string &name)
helper function to extract Gaudi Thread ID from thread copy name
Definition: ThreadGaudi.cpp:27
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
getGaudiThreadGenericName
GAUDI_API std::string getGaudiThreadGenericName(const std::string &name)
helper function to extract Gaudi instance name from thread copy name
Definition: ThreadGaudi.cpp:52