| The Gaudi Framework v28r2p1 (f1a77ff4)

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

- File List
- File Members

Functions | Variables
ThreadGaudi.cpp File Reference
`#include "GaudiKernel/ThreadGaudi.h"`
`#include <sstream>`
`#include <iostream>`
Include dependency graph for ThreadGaudi.cpp:

Go to the source code of this file.

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

## Variables
const std::string | threadSeparator = "__"
const std::string | algToolSeparator = "."
ThreadGaudi * | ThreadGaudiInstance = nullptr

## Function Documentation

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
pp
Definition: compareOutputFiles.py:417
std::string::substr
T substr(T...args)

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)

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
pp
Definition: compareOutputFiles.py:417
std::string::substr
T substr(T...args)

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

## Variable Documentation

const std::string algToolSeparator = "."

Definition at line 10 of file ThreadGaudi.cpp.

ThreadGaudi* ThreadGaudiInstance = nullptr

Definition at line 81 of file ThreadGaudi.cpp.

const std::string threadSeparator = "__"

Definition at line 9 of file ThreadGaudi.cpp.