|
Gaudi Framework, version v23r2 |
| Home | Generated: Thu Jun 28 2012 |
#include "GaudiKernel/ThreadGaudi.h"#include <sstream>#include <iostream>
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 |
| 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()));
}
| const std::string algToolSeparator = "." |
Definition at line 12 of file ThreadGaudi.cpp.
Definition at line 83 of file ThreadGaudi.cpp.
| const std::string threadSeparator = "__" |
Definition at line 11 of file ThreadGaudi.cpp.