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 edm::TypeWithDict &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 edm::TypeWithDict arrayType)
static

Definition at line 10 of file ArrayHandlerFactory.cc.

References edm::TypeWithDict::isArray(), edm::TypeWithDict::isTemplateInstance(), AlCaHLTBitMon_QueryRunRegistry::string, edm::TypeWithDict::templateName(), 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  if ( arrayType.isTemplateInstance() ) {
16  std::string contName = arrayType.templateName();
17  if( contName == "std::vector" ||
18  contName == "std::list" ||
19  contName == "std::set" ||
20  contName == "std::multiset" ||
21  contName == "std::deque" ||
22  contName == "__gnu_cxx::hash_set" ||
23  contName == "__gnu_cxx::hash_multiset" ||
24  contName == "std::map" ||
25  contName == "std::multimap" ||
26  contName == "__gnu_cxx::hash_map" ||
27  contName == "__gnu_cxx::hash_multimap" ){
28  return new STLContainerHandler( arrayType );
29  } else if ( contName == "std::stack" ||
30  contName == "std::queue" ){
31  return new SpecialSTLContainerHandler( arrayType );
32  } else if ( contName == "ora::PVector" ) {
33  return new PVectorHandler( arrayType );
34  }
35 
36  }
37  }
38  throwException( "No Array Handler available for class \""+arrayType.templateName()+"\"",
39  "ArrayHandlerFactory::newArrayHandler");
40  return 0;
41 }
bool isArray() const
std::string templateName() const
bool isTemplateInstance() const
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10