| The Gaudi Framework v27r1

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

- File List
- File Members

Classes | Functions
ThreadGaudi.h File Reference
`#include "GaudiKernel/System.h"`
`#include <string>`
`#include <map>`
`#include <memory>`
Include dependency graph for ThreadGaudi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes
class | ThreadGaudi
| singleton mapping the pthread ID to the Gaudi thread ID More...

## Functions
GAUDI_API std::string | getGaudiThreadIDfromID (int iCopy)
| helper function to extract Gaudi Thread ID from thread copy number More...
GAUDI_API std::string | getGaudiThreadIDfromName (const std::string &name)
| helper function to extract Gaudi Thread ID from thread copy name More...
GAUDI_API std::string | getGaudiThreadGenericName (const std::string &name)
| helper function to extract Gaudi instance name from thread copy name More...
GAUDI_API bool | isGaudiThreaded (const std::string &name)
| test if current Gaudi object is running /will run in a thread More...

## Function Documentation

GAUDI_API std::string getGaudiThreadGenericName | ( | const std::string & | name | ) |

helper function to extract Gaudi instance name from thread copy name

Definition at line 50 of file ThreadGaudi.cpp.

50 {
51 std::string genericName = name ;
52
53 // find parent if name of an AlgTool
54 std::string parent_name = name ;
55 std::string tool_name = "" ;
56 size_t pp = name.find(".") ;
57 if ( (pp > 0) && (pp <= name.length()) ) {
58 parent_name = name.substr(0,name.find(".")-1) ;
59 tool_name = name.substr(name.find("."));
60 }
61
62 // construct gneric name
63 pp = parent_name.find(threadSeparator) ;
64 if ( (pp > 0) && (pp <= parent_name.length()) ) {
65 genericName = parent_name.substr(0,parent_name.find(threadSeparator))+tool_name ;
66 }
67 return genericName ;
68 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
std::string
STL class.
threadSeparator
const std::string threadSeparator
Definition: ThreadGaudi.cpp:9
std::string::find
T find(T...args)
std::string::length
T length(T...args)
compareOutputFiles.pp
tuple pp
Definition: compareOutputFiles.py:417
std::string::substr
T substr(T...args)

GAUDI_API std::string getGaudiThreadIDfromID | ( | int | iCopy | ) |

helper function to extract Gaudi Thread ID from thread copy number

Definition at line 16 of file ThreadGaudi.cpp.

16 {
17 std::ostringstream ost;
18 ost << threadSeparator << iCopy << std::ends;
19 return ost.str();
20 }
std::ostringstream
STL class.
std::ostringstream::str
T str(T...args)
threadSeparator
const std::string threadSeparator
Definition: ThreadGaudi.cpp:9
std::ends
T ends(T...args)

GAUDI_API std::string getGaudiThreadIDfromName | ( | const std::string & | name | ) |

helper function to extract Gaudi Thread ID from thread copy name

Definition at line 26 of file ThreadGaudi.cpp.

26 {
27 std::string threadAppendix = "" ;
28
29 // find parent if name of an AlgTool
30 std::string parent_name = name ;
31 std::string tool_name = "" ;
32 size_t pp = name.find(".") ;
33 if ( (pp > 0) && (pp <= name.length()) ) {
34 parent_name = name.substr(0,name.find(".")-1) ;
35 tool_name = name.substr(name.find("."));
36 }
37
38 // get from (parent_)name thread ID
39 pp = parent_name.find(threadSeparator) ;
40 if ( (pp > 0) && (pp <= parent_name.length()) ) {
41 threadAppendix = parent_name.substr(parent_name.find(threadSeparator)) ;
42 }
43 return threadAppendix ;
44 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:28
std::string
STL class.
threadSeparator
const std::string threadSeparator
Definition: ThreadGaudi.cpp:9
std::string::find
T find(T...args)
std::string::length
T length(T...args)
compareOutputFiles.pp
tuple pp
Definition: compareOutputFiles.py:417
std::string::substr
T substr(T...args)

GAUDI_API bool isGaudiThreaded | ( | const std::string & | name | ) |

test if current Gaudi object is running /will run in a thread

Definition at line 73 of file ThreadGaudi.cpp.

73 {
74 return (!(getGaudiThreadIDfromName(name).empty()));
75 }
getGaudiThreadIDfromName
std::string getGaudiThreadIDfromName(const std::string &name)
helper function to extract Gaudi Thread ID from thread copy name
Definition: ThreadGaudi.cpp:26