![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
18 #include "GaudiKernel/IClassIDSvc.h"
19 #include "GaudiKernel/System.h"
34 std::type_info
const* &ti,
35 const std::string& context,
42 const TClass*
cls = TClass::GetClass (
name.c_str());
44 ti =
cls->GetTypeInfo();
45 if (ti)
return StatusCode::SUCCESS;
54 return StatusCode::SUCCESS;
59 <<
"Can't convert type name " <<
name <<
" to type_info.";
61 return StatusCode::FAILURE;
74 const std::string& context,
81 if (
clidsvc->getIDOfTypeName (
name, clid).isSuccess())
82 return StatusCode::SUCCESS;
83 if (
clidsvc->getIDOfTypeInfoName (
name, clid).isSuccess())
84 return StatusCode::SUCCESS;
87 <<
"Can't find CLID for type name " <<
name;
88 return StatusCode::FAILURE;
100 const std::string&
name,
101 std::type_info
const* &ti,
102 const std::string& context)
108 return StatusCode::SUCCESS;
112 const TClass*
cls = TClass::GetClass (
name.c_str());
114 ti =
cls->GetTypeInfo();
116 return StatusCode::SUCCESS;
120 <<
"Can't find typeinfo for CLID "
121 << clid <<
" (type " <<
name <<
").";
122 return StatusCode::FAILURE;
133 if (ti ==
typeid(
float))
135 else if (ti ==
typeid(
double))
137 else if (ti ==
typeid(
int))
139 else if (ti ==
typeid(
bool))
141 else if (ti ==
typeid(
char))
143 else if (ti ==
typeid(
signed char))
144 return "signed char";
145 else if (ti ==
typeid(
unsigned char))
146 return "unsigned char";
147 else if (ti ==
typeid(
short))
149 else if (ti ==
typeid(
unsigned short))
150 return "unsigned short";
151 else if (ti ==
typeid(
unsigned int))
152 return "unsigned int";
153 else if (ti ==
typeid(
long))
155 else if (ti ==
typeid(
unsigned long))
156 return "unsigned long";
157 else if (ti ==
typeid(
long long))
159 else if (ti ==
typeid(
unsigned long long))
160 return "unsigned long long";
161 else if (ti ==
typeid(
long double))
162 return "long double";
163 else if (ti ==
typeid(
wchar_t))
168 TClass* eltcls = TClass::GetClass (ti);
170 eltname = eltcls->GetName();
173 std::string eltname = System::typeinfoName (ti);
174 eltcls = TClass::GetClass (eltname.c_str());
176 eltname = eltcls->GetName();
#define CHECK_WITH_CONTEXT(...)
Evaluate an expression and check for errors, with an explicitly specified context name.
StatusCode nameToTypeinfo(const std::string &name, std::type_info const *&ti, const std::string &context, ServiceHandle< IClassIDSvc > clidsvc=ServiceHandle< IClassIDSvc >("ClassIDSvc", "TypeNameConversions"))
Convert from a class name to a type_info.
Block filler tool for noisy FEB information.
Provide an interface for finding inheritance information at run time.
::StatusCode StatusCode
StatusCode definition for legacy code.
StatusCode nameToCLID(const std::string &name, CLID &clid, const std::string &context, ServiceHandle< IClassIDSvc > clidsvc=ServiceHandle< IClassIDSvc >("ClassIDSvc", "TypeNameConversions"))
Convert from a class name to a CLID.
std::string typeinfoToName(const std::type_info &ti)
Convert from a type_info to a name.
StatusCode clidToTypeinfo(CLID clid, const std::string &nmae, std::type_info const *&ti, const std::string &context)
Convert from a CLID to a type_info; we also already know the name.
uint32_t CLID
The Class ID type.
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Helpers for checking error return status codes and reporting errors.
The non-template portion of the BaseInfo implementation.
const std::type_info & typeinfo() const
Return the std::type_info for this class.
Utility functions for converting between type names, type_info, and CLIDs.