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 490 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().

490  {
491  size_t arraySize = typ.arrayLength();
492  edm::TypeWithDict arrayType = typ.toType();
493  if( arrayType.isArray() ) arraySize /= arrayType.arrayLength();
494  return arraySize;
495 }
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 111 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().

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

Definition at line 202 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().

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

Definition at line 446 of file ClassUtils.cc.

References edm::TypeWithDict::nestedType().

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

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

Definition at line 426 of file ClassUtils.cc.

References edm::TypeWithDict::nestedType().

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

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

Definition at line 465 of file ClassUtils.cc.

References edm::TypeWithDict::nestedType().

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

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

Definition at line 407 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().

407  {
408  /*-ap old code
409  edm::TypeWithDict valueType;
410  // find the iterator return type as the member value_type of the containers
411  size_t subTypeSize = typ.SubTypeSize();
412  size_t i=0;
413  while(i<subTypeSize){
414  edm::TypeWithDict sti = typ.SubTypeAt(i);
415  if(sti.Name()=="value_type") {
416  valueType = sti;
417  break;
418  }
419  i++;
420  }
421  return valueType;
422  */
423  return typ.nestedType("value_type");
424 }
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 133 of file ClassUtils.cc.

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

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

133  {
134  bool found = false;
135  if ( ! type.hasBase(baseType) ) {
136  return found; // no inheritance, nothing to do
137  } else {
138  func = type.getBaseClassOffset(baseType);
139  found = true;
140  }
141 /*-ap old code
142  for ( unsigned int i=0;i<type.BaseSize() && !found; i++){
143  edm::BaseWithDict base = type.BaseAt(i);
144  edm::TypeWithDict bt = resolvedType( base.ToType() );
145  if( bt == baseType ){
146  func = base.OffsetFP();
147  found = true;
148  } else {
149  found = findBaseType( bt, baseType, func );
150  }
151  }
152 */
153  return found;
154 }
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 497 of file ClassUtils.cc.

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

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

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

Definition at line 510 of file ClassUtils.cc.

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

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

511  {
512  std::string ret("");
513  TClass* declaringClass = dataMember.declaringType().getClass();
514  if( declaringClass ){
515  auto dm = declaringClass->GetDataMember( dataMember.name().c_str() );
516  if( dm ) {
517  TDictAttributeMap* memberProps = dm->GetAttributeMap();
518  if( memberProps && memberProps->HasKey( propertyName.c_str() ) ){
519  ret = memberProps->GetPropertyAsString( propertyName.c_str() );
520  }
521  }
522  }
523  return ret;
524 }
TypeWithDict declaringType() const
TClass * getClass() const
std::string name() const
bool ora::ClassUtils::isType ( const edm::TypeWithDict type,
const edm::TypeWithDict baseType 
)

Definition at line 47 of file ClassUtils.cc.

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

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

48  {
49  bool ret = false;
50  if( type == baseType || type.hasBase( baseType )){
51  ret = true;
52  }
53  return ret;
54 }
bool hasBase(std::string const &) const
bool ora::ClassUtils::isTypeAssociativeContainer ( const edm::TypeWithDict typ)

Definition at line 283 of file ClassUtils.cc.

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

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

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

Definition at line 222 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().

222  {
223  if ( ! typ.isTemplateInstance() ) {
224  return false;
225  } else {
226  std::string contName = typ.templateName();
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" ){
241  return true;
242  }
243  }
244  return false;
245 }
std::string templateName() const
bool isTemplateInstance() const
bool ora::ClassUtils::isTypeKeyedContainer ( const edm::TypeWithDict typ)

Definition at line 247 of file ClassUtils.cc.

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

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

247  {
248  if ( ! typ.isTemplateInstance() ) {
249  return false;
250  } else {
251  std::string contName = typ.templateName();
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" ){
260  return true;
261  }
262  }
263  return false;
264 }
std::string templateName() const
bool isTemplateInstance() const
bool ora::ClassUtils::isTypeNamedReference ( const edm::TypeWithDict typ)

Definition at line 336 of file ClassUtils.cc.

References edm::TypeWithDict::hasBase().

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

336  {
337  return typ.hasBase( edm::TypeWithDict(typeid(ora::NamedReference)) );
338 }
bool hasBase(std::string const &) const
bool ora::ClassUtils::isTypeNameOraVector ( const std::string &  typeName)

Definition at line 383 of file ClassUtils.cc.

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

Referenced by checkMappedType().

383  {
384  size_t idx = typeName.find('<');
385  if( idx != std::string::npos ){
386  std::string tname = typeName.substr( 0, idx );
387  return (tname == "ora::PVector" || tname == "ora::QueryableVector" || tname == "pool::PVector" );
388  }
389  return false;
390 }
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 298 of file ClassUtils.cc.

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

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

298  {
299  if ( ! typ.isTemplateInstance() ) {
300  return false;
301  } else {
302  std::string contName = typ.templateName();
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"){
313  return true;
314  }
315  }
316  return false;
317 }
std::string templateName() const
bool isTemplateInstance() const
bool ora::ClassUtils::isTypeNonKeyedContainer ( const edm::TypeWithDict typ)

Definition at line 266 of file ClassUtils.cc.

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

266  {
267  if ( ! typ.isTemplateInstance() ) {
268  return false;
269  } else {
270  std::string contName = typ.templateName();
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" ){
277  return true;
278  }
279  }
280  return false;
281 }
std::string templateName() const
bool isTemplateInstance() const
bool ora::ClassUtils::isTypeObject ( const edm::TypeWithDict typ)

Definition at line 392 of file ClassUtils.cc.

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

392  {
394  if( isTypePrimitive( resType ) ) {
395  //if ( resType.IsFundamental() || resType.IsEnum() || isTypeString(resType) ) {
396  return false;
397  } else {
398  if( resType.isArray( ) ) return false;
399  if( isTypeContainer( resType ) ) return false;
400  if( isTypeOraPointer( resType ) ) return false;
401  if( isTypeUniqueReference( resType ) ) return false;
402  if( isTypeOraVector( resType ) ) return false;
403  }
404  return true;
405 }
edm::TypeWithDict resolvedType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:483
bool isTypePrimitive(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:218
bool isTypeOraPointer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:320
bool isArray() const
bool isTypeUniqueReference(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:340
bool isTypeOraVector(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:376
bool isTypeContainer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:222
bool ora::ClassUtils::isTypeOraPointer ( const edm::TypeWithDict typ)

Definition at line 320 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().

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

Definition at line 332 of file ClassUtils.cc.

References edm::TypeWithDict::hasBase().

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

332  {
333  return typ.hasBase( edm::TypeWithDict(typeid(ora::Reference)) );
334 }
bool hasBase(std::string const &) const
bool ora::ClassUtils::isTypeOraVector ( const edm::TypeWithDict typ)

Definition at line 376 of file ClassUtils.cc.

References isTypePVector(), and isTypeQueryableVector().

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

376  {
377  if( isTypePVector( typ ) || isTypeQueryableVector( typ ) ){
378  return true;
379  }
380  return false;
381 }
bool isTypePVector(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:352
bool isTypeQueryableVector(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:364
bool ora::ClassUtils::isTypePrimitive ( const edm::TypeWithDict typ)

Definition at line 218 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().

218  {
219  return ( typ.isFundamental() || typ.isEnum() || isTypeString( typ ) );
220 }
bool isEnum() const
bool isTypeString(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:212
bool isFundamental() const
bool ora::ClassUtils::isTypePVector ( const edm::TypeWithDict typ)

Definition at line 352 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().

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

Definition at line 364 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().

364  {
365  if ( ! typ.isTemplateInstance() ) {
366  return false;
367  } else {
368  std::string contName = typ.templateName();
369  if( contName == "ora::QueryableVector" ){
370  return true;
371  }
372  }
373  return false;
374 }
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 340 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().

340  {
341  if ( ! typ.isTemplateInstance() ) {
342  return false;
343  } else {
344  std::string contName = typ.templateName();
345  if( contName == "ora::UniqueRef" ){
346  return true;
347  }
348  }
349  return false;
350 }
std::string templateName() const
bool isTemplateInstance() const
void ora::ClassUtils::loadDictionary ( const std::string &  className)
edm::TypeWithDict ora::ClassUtils::lookupDictionary ( const std::type_info &  typeInfo,
bool  throwFlag = true 
)

Definition at line 167 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().

167  {
168  edm::TypeWithDict type ( typeInfo );
169  if( typeInfo == typeid(std::string) ){
170  // ugly, but no other way with Reflex...
171  type = edm::TypeWithDict::byName("std::string");
172  }
173  if( !type ){
174  loadDictionary( demangledName(typeInfo) );
175  edm::TypeWithDict type1 ( typeInfo );
176  type = type1;
177  }
178  if( !type && throwFlag ){
179  throwException( "Class \""+demangledName(typeInfo)+"\" has not been found in the dictionary.",
180  "ClassUtils::lookupDictionary" );
181  }
182  return type;
183 }
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:156
void loadDictionary(const std::string &className)
Definition: ClassUtils.cc:30
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
edm::TypeWithDict ora::ClassUtils::lookupDictionary ( const std::string &  className,
bool  throwFlag = true 
)

Definition at line 185 of file ClassUtils.cc.

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

185  {
187  if( className == "std::basic_string<char>" ){
188  // ugly, but no other way with Reflex...
189  type = edm::TypeWithDict::byName("std::string");
190  }
191  if( !type ){
194  }
195  if( !type && throwFlag ){
196  throwException( "Class \""+className+"\" has not been found in the dictionary.",
197  "ClassUtils::lookupDictionary" );
198  }
199  return type;
200 }
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:30
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:11
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 35 of file ClassUtils.cc.

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

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

37  {
38  void* ret = 0;
39  if( type == castType ){
40  ret = ptr;
41  } else if( type.hasBase( castType )){
42  ret = reinterpret_cast<void*>(reinterpret_cast<size_t>(ptr) + type.getBaseClassOffset(castType));
43  }
44  return ret;
45 }
bool hasBase(std::string const &) const
int getBaseClassOffset(TypeWithDict const &baseClass) const