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

Static Public Member Functions | |
| PhotonTransportModule * | Create (std::string className) |
| Bool_t | HasRegisteredClass (std::string className) |
Protected Types | |
| typedef std::map< std::string, PhotonTransportMaker * > | MakerMap_t |
Protected Member Functions | |
| PhotonTransportMaker (const char *className) | |
| virtual | ~PhotonTransportMaker () |
| virtual PhotonTransportModule * | Create () const =0 |
| ClassDef (PhotonTransportMaker, 0) | |
Static Protected Member Functions | |
| MakerMap_t & | GetMakerMap () |
|
|
Definition at line 24 of file PhotonTransportMaker.h. Referenced by GetMakerMap(). |
|
|
Definition at line 41 of file PhotonTransportMaker.cxx. References GetMakerMap(). 00042 {
00043 std::string tmp(className);
00044 //std::cout << "Adding Maker: " << tmp << std::endl;
00045 GetMakerMap().insert(std::pair<std::string,PhotonTransportMaker*>(tmp,this));
00046 }
|
|
|
Definition at line 20 of file PhotonTransportMaker.h. 00020 { }
|
|
||||||||||||
|
|
|
|
Implemented in PhotonTransportMakerProxy< T >. Referenced by PhotonTransport::CreateModelObjects(). |
|
|
Definition at line 8 of file PhotonTransportMaker.cxx. 00009 {
00010 // Find the concrete factory:
00011 MakerMap_t::iterator it = GetMakerMap().find(className);
00012
00013 if(it == GetMakerMap().end()) {
00014 // If it doesn't exist, return null.
00015 return 0;
00016 } else {
00017 // Otherwise, get the concrete factory to make one.
00018 PhotonTransportModule* obj = it->second->Create();
00019 return obj;
00020 }
00021
00022 // Make compiler happy:
00023 return 0;
00024 }
|
|
|
Definition at line 49 of file PhotonTransportMaker.cxx. References MakerMap_t. Referenced by HasRegisteredClass(), and PhotonTransportMaker(). 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 PhotonTransportMaker.cxx. References GetMakerMap(). 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