LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
WeightCalcFactory.cxx
Go to the documentation of this file.
1 #include "WeightCalcFactory.h"
2 
3 namespace evwgh {
4 
5  WeightCalc* WeightCalcFactory::Create(const std::string& wghcalcname)
6  {
8  i = GetTable().find(wghcalcname);
9 
10  if (i != GetTable().end())
11  return i->second->Create();
12  else
13  return (WeightCalc*)NULL;
14  }
15 
16  void WeightCalcFactory::Register(const std::string& wghcalcname, WeightCalcCreator* creator)
17  {
18  GetTable()[wghcalcname] = creator;
19  }
20 
21  std::map<std::string, WeightCalcCreator*>& WeightCalcFactory::GetTable()
22  {
23  static std::map<std::string, WeightCalcCreator*> table;
24  return table;
25  }
26 
27 }
static WeightCalc * Create(const std::string &classname)
intermediate_table::iterator iterator
static std::map< std::string, WeightCalcCreator * > & GetTable()
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
static void Register(const std::string &wghcalcname, WeightCalcCreator *creator)