| # Gaudi Framework, version v25r0 |

Home |  | Generated: Mon Feb 17 2014

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

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
std::string | getGaudiThreadIDfromName (const std::string &name)
| helper function to extract Gaudi Thread ID from thread copy name
std::string | getGaudiThreadGenericName (const std::string &name)
| helper function to extract Gaudi instance name from thread copy name
bool | isGaudiThreaded (const std::string &name)
| test if current Gaudi object is running /will run in a thread

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

## Function Documentation

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

helper function to extract Gaudi instance name from thread copy name

Definition at line 52 of file ThreadGaudi.cpp.

{
std::string genericName = name ;
// find parent if name of an AlgTool
std::string parent_name = name ;
std::string tool_name = "" ;
size_t pp = name.find(".") ;
if ( (pp > 0) && (pp <= name.length()) ) {
parent_name = name.substr(0,name.find(".")-1) ;
tool_name = name.substr(name.find("."));
}
// construct gneric name
pp = parent_name.find(threadSeparator) ;
if ( (pp > 0) && (pp <= parent_name.length()) ) {
genericName = parent_name.substr(0,parent_name.find(threadSeparator))+tool_name ;
}
return genericName ;
}

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

helper function to extract Gaudi Thread ID from thread copy number

Definition at line 18 of file ThreadGaudi.cpp.

{
std::ostringstream ost;
ost << threadSeparator << iCopy << std::ends;
return ost.str();
}

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

helper function to extract Gaudi Thread ID from thread copy name

Definition at line 28 of file ThreadGaudi.cpp.

{
std::string threadAppendix = "" ;
// find parent if name of an AlgTool
std::string parent_name = name ;
std::string tool_name = "" ;
size_t pp = name.find(".") ;
if ( (pp > 0) && (pp <= name.length()) ) {
parent_name = name.substr(0,name.find(".")-1) ;
tool_name = name.substr(name.find("."));
}
// get from (parent_)name thread ID
pp = parent_name.find(threadSeparator) ;
if ( (pp > 0) && (pp <= parent_name.length()) ) {
threadAppendix = parent_name.substr(parent_name.find(threadSeparator)) ;
}
return threadAppendix ;
}

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

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

Definition at line 75 of file ThreadGaudi.cpp.

{
return (!(getGaudiThreadIDfromName(name).empty()));
}

## Variable Documentation

const std::string algToolSeparator = "."

Definition at line 12 of file ThreadGaudi.cpp.

ThreadGaudi* ThreadGaudiInstance = 0

Definition at line 83 of file ThreadGaudi.cpp.

const std::string threadSeparator = "__"

Definition at line 11 of file ThreadGaudi.cpp.