CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Static Public Member Functions
ora::ArrayHandlerFactory Class Reference

#include <ArrayHandlerFactory.h>

Static Public Member Functions

static IArrayHandlernewArrayHandler (const Reflex::Type &arrayType)
 

Detailed Description

Factory class for IArrayHandler objects.

Definition at line 17 of file ArrayHandlerFactory.h.

Member Function Documentation

ora::IArrayHandler * ora::ArrayHandlerFactory::newArrayHandler ( const Reflex::Type &  arrayType)
static

Definition at line 10 of file ArrayHandlerFactory.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and ora::throwException().

Referenced by ora::CArrayWriter::build(), ora::STLContainerWriter::build(), ora::QVQueryMaker::build(), ora::CArrayReader::build(), and ora::STLContainerReader::build().

11 {
12  if(arrayType.IsArray()){
13  return new CArrayHandler( arrayType );
14  } else {
15  Reflex::TypeTemplate templ = arrayType.TemplateFamily();
16  if ( templ ) {
17  std::string contName = templ.Name(Reflex::SCOPED|Reflex::FINAL);
18  if( contName == "std::vector" ||
19  contName == "std::list" ||
20  contName == "std::set" ||
21  contName == "std::multiset" ||
22  contName == "std::deque" ||
23  contName == "__gnu_cxx::hash_set" ||
24  contName == "__gnu_cxx::hash_multiset" ||
25  contName == "std::map" ||
26  contName == "std::multimap" ||
27  contName == "__gnu_cxx::hash_map" ||
28  contName == "__gnu_cxx::hash_multimap" ){
29  return new STLContainerHandler( arrayType );
30  } else if ( contName == "std::stack" ||
31  contName == "std::queue" ){
32  return new SpecialSTLContainerHandler( arrayType );
33  } else if ( contName == "ora::PVector" ) {
34  return new PVectorHandler( arrayType );
35  }
36 
37  }
38  }
39  throwException( "No Array Handler available for class \""+arrayType.Name(Reflex::SCOPED)+"\"",
40  "ArrayHandlerFactory::newArrayHandler");
41  return 0;
42 }
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10