14 #include "TDictAttributeMap.h"
28 m_type.destruct( ptr );
42 if( type == castType ){
44 }
else if( type.
hasBase( castType )){
45 ret =
reinterpret_cast<void*
>(
reinterpret_cast<size_t>(ptr) + type.
getBaseClassOffset(castType));
53 if( type == baseType || type.
hasBase( baseType )){
65 while((pos = name.find(from, pos)) != std::string::npos) {
66 name.replace(pos, length, to);
73 size_t pos = name.find(
'<');
74 if(pos == std::string::npos) {
78 size_t nameSize = name.size();
79 if(other.size() >= nameSize) {
83 if(name.substr(0, pos) != other.substr(0, pos)) {
88 for(
size_t i = pos;
i < nameSize; ++
i) {
90 if (c ==
'<') ++nesting;
92 if(c !=
'u' && c !=
'l')
return false;
93 if(nesting == 0)
return false;
94 if(!isdigit(name[
i-1]))
return false;
95 for(
size_t n =
i-2;
n >= pos; --
n) {
97 if(q ==
'<' || q ==
',')
break;
98 if(!isdigit(q))
return false;
100 for(
size_t n =
i+1;
n < nameSize; ++
n) {
102 if(q ==
'>' || q ==
',')
break;
103 if(q !=
'l')
return false;
108 if (c ==
'>') --nesting;
117 return (mappedTypeName==
"std::basic_string<char>" || mappedTypeName==
"basic_string<char>" || mappedTypeName==
"std::string" || mappedTypeName==
"string");
118 }
else if ( type.
isEnum() ){
119 return mappedTypeName==
"int";
122 }
else if ( type.
cppName() == mappedTypeName ) {
127 replaceString(typeName,
"std::basic_string<char> ",
"std::string");
128 replaceString(typeName,
"std::basic_string<char>",
"std::string");
129 if ( type.
cppName() == typeName ) {
138 if ( ! type.
hasBase(baseType) ) {
162 char* realname = abi::__cxa_demangle( typeInfo.name(), 0, 0, &
status);
163 if( status == 0 && realname ){
181 if( !type && throwFlag ){
183 "ClassUtils::lookupDictionary" );
190 if( className ==
"std::basic_string<char>" ){
198 if( !type && throwFlag ){
199 throwException(
"Class \""+className+
"\" has not been found in the dictionary.",
200 "ClassUtils::lookupDictionary" );
207 if( typ.
cppName()==
"std::string"){
217 return ( name ==
"std::string" ||
218 name ==
"std::basic_string<char>" );
230 if( contName ==
"std::vector" ||
231 contName ==
"std::list" ||
232 contName ==
"std::deque" ||
233 contName ==
"std::stack" ||
234 contName ==
"std::set" ||
235 contName ==
"std::multiset" ||
236 contName ==
"__gnu_cxx::hash_set" ||
237 contName ==
"__gnu_cxx::hash_multiset" ||
238 contName ==
"std::map" ||
239 contName ==
"std::multimap" ||
240 contName ==
"__gnu_cxx::hash_map" ||
241 contName ==
"__gnu_cxx::hash_multimap" ||
242 contName ==
"ora::PVector" ||
243 contName ==
"ora::QueryableVector" ){
255 if( contName ==
"std::map" ||
256 contName ==
"std::multimap" ||
257 contName ==
"std::set" ||
258 contName ==
"std::multiset" ||
259 contName ==
"__gnu_cxx::hash_set" ||
260 contName ==
"__gnu_cxx::hash_multiset" ||
261 contName ==
"__gnu_cxx::hash_map" ||
262 contName ==
"__gnu_cxx::hash_multimap" ){
274 if( contName ==
"std::vector" ||
275 contName ==
"std::list" ||
276 contName ==
"std::deque" ||
277 contName ==
"std::stack" ||
278 contName ==
"ora::PVector" ||
279 contName ==
"ora::QueryableVector" ){
291 if( contName ==
"std::map" ||
292 contName ==
"std::multimap" ||
293 contName ==
"__gnu_cxx::hash_map" ||
294 contName ==
"__gnu_cxx::hash_multimap" ){
306 if( contName ==
"std::vector" ||
307 contName ==
"std::list" ||
308 contName ==
"std::deque" ||
309 contName ==
"std::stack" ||
310 contName ==
"std::set" ||
311 contName ==
"std::multiset" ||
312 contName ==
"__gnu_cxx::hash_set" ||
313 contName ==
"__gnu_cxx::hash_multiset" ||
314 contName ==
"ora::PVector" ||
315 contName ==
"ora::QueryableVector"){
328 if( contName ==
"ora::Ptr" ){
348 if( contName ==
"ora::UniqueRef" ){
360 if( contName ==
"ora::PVector" ){
372 if( contName ==
"ora::QueryableVector" ){
387 size_t idx = typeName.find(
'<');
388 if( idx != std::string::npos ){
390 return (tname ==
"ora::PVector" || tname ==
"ora::QueryableVector" || tname ==
"pool::PVector" );
401 if( resType.
isArray( ) )
return false;
505 TDictAttributeMap* classProps = rclass->GetAttributeMap();
506 if( classProps && classProps->HasKey( propertyName.c_str() ) ){
507 ret = classProps->GetPropertyAsString( propertyName.c_str() );
517 if( declaringClass ){
518 auto dm = declaringClass->GetDataMember( dataMember.
name().c_str() );
520 TDictAttributeMap* memberProps = dm->GetAttributeMap();
521 if( memberProps && memberProps->HasKey( propertyName.c_str() ) ){
522 ret = memberProps->GetPropertyAsString( propertyName.c_str() );
bool isTypeObject(const edm::TypeWithDict &typ)
edm::TypeWithDict resolvedType(const edm::TypeWithDict &typ)
bool isTypeKeyedContainer(const edm::TypeWithDict &typ)
TypeWithDict finalType() const
bool isTypeNamedReference(const edm::TypeWithDict &typ)
static char const * tname
static bool compareWithSuffixes(std::string const &name, std::string const &other)
bool isTypeString(const edm::TypeWithDict &typ)
void * upCast(const edm::TypeWithDict &type, void *ptr, const edm::TypeWithDict &asType)
void operator()(void *ptr)
TypeWithDict nestedType(char const *) const
RflxDeleter(const edm::TypeWithDict &type)
bool hasBase(std::string const &) const
bool isTypePrimitive(const edm::TypeWithDict &typ)
TypeWithDict toType() const
bool isTypeOraPointer(const edm::TypeWithDict &typ)
bool isType(const edm::TypeWithDict &type, const edm::TypeWithDict &baseType)
static TypeWithDict byName(std::string const &name)
std::string demangledName(const std::type_info &typeInfo)
TypeWithDict declaringType() const
bool isTypeNonAssociativeContainer(const edm::TypeWithDict &typ)
std::string templateName() const
bool isTemplateInstance() const
TClass * getClass() const
bool isTypeNameOraVector(const std::string &typeName)
void loadDictionary(const std::string &className)
std::string cppName() const
bool isTypePVector(const edm::TypeWithDict &typ)
edm::TypeWithDict containerSubType(const edm::TypeWithDict &typ, const std::string &subTypeName)
bool isTypeUniqueReference(const edm::TypeWithDict &typ)
bool isTypeOraVector(const edm::TypeWithDict &typ)
bool checkMappedType(const edm::TypeWithDict &type, const std::string &mappedTypeName)
bool isFundamental() const
bool isTypeOraReference(const edm::TypeWithDict &typ)
static void replaceString(std::string &name, std::string const &from, std::string const &to)
edm::TypeWithDict lookupDictionary(const std::type_info &typeInfo, bool throwFlag=true)
bool findBaseType(edm::TypeWithDict &type, edm::TypeWithDict &baseType, size_t &func)
bool isTypeAssociativeContainer(const edm::TypeWithDict &typ)
tuple idx
DEBUGGING if hasattr(process,"trackMonIterativeTracking2012"): print "trackMonIterativeTracking2012 D...
bool isTypeNonKeyedContainer(const edm::TypeWithDict &typ)
size_t arrayLength(const edm::TypeWithDict &typ)
bool isTypeQueryableVector(const edm::TypeWithDict &typ)
edm::TypeWithDict containerKeyType(const edm::TypeWithDict &typ)
edm::TypeWithDict containerDataType(const edm::TypeWithDict &typ)
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
int getBaseClassOffset(TypeWithDict const &baseClass) const
void * constructObject(const edm::TypeWithDict &typ)
std::string getClassProperty(const std::string &propertyName, const edm::TypeWithDict &type)
edm::TypeWithDict containerValueType(const edm::TypeWithDict &typ)
ObjectWithDict construct() const
std::string getDataMemberProperty(const std::string &propertyName, const edm::MemberWithDict &dataMember)
bool isTypeContainer(const edm::TypeWithDict &typ)
size_t arrayLength() const
std::string className(const T &t)