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
7 #include "Reflex/Type.h"
8 
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 }
static IArrayHandler * newArrayHandler(const Reflex::Type &arrayType)
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10