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

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