![]() |
![]() |
#include <SimG4Core/Notification/interface/ComponentFactoryByName.h>
Public Types | |
typedef std::map< std::string, B * > | BuilderMapType |
Static Public Member Functions | |
static B * | getBuilder (const std::string &name) |
static void | setBuilder (B *in, const std::string &name) |
Static Protected Member Functions | |
static BuilderMapType & | myMap () |
Definition at line 10 of file ComponentFactoryByName.h.
typedef std::map<std::string,B *> ComponentFactoryByName< B >::BuilderMapType |
Definition at line 27 of file ComponentFactoryByName.h.
static B* ComponentFactoryByName< B >::getBuilder | ( | const std::string & | name | ) | [inline, static] |
Definition at line 13 of file ComponentFactoryByName.h.
References end, find(), ComponentFactoryByName< B >::myMap(), and size.
00014 { 00015 if (myMap().size() == 0) 00016 throw SimG4Exception("No Builder registered to the Factory."); 00017 if (myMap().find(name) == myMap().end()) 00018 throw SimG4Exception("The Component "+name+" is not registered to the Factory."); 00019 return (myMap()[name]); 00020 }
static BuilderMapType& ComponentFactoryByName< B >::myMap | ( | ) | [inline, static, protected] |
Definition at line 29 of file ComponentFactoryByName.h.
Referenced by ComponentFactoryByName< B >::getBuilder(), and ComponentFactoryByName< B >::setBuilder().
00030 { 00031 static BuilderMapType me_; 00032 return me_; 00033 }
static void ComponentFactoryByName< B >::setBuilder | ( | B * | in, | |
const std::string & | name | |||
) | [inline, static] |
Definition at line 21 of file ComponentFactoryByName.h.
References ComponentFactoryByName< B >::myMap().
00022 { 00023 if (name.empty()) 00024 throw SimG4Exception("The registration of Components without name is not allowed."); 00025 myMap()[name] = in; 00026 }