CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ArrayHandlerFactory.cc
Go to the documentation of this file.
2 #include "ArrayHandlerFactory.h"
3 #include "STLContainerHandler.h"
4 #include "CArrayHandler.h"
5 #include "PVectorHandler.h"
6 // externals
8 
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
static IArrayHandler * newArrayHandler(const edm::TypeWithDict &arrayType)
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10