CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
ora::ClassUtils Namespace Reference

Functions

size_t arrayLength (const edm::TypeWithDict &typ)
 
bool checkMappedType (const edm::TypeWithDict &type, const std::string &mappedTypeName)
 
void * constructObject (const edm::TypeWithDict &typ)
 
edm::TypeWithDict containerDataType (const edm::TypeWithDict &typ)
 
edm::TypeWithDict containerKeyType (const edm::TypeWithDict &typ)
 
edm::TypeWithDict containerSubType (const edm::TypeWithDict &typ, const std::string &subTypeName)
 
edm::TypeWithDict containerValueType (const edm::TypeWithDict &typ)
 
std::string demangledName (const std::type_info &typeInfo)
 
bool findBaseType (edm::TypeWithDict &type, edm::TypeWithDict &baseType, size_t &func)
 
std::string getClassProperty (const std::string &propertyName, const edm::TypeWithDict &type)
 
std::string getDataMemberProperty (const std::string &propertyName, const edm::MemberWithDict &dataMember)
 
bool isType (const edm::TypeWithDict &type, const edm::TypeWithDict &baseType)
 
bool isTypeAssociativeContainer (const edm::TypeWithDict &typ)
 
bool isTypeContainer (const edm::TypeWithDict &typ)
 
bool isTypeKeyedContainer (const edm::TypeWithDict &typ)
 
bool isTypeNamedReference (const edm::TypeWithDict &typ)
 
bool isTypeNameOraVector (const std::string &typeName)
 
bool isTypeNonAssociativeContainer (const edm::TypeWithDict &typ)
 
bool isTypeNonKeyedContainer (const edm::TypeWithDict &typ)
 
bool isTypeObject (const edm::TypeWithDict &typ)
 
bool isTypeOraPointer (const edm::TypeWithDict &typ)
 
bool isTypeOraReference (const edm::TypeWithDict &typ)
 
bool isTypeOraVector (const edm::TypeWithDict &typ)
 
bool isTypePrimitive (const edm::TypeWithDict &typ)
 
bool isTypePVector (const edm::TypeWithDict &typ)
 
bool isTypeQueryableVector (const edm::TypeWithDict &typ)
 
bool isTypeString (const edm::TypeWithDict &typ)
 
bool isTypeUniqueReference (const edm::TypeWithDict &typ)
 
void loadDictionary (const std::string &className)
 
edm::TypeWithDict lookupDictionary (const std::type_info &typeInfo, bool throwFlag=true)
 
edm::TypeWithDict lookupDictionary (const std::string &className, bool throwFlag=true)
 
edm::TypeWithDict resolvedType (const edm::TypeWithDict &typ)
 
void * upCast (const edm::TypeWithDict &type, void *ptr, const edm::TypeWithDict &asType)
 

Function Documentation

size_t ora::ClassUtils::arrayLength ( const edm::TypeWithDict typ)

Definition at line 493 of file ClassUtils.cc.

References edm::TypeWithDict::arrayLength(), edm::TypeWithDict::isArray(), and edm::TypeWithDict::toType().

Referenced by ora::RelationalMapping::_sizeInColumnsForCArray(), ora::CArrayMapping::process(), ora::CArrayReader::read(), ora::CArrayHandler::size(), and ora::MappingRules::variableNameForArrayColumn().

493  {
494  size_t arraySize = typ.arrayLength();
495  edm::TypeWithDict arrayType = typ.toType();
496  if( arrayType.isArray() ) arraySize /= arrayType.arrayLength();
497  return arraySize;
498 }
TypeWithDict toType() const
bool isArray() const
size_t arrayLength() const
bool ora::ClassUtils::checkMappedType ( const edm::TypeWithDict type,
const std::string &  mappedTypeName 
)

Definition at line 114 of file ClassUtils.cc.

References compareWithSuffixes(), edm::TypeWithDict::cppName(), edm::TypeWithDict::isEnum(), isTypeNameOraVector(), isTypeOraVector(), isTypeString(), replaceString(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ora::ObjectStreamerBase::buildBaseDataMembers(), and ora::ObjectStreamerBase::buildDataMembers().

115  {
116  if( isTypeString( type ) ){
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";
120  } else if ( isTypeOraVector( type ) ){
121  return isTypeNameOraVector( mappedTypeName );
122  } else if ( type.cppName() == mappedTypeName ) {
123  return true;
124  }
125  // ROOT 6 uses these typedefs in names.
126  std::string typeName(mappedTypeName);
127  replaceString(typeName, "std::basic_string<char> ", "std::string");
128  replaceString(typeName, "std::basic_string<char>", "std::string");
129  if ( type.cppName() == typeName ) {
130  return true;
131  }
132  // Ignore u and l qualifiers off of integer template parameters for comparison
133  return ( compareWithSuffixes( type.cppName(), typeName ) );
134 }
bool isEnum() const
static bool compareWithSuffixes(std::string const &name, std::string const &other)
Definition: ClassUtils.cc:72
bool isTypeString(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:215
bool isTypeNameOraVector(const std::string &typeName)
Definition: ClassUtils.cc:386
std::string cppName() const
bool isTypeOraVector(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:379
static void replaceString(std::string &name, std::string const &from, std::string const &to)
Definition: ClassUtils.cc:61
void * ora::ClassUtils::constructObject ( const edm::TypeWithDict typ)

Definition at line 205 of file ClassUtils.cc.

References edm::ObjectWithDict::address(), edm::TypeWithDict::construct(), edm::TypeWithDict::cppName(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ora::OraPtrReadBuffer::read(), ora::DependentClassReader::read(), and ora::ReadBuffer::read().

205  {
206  void* ptr = 0;
207  if( typ.cppName()=="std::string"){
208  ptr = new std::string("");
209  } else {
210  ptr = typ.construct().address();
211  }
212  return ptr;
213 }
void * address() const
std::string cppName() const
ObjectWithDict construct() const
edm::TypeWithDict ora::ClassUtils::containerDataType ( const edm::TypeWithDict typ)

Definition at line 449 of file ClassUtils.cc.

References edm::TypeWithDict::nestedType().

Referenced by ora::STLContainerWriter::build(), ora::STLContainerReader::build(), and ora::ArrayMapping::process().

449  {
450  /*-ap old code
451  edm::TypeWithDict dataType;
452  // find the iterator return type as the member value_type of the containers
453  size_t subTypeSize = typ.SubTypeSize();
454  size_t i=0;
455  while(i<subTypeSize){
456  edm::TypeWithDict sti = typ.SubTypeAt(i);
457  if(sti.Name()=="mapped_type") {
458  dataType = sti;
459  break;
460  }
461  i++;
462  }
463  return dataType;
464  */
465  return typ.nestedType("mapped_type");
466 }
TypeWithDict nestedType(char const *) const
edm::TypeWithDict ora::ClassUtils::containerKeyType ( const edm::TypeWithDict typ)

Definition at line 429 of file ClassUtils.cc.

References edm::TypeWithDict::nestedType().

Referenced by ora::STLContainerWriter::build(), ora::STLContainerReader::build(), and ora::ArrayMapping::process().

429  {
430  /*-ap old code
431  edm::TypeWithDict keyType;
432  // find the iterator return type as the member value_type of the containers
433  size_t subTypeSize = typ.SubTypeSize();
434  size_t i=0;
435  while(i<subTypeSize){
436  edm::TypeWithDict sti = typ.SubTypeAt(i);
437  if(sti.Name()=="key_type") {
438  keyType = sti;
439  break;
440  }
441  i++;
442  }
443  return keyType;
444  */
445  return typ.nestedType("key_type");
446 
447 }
TypeWithDict nestedType(char const *) const
edm::TypeWithDict ora::ClassUtils::containerSubType ( const edm::TypeWithDict typ,
const std::string &  subTypeName 
)

Definition at line 468 of file ClassUtils.cc.

References edm::TypeWithDict::nestedType().

Referenced by ora::QVQueryMaker::build().

468  {
469  /*-ap old code
470  edm::TypeWithDict subType;
471  size_t subTypeSize = typ.SubTypeSize();
472  size_t i=0;
473  while(i<subTypeSize){
474  edm::TypeWithDict sti = typ.SubTypeAt(i);
475  if(sti.Name()==subTypeName) {
476  subType = sti;
477  break;
478  }
479  i++;
480  }
481  return resolvedType(subType);
482  */
483  return typ.nestedType(subTypeName);
484 }
TypeWithDict nestedType(char const *) const
edm::TypeWithDict ora::ClassUtils::containerValueType ( const edm::TypeWithDict typ)

Definition at line 410 of file ClassUtils.cc.

References edm::TypeWithDict::nestedType().

Referenced by ora::STLContainerWriter::build(), ora::QVQueryMaker::build(), ora::STLContainerReader::build(), ora::ArrayMapping::process(), ora::PVectorHandler::PVectorHandler(), and ora::STLContainerHandler::STLContainerHandler().

410  {
411  /*-ap old code
412  edm::TypeWithDict valueType;
413  // find the iterator return type as the member value_type of the containers
414  size_t subTypeSize = typ.SubTypeSize();
415  size_t i=0;
416  while(i<subTypeSize){
417  edm::TypeWithDict sti = typ.SubTypeAt(i);
418  if(sti.Name()=="value_type") {
419  valueType = sti;
420  break;
421  }
422  i++;
423  }
424  return valueType;
425  */
426  return typ.nestedType("value_type");
427 }
TypeWithDict nestedType(char const *) const
std::string ora::ClassUtils::demangledName ( const std::type_info &  typeInfo)
bool ora::ClassUtils::findBaseType ( edm::TypeWithDict type,
edm::TypeWithDict baseType,
size_t &  func 
)

Definition at line 136 of file ClassUtils.cc.

References newFWLiteAna::found, edm::TypeWithDict::getBaseClassOffset(), and edm::TypeWithDict::hasBase().

Referenced by ora::OraReferenceStreamerBase::buildDataElement().

136  {
137  bool found = false;
138  if ( ! type.hasBase(baseType) ) {
139  return found; // no inheritance, nothing to do
140  } else {
141  func = type.getBaseClassOffset(baseType);
142  found = true;
143  }
144 /*-ap old code
145  for ( unsigned int i=0;i<type.BaseSize() && !found; i++){
146  edm::BaseWithDict base = type.BaseAt(i);
147  edm::TypeWithDict bt = resolvedType( base.ToType() );
148  if( bt == baseType ){
149  func = base.OffsetFP();
150  found = true;
151  } else {
152  found = findBaseType( bt, baseType, func );
153  }
154  }
155 */
156  return found;
157 }
bool hasBase(std::string const &) const
int getBaseClassOffset(TypeWithDict const &baseClass) const
std::string ora::ClassUtils::getClassProperty ( const std::string &  propertyName,
const edm::TypeWithDict type 
)

Definition at line 500 of file ClassUtils.cc.

References edm::TypeWithDict::getClass(), runTheMatrix::ret, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ora::MappingDatabase::versionOfClass(), and cond::writeTokenContainerFragment().

501  {
502  std::string ret("");
503  TClass* rclass = type.getClass();
504  if( rclass ){
505  TDictAttributeMap* classProps = rclass->GetAttributeMap();
506  if( classProps && classProps->HasKey( propertyName.c_str() ) ){
507  ret = classProps->GetPropertyAsString( propertyName.c_str() );
508  }
509  }
510  return ret;
511 }
tuple ret
prodAgent to be discontinued
TClass * getClass() const
std::string ora::ClassUtils::getDataMemberProperty ( const std::string &  propertyName,
const edm::MemberWithDict dataMember 
)

Definition at line 513 of file ClassUtils.cc.

References edm::MemberWithDict::declaringType(), symbols::dm, edm::TypeWithDict::getClass(), edm::MemberWithDict::name(), runTheMatrix::ret, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ora::isLoosePersistencyDataMember(), ora::isLoosePersistencyOnWriting(), and ora::isMappedToBlob().

514  {
515  std::string ret("");
516  TClass* declaringClass = dataMember.declaringType().getClass();
517  if( declaringClass ){
518  auto dm = declaringClass->GetDataMember( dataMember.name().c_str() );
519  if( dm ) {
520  TDictAttributeMap* memberProps = dm->GetAttributeMap();
521  if( memberProps && memberProps->HasKey( propertyName.c_str() ) ){
522  ret = memberProps->GetPropertyAsString( propertyName.c_str() );
523  }
524  }
525  }
526  return ret;
527 }
tuple ret
prodAgent to be discontinued
TypeWithDict declaringType() const
TClass * getClass() const
tuple dm
Definition: symbols.py:65
std::string name() const
bool ora::ClassUtils::isType ( const edm::TypeWithDict type,
const edm::TypeWithDict baseType 
)

Definition at line 50 of file ClassUtils.cc.

References edm::TypeWithDict::hasBase(), and runTheMatrix::ret.

Referenced by ora::DatabaseContainer::fetchItemAsType(), and ora::IteratorBuffer::getItemAsType().

51  {
52  bool ret = false;
53  if( type == baseType || type.hasBase( baseType )){
54  ret = true;
55  }
56  return ret;
57 }
tuple ret
prodAgent to be discontinued
bool hasBase(std::string const &) const
bool ora::ClassUtils::isTypeAssociativeContainer ( const edm::TypeWithDict typ)

Definition at line 286 of file ClassUtils.cc.

References edm::TypeWithDict::isTemplateInstance(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::TypeWithDict::templateName().

Referenced by ora::RelationalMapping::_sizeInColumns(), and ora::ArrayMapping::process().

286  {
287  if ( ! typ.isTemplateInstance() ) {
288  return false;
289  } else {
290  std::string contName = typ.templateName();
291  if( contName == "std::map" ||
292  contName == "std::multimap" ||
293  contName == "__gnu_cxx::hash_map" ||
294  contName == "__gnu_cxx::hash_multimap" ){
295  return true;
296  }
297  }
298  return false;
299 }
std::string templateName() const
bool isTemplateInstance() const
bool ora::ClassUtils::isTypeContainer ( const edm::TypeWithDict typ)

Definition at line 225 of file ClassUtils.cc.

References edm::TypeWithDict::isTemplateInstance(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::TypeWithDict::templateName().

Referenced by isTypeObject(), ora::RelationalMappingFactory::newProcessor(), ora::RelationalStreamerFactory::newStreamer(), and ora::SpecialSTLContainerHandler::SpecialSTLContainerHandler().

225  {
226  if ( ! typ.isTemplateInstance() ) {
227  return false;
228  } else {
229  std::string contName = typ.templateName();
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" ){
244  return true;
245  }
246  }
247  return false;
248 }
std::string templateName() const
bool isTemplateInstance() const
bool ora::ClassUtils::isTypeKeyedContainer ( const edm::TypeWithDict typ)

Definition at line 250 of file ClassUtils.cc.

References edm::TypeWithDict::isTemplateInstance(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::TypeWithDict::templateName().

Referenced by ora::STLContainerHandler::STLContainerHandler().

250  {
251  if ( ! typ.isTemplateInstance() ) {
252  return false;
253  } else {
254  std::string contName = typ.templateName();
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" ){
263  return true;
264  }
265  }
266  return false;
267 }
std::string templateName() const
bool isTemplateInstance() const
bool ora::ClassUtils::isTypeNamedReference ( const edm::TypeWithDict typ)

Definition at line 339 of file ClassUtils.cc.

References edm::TypeWithDict::hasBase().

Referenced by ora::RelationalMapping::_sizeInColumns(), and ora::RelationalStreamerFactory::newStreamer().

339  {
340  return typ.hasBase( edm::TypeWithDict(typeid(ora::NamedReference)) );
341 }
bool hasBase(std::string const &) const
bool ora::ClassUtils::isTypeNameOraVector ( const std::string &  typeName)

Definition at line 386 of file ClassUtils.cc.

References customizeTrackingMonitorSeedNumber::idx, AlCaHLTBitMon_QueryRunRegistry::string, and cond::persistency::GLOBAL_TAG::tname.

Referenced by checkMappedType().

386  {
387  size_t idx = typeName.find('<');
388  if( idx != std::string::npos ){
389  std::string tname = typeName.substr( 0, idx );
390  return (tname == "ora::PVector" || tname == "ora::QueryableVector" || tname == "pool::PVector" );
391  }
392  return false;
393 }
static char const * tname
Definition: GTSchema.h:13
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
bool ora::ClassUtils::isTypeNonAssociativeContainer ( const edm::TypeWithDict typ)

Definition at line 301 of file ClassUtils.cc.

References edm::TypeWithDict::isTemplateInstance(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::TypeWithDict::templateName().

Referenced by ora::RelationalMapping::_sizeInColumns(), and ora::ArrayMapping::process().

301  {
302  if ( ! typ.isTemplateInstance() ) {
303  return false;
304  } else {
305  std::string contName = typ.templateName();
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"){
316  return true;
317  }
318  }
319  return false;
320 }
std::string templateName() const
bool isTemplateInstance() const
bool ora::ClassUtils::isTypeNonKeyedContainer ( const edm::TypeWithDict typ)

Definition at line 269 of file ClassUtils.cc.

References edm::TypeWithDict::isTemplateInstance(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::TypeWithDict::templateName().

269  {
270  if ( ! typ.isTemplateInstance() ) {
271  return false;
272  } else {
273  std::string contName = typ.templateName();
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" ){
280  return true;
281  }
282  }
283  return false;
284 }
std::string templateName() const
bool isTemplateInstance() const
bool ora::ClassUtils::isTypeObject ( const edm::TypeWithDict typ)

Definition at line 395 of file ClassUtils.cc.

References edm::TypeWithDict::isArray(), isTypeContainer(), isTypeOraPointer(), isTypeOraVector(), isTypePrimitive(), isTypeUniqueReference(), and resolvedType().

395  {
397  if( isTypePrimitive( resType ) ) {
398  //if ( resType.IsFundamental() || resType.IsEnum() || isTypeString(resType) ) {
399  return false;
400  } else {
401  if( resType.isArray( ) ) return false;
402  if( isTypeContainer( resType ) ) return false;
403  if( isTypeOraPointer( resType ) ) return false;
404  if( isTypeUniqueReference( resType ) ) return false;
405  if( isTypeOraVector( resType ) ) return false;
406  }
407  return true;
408 }
edm::TypeWithDict resolvedType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:486
bool isTypePrimitive(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:221
bool isTypeOraPointer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:323
bool isArray() const
bool isTypeUniqueReference(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:343
bool isTypeOraVector(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:379
bool isTypeContainer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:225
bool ora::ClassUtils::isTypeOraPointer ( const edm::TypeWithDict typ)

Definition at line 323 of file ClassUtils.cc.

References edm::TypeWithDict::isTemplateInstance(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::TypeWithDict::templateName().

Referenced by ora::RelationalMapping::_sizeInColumns(), isTypeObject(), ora::RelationalMappingFactory::newProcessor(), and ora::RelationalStreamerFactory::newStreamer().

323  {
324  if ( ! typ.isTemplateInstance() ) {
325  return false;
326  } else {
327  std::string contName = typ.templateName();
328  if( contName == "ora::Ptr" ){
329  return true;
330  }
331  }
332  return false;
333 }
std::string templateName() const
bool isTemplateInstance() const
bool ora::ClassUtils::isTypeOraReference ( const edm::TypeWithDict typ)

Definition at line 335 of file ClassUtils.cc.

References edm::TypeWithDict::hasBase().

Referenced by ora::RelationalStreamerFactory::newStreamer().

335  {
336  return typ.hasBase( edm::TypeWithDict(typeid(ora::Reference)) );
337 }
bool hasBase(std::string const &) const
bool ora::ClassUtils::isTypeOraVector ( const edm::TypeWithDict typ)

Definition at line 379 of file ClassUtils.cc.

References isTypePVector(), and isTypeQueryableVector().

Referenced by checkMappedType(), isTypeObject(), and ora::RelationalStreamerFactory::newStreamer().

379  {
380  if( isTypePVector( typ ) || isTypeQueryableVector( typ ) ){
381  return true;
382  }
383  return false;
384 }
bool isTypePVector(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:355
bool isTypeQueryableVector(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:367
bool ora::ClassUtils::isTypePrimitive ( const edm::TypeWithDict typ)

Definition at line 221 of file ClassUtils.cc.

References edm::TypeWithDict::isEnum(), edm::TypeWithDict::isFundamental(), and isTypeString().

Referenced by ora::RelationalMapping::_sizeInColumns(), isTypeObject(), ora::RelationalMappingFactory::newProcessor(), and ora::RelationalStreamerFactory::newStreamer().

221  {
222  return ( typ.isFundamental() || typ.isEnum() || isTypeString( typ ) );
223 }
bool isEnum() const
bool isTypeString(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:215
bool isFundamental() const
bool ora::ClassUtils::isTypePVector ( const edm::TypeWithDict typ)

Definition at line 355 of file ClassUtils.cc.

References edm::TypeWithDict::isTemplateInstance(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::TypeWithDict::templateName().

Referenced by isTypeOraVector(), ora::RelationalStreamerFactory::newStreamer(), and ora::ArrayMapping::process().

355  {
356  if ( ! typ.isTemplateInstance() ) {
357  return false;
358  } else {
359  std::string contName = typ.templateName();
360  if( contName == "ora::PVector" ){
361  return true;
362  }
363  }
364  return false;
365 }
std::string templateName() const
bool isTemplateInstance() const
bool ora::ClassUtils::isTypeQueryableVector ( const edm::TypeWithDict typ)

Definition at line 367 of file ClassUtils.cc.

References edm::TypeWithDict::isTemplateInstance(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::TypeWithDict::templateName().

Referenced by isTypeOraVector(), ora::RelationalStreamerFactory::newStreamer(), and ora::ArrayMapping::process().

367  {
368  if ( ! typ.isTemplateInstance() ) {
369  return false;
370  } else {
371  std::string contName = typ.templateName();
372  if( contName == "ora::QueryableVector" ){
373  return true;
374  }
375  }
376  return false;
377 }
std::string templateName() const
bool isTemplateInstance() const
bool ora::ClassUtils::isTypeString ( const edm::TypeWithDict typ)
bool ora::ClassUtils::isTypeUniqueReference ( const edm::TypeWithDict typ)

Definition at line 343 of file ClassUtils.cc.

References edm::TypeWithDict::isTemplateInstance(), AlCaHLTBitMon_QueryRunRegistry::string, and edm::TypeWithDict::templateName().

Referenced by ora::RelationalMapping::_sizeInColumns(), isTypeObject(), ora::RelationalMappingFactory::newProcessor(), and ora::RelationalStreamerFactory::newStreamer().

343  {
344  if ( ! typ.isTemplateInstance() ) {
345  return false;
346  } else {
347  std::string contName = typ.templateName();
348  if( contName == "ora::UniqueRef" ){
349  return true;
350  }
351  }
352  return false;
353 }
std::string templateName() const
bool isTemplateInstance() const
void ora::ClassUtils::loadDictionary ( const std::string &  className)

Definition at line 31 of file ClassUtils.cc.

References edm::TypeWithDict::byName(), edm::errors::DictionaryNotFound, and Exception.

Referenced by lookupDictionary().

31  {
33  if (!typedict) {
34  throw edm::Exception(edm::errors::DictionaryNotFound) << "The dictionary of class '" << className << "' is missing!" << std::endl;
35  }
36 }
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:60
std::string className(const T &t)
Definition: ClassName.h:30
edm::TypeWithDict ora::ClassUtils::lookupDictionary ( const std::type_info &  typeInfo,
bool  throwFlag = true 
)

Definition at line 170 of file ClassUtils.cc.

References edm::TypeWithDict::byName(), demangledName(), loadDictionary(), AlCaHLTBitMon_QueryRunRegistry::string, and ora::throwException().

Referenced by ora::Object::cast(), ora::Database::createContainer(), ora::Container::extendSchema(), ora::Container::fetchItemAsType(), ora::Database::getContainer(), ora::ContainerIterator::getItemAsType(), ora::Database::getTypedObjectByName(), ora::ContainerSchema::initClassDict(), ora::Container::insertItem(), ora::Database::nameForContainer(), ora::Object::Object(), ora::UniqueRefReader::read(), ora::Container::realClassName(), ora::Container::updateItem(), and ora::UniqueRefWriter::write().

170  {
171  edm::TypeWithDict type ( typeInfo );
172  if( typeInfo == typeid(std::string) ){
173  // ugly, but no other way with Reflex...
174  type = edm::TypeWithDict::byName("std::string");
175  }
176  if( !type ){
177  loadDictionary( demangledName(typeInfo) );
178  edm::TypeWithDict type1 ( typeInfo );
179  type = type1;
180  }
181  if( !type && throwFlag ){
182  throwException( "Class \""+demangledName(typeInfo)+"\" has not been found in the dictionary.",
183  "ClassUtils::lookupDictionary" );
184  }
185  return type;
186 }
type
Definition: HCALResponse.h:21
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:60
std::string demangledName(const std::type_info &typeInfo)
Definition: ClassUtils.cc:159
void loadDictionary(const std::string &className)
Definition: ClassUtils.cc:31
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
edm::TypeWithDict ora::ClassUtils::lookupDictionary ( const std::string &  className,
bool  throwFlag = true 
)

Definition at line 188 of file ClassUtils.cc.

References edm::TypeWithDict::byName(), loadDictionary(), and ora::throwException().

188  {
190  if( className == "std::basic_string<char>" ){
191  // ugly, but no other way with Reflex...
192  type = edm::TypeWithDict::byName("std::string");
193  }
194  if( !type ){
197  }
198  if( !type && throwFlag ){
199  throwException( "Class \""+className+"\" has not been found in the dictionary.",
200  "ClassUtils::lookupDictionary" );
201  }
202  return type;
203 }
type
Definition: HCALResponse.h:21
static TypeWithDict byName(std::string const &name)
Definition: TypeWithDict.cc:60
void loadDictionary(const std::string &className)
Definition: ClassUtils.cc:31
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:14
std::string className(const T &t)
Definition: ClassName.h:30
edm::TypeWithDict ora::ClassUtils::resolvedType ( const edm::TypeWithDict typ)
void * ora::ClassUtils::upCast ( const edm::TypeWithDict type,
void *  ptr,
const edm::TypeWithDict asType 
)

Definition at line 38 of file ClassUtils.cc.

References edm::TypeWithDict::getBaseClassOffset(), edm::TypeWithDict::hasBase(), and runTheMatrix::ret.

Referenced by ora::Object::cast().

40  {
41  void* ret = 0;
42  if( type == castType ){
43  ret = ptr;
44  } else if( type.hasBase( castType )){
45  ret = reinterpret_cast<void*>(reinterpret_cast<size_t>(ptr) + type.getBaseClassOffset(castType));
46  }
47  return ret;
48 }
tuple ret
prodAgent to be discontinued
bool hasBase(std::string const &) const
int getBaseClassOffset(TypeWithDict const &baseClass) const