|
Gaudi Framework, version v23r4 |
| Home | Generated: Mon Sep 17 2012 |
#include "GaudiKernel/System.h"#include <string>#include <map>

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 | |
| GAUDI_API std::string | getGaudiThreadIDfromName (const std::string &name) |
| helper function to extract Gaudi Thread ID from thread copy name | |
| GAUDI_API std::string | getGaudiThreadGenericName (const std::string &name) |
| helper function to extract Gaudi instance name from thread copy name | |
| GAUDI_API bool | isGaudiThreaded (const std::string &name) |
| test if current Gaudi object is running /will run in a thread | |
| GAUDI_API 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 ;
}
| GAUDI_API 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();
}
| GAUDI_API 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 ;
}
| GAUDI_API 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()));
}