13 #include "TDictAttributeMap.h"
27 m_type.destruct( ptr );
39 if( type == castType ){
41 }
else if( type.
hasBase( castType )){
42 ret =
reinterpret_cast<void*
>(
reinterpret_cast<size_t>(ptr) + type.
getBaseClassOffset(castType));
50 if( type == baseType || type.
hasBase( baseType )){
62 while((pos = name.find(from, pos)) != std::string::npos) {
63 name.replace(pos, length, to);
70 size_t pos = name.find(
'<');
71 if(pos == std::string::npos) {
75 size_t nameSize = name.size();
76 if(other.size() >= nameSize) {
80 if(name.substr(0, pos) != other.substr(0, pos)) {
85 for(
size_t i = pos;
i < nameSize; ++
i) {
87 if (c ==
'<') ++nesting;
89 if(c !=
'u' && c !=
'l')
return false;
90 if(nesting == 0)
return false;
91 if(!isdigit(name[
i-1]))
return false;
92 for(
size_t n =
i-2;
n >= pos; --
n) {
94 if(q ==
'<' || q ==
',')
break;
95 if(!isdigit(q))
return false;
97 for(
size_t n =
i+1;
n < nameSize; ++
n) {
99 if(q ==
'>' || q ==
',')
break;
100 if(q !=
'l')
return false;
105 if (c ==
'>') --nesting;
114 return (mappedTypeName==
"std::basic_string<char>" || mappedTypeName==
"basic_string<char>" || mappedTypeName==
"std::string" || mappedTypeName==
"string");
115 }
else if ( type.
isEnum() ){
116 return mappedTypeName==
"int";
119 }
else if ( type.
cppName() == mappedTypeName ) {
124 replaceString(typeName,
"std::basic_string<char> ",
"std::string");
125 replaceString(typeName,
"std::basic_string<char>",
"std::string");
126 if ( type.
cppName() == typeName ) {
135 if ( ! type.
hasBase(baseType) ) {
159 char* realname = abi::__cxa_demangle( typeInfo.name(), 0, 0, &
status);
160 if( status == 0 && realname ){
178 if( !type && throwFlag ){
180 "ClassUtils::lookupDictionary" );
187 if( className ==
"std::basic_string<char>" ){
195 if( !type && throwFlag ){
196 throwException(
"Class \""+className+
"\" has not been found in the dictionary.",
197 "ClassUtils::lookupDictionary" );
204 if( typ.
cppName()==
"std::string"){
214 return ( name ==
"std::string" ||
215 name ==
"std::basic_string<char>" );
227 if( contName ==
"std::vector" ||
228 contName ==
"std::list" ||
229 contName ==
"std::deque" ||
230 contName ==
"std::stack" ||
231 contName ==
"std::set" ||
232 contName ==
"std::multiset" ||
233 contName ==
"__gnu_cxx::hash_set" ||
234 contName ==
"__gnu_cxx::hash_multiset" ||
235 contName ==
"std::map" ||
236 contName ==
"std::multimap" ||
237 contName ==
"__gnu_cxx::hash_map" ||
238 contName ==
"__gnu_cxx::hash_multimap" ||
239 contName ==
"ora::PVector" ||
240 contName ==
"ora::QueryableVector" ){
252 if( contName ==
"std::map" ||
253 contName ==
"std::multimap" ||
254 contName ==
"std::set" ||
255 contName ==
"std::multiset" ||
256 contName ==
"__gnu_cxx::hash_set" ||
257 contName ==
"__gnu_cxx::hash_multiset" ||
258 contName ==
"__gnu_cxx::hash_map" ||
259 contName ==
"__gnu_cxx::hash_multimap" ){
271 if( contName ==
"std::vector" ||
272 contName ==
"std::list" ||
273 contName ==
"std::deque" ||
274 contName ==
"std::stack" ||
275 contName ==
"ora::PVector" ||
276 contName ==
"ora::QueryableVector" ){
288 if( contName ==
"std::map" ||
289 contName ==
"std::multimap" ||
290 contName ==
"__gnu_cxx::hash_map" ||
291 contName ==
"__gnu_cxx::hash_multimap" ){
303 if( contName ==
"std::vector" ||
304 contName ==
"std::list" ||
305 contName ==
"std::deque" ||
306 contName ==
"std::stack" ||
307 contName ==
"std::set" ||
308 contName ==
"std::multiset" ||
309 contName ==
"__gnu_cxx::hash_set" ||
310 contName ==
"__gnu_cxx::hash_multiset" ||
311 contName ==
"ora::PVector" ||
312 contName ==
"ora::QueryableVector"){
325 if( contName ==
"ora::Ptr" ){
345 if( contName ==
"ora::UniqueRef" ){
357 if( contName ==
"ora::PVector" ){
369 if( contName ==
"ora::QueryableVector" ){
384 size_t idx = typeName.find(
'<');
385 if( idx != std::string::npos ){
387 return (tname ==
"ora::PVector" || tname ==
"ora::QueryableVector" || tname ==
"pool::PVector" );
398 if( resType.
isArray( ) )
return false;
502 TDictAttributeMap* classProps = rclass->GetAttributeMap();
503 if( classProps && classProps->HasKey( propertyName.c_str() ) ){
504 ret = classProps->GetPropertyAsString( propertyName.c_str() );
514 if( declaringClass ){
515 auto dm = declaringClass->GetDataMember( dataMember.
name().c_str() );
517 TDictAttributeMap* memberProps = dm->GetAttributeMap();
518 if( memberProps && memberProps->HasKey( propertyName.c_str() ) ){
519 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)
static PluginCapabilities * get()
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
void load(const std::string &iName)
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)