#include <StopMuFinderFactory.h>
Public Types | |
| typedef StopMuFinder *(* | SMFCreator )() |
| pointer to function creating histogram block | |
Public Member Functions | |
| bool | RegisterStopMuFinder (std::string StopMuFinderId, SMFCreator creator) |
| Returns 'true' if registration was successful. | |
| bool | UnregisterStopMuFinder (std::string StopMuFinderId) |
| Returns 'true' if the StopMuFinderId was registered before. | |
| StopMuFinder * | CreateStopMuFinder (std::string StopMuFinderId) |
| create StopMuFinder given its name | |
| StopMuFinder * | CreateStopMuFinder (const VldContext &vldc) |
| create StopMuFinder given validity context | |
Static Public Member Functions | |
| StopMuFinderFactory & | Instance () |
| get reference to the SMFFactory singleton | |
Private Types | |
| typedef std::map< std::string, SMFCreator > | CallbackMap |
| map of creator function pointers keyed by name | |
Private Member Functions | |
| StopMuFinderFactory () | |
| SMFFactory is a singleton - ctor/copy-ctor are private. | |
| StopMuFinderFactory (const StopMuFinderFactory &) | |
Private Attributes | |
| CallbackMap | fCallbacks |
Static Private Attributes | |
| StopMuFinderFactory * | fInstance = 0 |
| initialize singleton | |
Definition at line 17 of file StopMuFinderFactory.h.
|
|
map of creator function pointers keyed by name
Definition at line 25 of file StopMuFinderFactory.h. |
|
|
pointer to function creating histogram block
Definition at line 21 of file StopMuFinderFactory.h. |
|
|
SMFFactory is a singleton - ctor/copy-ctor are private.
Definition at line 114 of file StopMuFinderFactory.cxx. 00114 {}
|
|
|
Definition at line 115 of file StopMuFinderFactory.cxx. 00115 {}
|
|
|
create StopMuFinder given validity context CreateStopMuFinder - calls stop mu finder creator given validity context Definition at line 91 of file StopMuFinderFactory.cxx. References CreateStopMuFinder(), VldContext::GetDetector(), and MSG. 00092 {
00093 MSG("StopMuFilter",Msg::kDebug)
00094 << "StopMuFinderFactory::CreatStopMuFinder(VldContext)"
00095 << endl;
00096
00097 string smfname;
00098 if ( vldc.GetDetector() == Detector::kFar ) {
00099 smfname = string("StopMuFinderFar");
00100 StopMuFinder* smf = CreateStopMuFinder(smfname);
00101 return smf;
00102 } else {
00103 MSG("StopMuFilter",Msg::kError)
00104 << "Can not create StopMuFinder for "
00105 << vldc.GetDetector() << " detctor." << endl;
00106 return 0;
00107 }
00108
00109 } // StopMuFinder* StopMuFinderFactory::CreateStopMuFinder(string)
|
|
|
create StopMuFinder given its name CreateStopMuFinder - calls stop mu finder creator given its name Definition at line 68 of file StopMuFinderFactory.cxx. References fCallbacks, and MSG. Referenced by CreateStopMuFinder(). 00069 {
00070 MSG("StopMuFilter",Msg::kDebug)
00071 << "StopMuFinderFactory::CreateStopMuFinder(string)"
00072 << endl;
00073
00074 CallbackMap::const_iterator i = fCallbacks.find(smfname);
00075
00076 // handle unknown histogram block request
00077 if (i == fCallbacks.end()) {
00078 MSG("StopMuFilter",Msg::kError)
00079 << "Dont know anything about " << smfname << endl;
00080 return 0;
00081 }
00082
00083 // Invoke creator function
00084 return (i->second)();
00085 } // StopMuFinder* StopMuFinderFactory::CreateStopMuFinder(string)
|
|
|
get reference to the SMFFactory singleton Get SMFFactory reference Definition at line 26 of file StopMuFinderFactory.cxx. References fInstance, and MSG. Referenced by StopMuFilterModule::Ana(). 00027 {
00028 MSG("StopMuFilter",Msg::kDebug)
00029 << "StopMuFinderFactory::Instance()" << endl;
00030
00031 if ( !fInstance ) fInstance = new StopMuFinderFactory;
00032 return *fInstance;
00033 } // StopMuFinderFactory& StopMuFinderFactory::Instance()
|
|
||||||||||||
|
Returns 'true' if registration was successful. Register histogram block creator function Definition at line 39 of file StopMuFinderFactory.cxx. References fCallbacks, and MSG. 00042 {
00043 MSG("StopMuFilter",Msg::kDebug)
00044 << "StopMuFinderFactory::RegisterStopMuFinder(string, SMFCreator)"
00045 << endl;
00046
00047 // map<>::insert(value_type) returns pair<iterator, bool>
00048 return fCallbacks.insert(CallbackMap::value_type(smfname, creator)).second;
00049 } // bool StopMuFinderFactory::RegisterStopMuFinder(string, SMFCreator)
|
|
|
Returns 'true' if the StopMuFinderId was registered before. Unregister histogram block Definition at line 55 of file StopMuFinderFactory.cxx. References fCallbacks, and MSG. 00056 {
00057 MSG("StopMuFilter",Msg::kDebug)
00058 << "StopMuFinderFactory::UnregisterStopMuFinder(string)"
00059 << endl;
00060
00061 return fCallbacks.erase(smfname) == 1;
00062 } // bool StopMuFinderFactory::UnregisterStopMuFinder(string)
|
|
|
Definition at line 50 of file StopMuFinderFactory.h. Referenced by CreateStopMuFinder(), RegisterStopMuFinder(), and UnregisterStopMuFinder(). |
|
|
initialize singleton
Definition at line 21 of file StopMuFinderFactory.cxx. Referenced by Instance(). |
1.3.9.1