Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | 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 25 of file ModuleFactory.cxx.

References fMakerMap.

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

ModuleFactory & ModuleFactory::Instance  )  [static]
 

Definition at line 17 of file ModuleFactory.cxx.

References fInstance, and ModuleFactory().

Referenced by jobc::Node::GetModule().

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

ModuleMaker_t ModuleFactory::LookUp const char *  name  ) 
 

Definition at line 43 of file ModuleFactory.cxx.

References fMakerMap, and jobc::ModuleMaker_t.

Referenced by jobc::Node::GetModule().

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


Member Data Documentation

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

The sole instance of this class.

Definition at line 13 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 Mon Nov 23 04:45:33 2009 for NOvA Offline by  doxygen 1.3.9.1