Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

jobc::ModuleFactory Class Reference

Create job modules by name. More...

#include <ModuleFactory.h>

List of all members.

Public Member Functions

void Insert (const char *name, ModuleMaker_t mm)
ModuleMaker_t LookUp (const char *name)

Static Public Member Functions

ModuleFactoryInstance ()

Private Types

typedef std::map< std::string,
ModuleMaker_t
ModMakerMap_t

Private Member Functions

 ModuleFactory ()

Private Attributes

ModMakerMap_t fMakerMap
 Map module makers my name.


Static Private Attributes

ModuleFactoryfInstance = 0
 The sole instance of this class.


Detailed Description

Create job modules by name.

Definition at line 18 of file ModuleFactory.h.


Member Typedef Documentation

typedef std::map<std::string,ModuleMaker_t> jobc::ModuleFactory::ModMakerMap_t [private]
 

Definition at line 25 of file ModuleFactory.h.


Constructor & Destructor Documentation

jobc::ModuleFactory::ModuleFactory  )  [inline, private]
 

Definition at line 27 of file ModuleFactory.h.

Referenced by Instance().

00027 { }


Member Function Documentation

void ModuleFactory::Insert const char *  name,
ModuleMaker_t  mm
 

Definition at line 24 of file ModuleFactory.cxx.

References fMakerMap, and jobc::ModuleMaker_t.

00025 {
00026 //======================================================================
00027 // Insert a module maker into the table
00028 //======================================================================
00029   std::string n(name);
00030   ModMakerMap_t::iterator itr = fMakerMap.find(n);
00031   if (itr == fMakerMap.end()) {
00032     fMakerMap[n] = p;
00033     return;
00034   }
00035   std::cerr << "JobCModuleFactory" << __LINE__ 
00036             << " Proxy '" << name <<"' already in table." 
00037             << std::endl;
00038 }

ModuleFactory & ModuleFactory::Instance  )  [static]
 

Definition at line 16 of file ModuleFactory.cxx.

References fInstance, and ModuleFactory().

00017 {
00018   if (fInstance == 0) fInstance = new ModuleFactory();
00019   return *fInstance;
00020 }

ModuleMaker_t ModuleFactory::LookUp const char *  name  ) 
 

Definition at line 42 of file ModuleFactory.cxx.

References fMakerMap, and jobc::ModuleMaker_t.

00043 {
00044 //======================================================================
00045 // Find a module maker in the table
00046 //======================================================================
00047   std::string n(name);
00048 
00049   ModMakerMap_t::iterator itr = fMakerMap.find(n);
00050   if (itr != fMakerMap.end()) return *(itr->second);
00051   
00052   std::cerr << "JobCModuleFactory:" << __LINE__ 
00053             << " Proxy '" << name <<"' is not in table." 
00054             << std::endl;
00055   std::cerr << "*== Proxies in list are:" << std::endl;
00056   itr = fMakerMap.begin();
00057   ModMakerMap_t::iterator itrEnd(fMakerMap.end());
00058   for (; itr!=itrEnd; ++itr) {
00059     std::cerr <<" "<< itr->first << std::endl;
00060   }
00061   std::cerr << "*==" << std::endl;
00062   abort();
00063 }


Member Data Documentation

ModuleFactory * ModuleFactory::fInstance = 0 [static, private]
 

The sole instance of this class.

Definition at line 12 of file ModuleFactory.cxx.

Referenced by Instance().

ModMakerMap_t jobc::ModuleFactory::fMakerMap [private]
 

Map module makers my name.

Definition at line 28 of file ModuleFactory.h.

Referenced by Insert(), and LookUp().


The documentation for this class was generated from the following files:
Generated on Fri Jul 25 02:05:54 2008 for NOvA Offline by doxygen 1.3.5