#include <SimElecMaker.h>
Inheritance diagram for SimElecMaker:

Static Public Member Functions | |
| SimElectronics * | Create (std::string className, VldContext context, TRandom *random) |
| Bool_t | HasRegisteredClass (std::string className) |
Protected Types | |
| typedef std::map< std::string, SimElecMaker * > | MakerMap_t |
Protected Member Functions | |
| SimElecMaker (const char *className) | |
| virtual SimElectronics * | Create (VldContext context, TRandom *random) const =0 |
| SimElecMaker () | |
| virtual | ~SimElecMaker () |
| ClassDef (SimElecMaker, 0) | |
Static Protected Member Functions | |
| MakerMap_t & | GetMakerMap () |
|
|
Definition at line 31 of file SimElecMaker.h. Referenced by GetMakerMap(). |
|
|
Definition at line 41 of file SimElecMaker.cxx. References GetMakerMap(). 00042 {
00043 std::string tmp(className);
00044 //std::cout << "Adding Maker: " << tmp << std::endl;
00045 GetMakerMap().insert(std::pair<std::string,SimElecMaker*>(tmp,this));
00046 }
|
|
|
Definition at line 34 of file SimElecMaker.h. 00034 { }
|
|
|
Definition at line 35 of file SimElecMaker.h. 00035 { }
|
|
||||||||||||
|
|
|
||||||||||||
|
Implemented in SimElecMakerProxy< T >. |
|
||||||||||||||||
|
Definition at line 6 of file SimElecMaker.cxx. Referenced by SimDetector::Config(), and SimDetector::SimDetector(). 00009 {
00010 // Find the concrete factory:
00011 MakerMap_t::iterator it = GetMakerMap().find(className);
00012
00013
00014 if(it == GetMakerMap().end()) {
00015 // If it doesn't exist, return null.
00016 return 0;
00017 } else {
00018 // Otherwise, get the concrete factory to make one.
00019 SimElectronics* elec = it->second->Create(context,random);
00020 return elec;
00021 }
00022
00023 // Make compiler happy:
00024 return 0;
00025 }
|
|
|
Definition at line 49 of file SimElecMaker.cxx. References MakerMap_t. Referenced by HasRegisteredClass(), and SimElecMaker(). 00050 {
00051 // The whole point to this little function is to hide the
00052 // static map from the compiler, to avoid
00053 // the "static initialization order fiasco"
00054 // ref: http://www.parashift.com/c++-faq-lite/ctors.html section 10.12
00055
00056 // This object gets created on the first call,
00057 // thus ensuring it exists whenever it's needed. (i.e. before main())
00058 static MakerMap_t theMap;
00059 return theMap;
00060 }
|
|
|
Definition at line 27 of file SimElecMaker.cxx. References GetMakerMap(). Referenced by SimDetector::Config(). 00028 {
00029 // Find the concrete factory:
00030 MakerMap_t::iterator it = GetMakerMap().find(className);
00031
00032 if(it == GetMakerMap().end()) {
00033 // If it doesn't exist, return null.
00034 return false;
00035 };
00036 return true;
00037 }
|
1.3.9.1