SimDaqTrigMaker Class Reference

#include <SimDaqTrigMaker.h>

Inheritance diagram for SimDaqTrigMaker:
SimDaqTrigMakerProxy< T >

List of all members.

Static Public Member Functions

static SimDaqTriggerCreate (std::string className)
static Bool_t HasRegisteredClass (std::string className)

Protected Types

typedef std::map< std::string,
SimDaqTrigMaker * > 
MakerMap_t

Protected Member Functions

 SimDaqTrigMaker (const char *className)
virtual SimDaqTriggerCreate () const =0
 SimDaqTrigMaker ()
virtual ~SimDaqTrigMaker ()
 ClassDef (SimDaqTrigMaker, 0)

Static Protected Member Functions

static MakerMap_tGetMakerMap ()

Detailed Description

Definition at line 17 of file SimDaqTrigMaker.h.


Member Typedef Documentation

typedef std::map<std::string,SimDaqTrigMaker*> SimDaqTrigMaker::MakerMap_t [protected]

Definition at line 27 of file SimDaqTrigMaker.h.


Constructor & Destructor Documentation

SimDaqTrigMaker::SimDaqTrigMaker ( const char *  className  )  [protected]

Definition at line 39 of file SimDaqTrigMaker.cxx.

References GetMakerMap().

00040 {
00041   std::string tmp(className);
00042   //std::cout << "Adding Maker: " << tmp << std::endl;
00043   GetMakerMap().insert(std::pair<std::string,SimDaqTrigMaker*>(tmp,this));
00044 }

SimDaqTrigMaker::SimDaqTrigMaker (  )  [inline, protected]

Definition at line 29 of file SimDaqTrigMaker.h.

00029 { }

virtual SimDaqTrigMaker::~SimDaqTrigMaker (  )  [inline, protected, virtual]

Definition at line 30 of file SimDaqTrigMaker.h.

00030 { }


Member Function Documentation

SimDaqTrigMaker::ClassDef ( SimDaqTrigMaker  ,
 
) [protected]
virtual SimDaqTrigger* SimDaqTrigMaker::Create (  )  const [protected, pure virtual]

Implemented in SimDaqTrigMakerProxy< T >.

Referenced by SimDetector::Config().

SimDaqTrigger * SimDaqTrigMaker::Create ( std::string  className  )  [static]

Definition at line 6 of file SimDaqTrigMaker.cxx.

References it.

00007 {
00008   // Find the concrete factory:
00009   MakerMap_t::iterator it = GetMakerMap().find(className);
00010  
00011 
00012   if(it == GetMakerMap().end()) {
00013     // If it doesn't exist, return null.
00014     return 0;
00015   } else {
00016     // Otherwise, get the concrete factory to make one.
00017     SimDaqTrigger* elec = it->second->Create();
00018     return elec;
00019   }
00020 
00021   // Make compiler happy:
00022   return 0;
00023 }

SimDaqTrigMaker::MakerMap_t & SimDaqTrigMaker::GetMakerMap (  )  [static, protected]

Definition at line 47 of file SimDaqTrigMaker.cxx.

Referenced by HasRegisteredClass(), and SimDaqTrigMaker().

00048 {
00049   // The whole point to this little function is to hide the 
00050   // static map from the compiler, to avoid
00051   // the "static initialization order fiasco"
00052   // ref: http://www.parashift.com/c++-faq-lite/ctors.html section 10.12
00053   
00054   // This object gets created on the first call,
00055   // thus ensuring it exists whenever it's needed. (i.e. before main())
00056   static MakerMap_t theMap;
00057   return theMap;
00058 }

Bool_t SimDaqTrigMaker::HasRegisteredClass ( std::string  className  )  [static]

Definition at line 25 of file SimDaqTrigMaker.cxx.

References GetMakerMap(), and it.

00026 {
00027   // Find the concrete factory:
00028   MakerMap_t::iterator it = GetMakerMap().find(className);
00029   
00030   if(it == GetMakerMap().end()) {
00031     // If it doesn't exist, return null.
00032     return false;
00033   };
00034   return true;
00035 }


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1