CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/CondCore/ORA/src/ArrayHandlerFactory.cc

Go to the documentation of this file.
00001 #include "CondCore/ORA/interface/Exception.h"
00002 #include "ArrayHandlerFactory.h"
00003 #include "STLContainerHandler.h"
00004 #include "CArrayHandler.h"
00005 #include "PVectorHandler.h"
00006 // externals
00007 #include "Reflex/Type.h"
00008 
00009 ora::IArrayHandler*
00010 ora::ArrayHandlerFactory::newArrayHandler( const Reflex::Type& arrayType )
00011 {
00012   if(arrayType.IsArray()){
00013     return new CArrayHandler( arrayType );
00014   } else {  
00015     Reflex::TypeTemplate templ = arrayType.TemplateFamily();
00016     if ( templ ) {
00017       std::string contName = templ.Name(Reflex::SCOPED|Reflex::FINAL); 
00018       if(  contName == "std::vector"              ||
00019            contName == "std::list"                ||
00020            contName == "std::set"                 ||
00021            contName == "std::multiset"            ||
00022            contName == "std::deque"               ||
00023            contName == "__gnu_cxx::hash_set"      ||
00024            contName == "__gnu_cxx::hash_multiset" ||
00025            contName == "std::map"                 ||
00026            contName == "std::multimap"            ||
00027            contName == "__gnu_cxx::hash_map"      ||
00028            contName == "__gnu_cxx::hash_multimap" ){
00029         return new STLContainerHandler( arrayType );
00030       } else if (  contName == "std::stack"      ||
00031                    contName == "std::queue"      ){
00032         return new SpecialSTLContainerHandler( arrayType );
00033       } else if (  contName == "ora::PVector" ) {
00034         return new PVectorHandler( arrayType );
00035       }
00036       
00037     }
00038   }
00039   throwException( "No Array Handler available for class \""+arrayType.Name(Reflex::SCOPED)+"\"",
00040                   "ArrayHandlerFactory::newArrayHandler");
00041   return 0;
00042 }