All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
DataObjID.cpp
Go to the documentation of this file.
5 #include <functional>
6 
9 
10 void
12 
13  if (m_clid == 0) {
15  } else {
16  // this is a bit redundant since hash<int> is a pass-through
18  }
19 
20 }
21 
22 void
24  p_clidSvc = Gaudi::svcLocator()->service<IClassIDSvc>("ClassIDSvc").get();
25 }
26 
27 
28 void
30 
32 
34  m_clid = 0;
35  m_className = "UNKNOWN_CLASS:" + m_className;
36  }
37 
38 }
39 
40 
41 void
43 
45 
47  m_className = "UNKNOW_CLID:" + std::to_string(m_clid);
48  }
49 
50 }
51 
52 
55  if (d.m_clid == 0 && d.m_className == "") {
56  str << "('" << d.m_key << "')";
57  } else {
58  str << "('" << d.m_className << "','" << d.m_key << "')";
59  }
60  return str;
61 }
62 
65  if (m_clid == 0 && m_className == "") {
66  return m_key;
67  } else {
68  return ( m_className + "/" + m_key );
69  }
70 }
virtual StatusCode getIDOfTypeName(const std::string &typeName, CLID &id) const =0
get id associated with type name (if any)
virtual StatusCode getTypeNameOfID(const CLID &id, std::string &typeName) const =0
get user assigned type name associated with clID
T to_string(T...args)
static IClassIDSvc * p_clidSvc
Definition: DataObjID.h:86
std::string m_key
Definition: DataObjID.h:83
T call_once(T...args)
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
STL class.
static std::once_flag m_ip
Definition: DataObjID.h:87
interface to the CLID database
Definition: IClassIDSvc.h:23
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:78
GAUDI_API ISvcLocator * svcLocator()
CLID m_clid
Definition: DataObjID.h:79
std::size_t m_hash
Definition: DataObjID.h:80
static void getClidSvc()
Definition: DataObjID.cpp:23
void setClid()
Definition: DataObjID.cpp:29
void setClassName()
Definition: DataObjID.cpp:42
std::string fullKey() const
Definition: DataObjID.cpp:64
std::string m_className
Definition: DataObjID.h:82
STL class.
void hashGen()
Definition: DataObjID.cpp:11
friend std::ostream & operator<<(std::ostream &str, const DataObjID &d)
Definition: DataObjID.cpp:54