LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evwgh::WeightCalcFactory Class Reference

#include "WeightCalcFactory.h"

Static Public Member Functions

static WeightCalcCreate (const std::string &classname)
 
static void Register (const std::string &wghcalcname, WeightCalcCreator *creator)
 

Static Private Member Functions

static std::map< std::string, WeightCalcCreator * > & GetTable ()
 

Detailed Description

Definition at line 11 of file WeightCalcFactory.h.

Member Function Documentation

WeightCalc * evwgh::WeightCalcFactory::Create ( const std::string &  classname)
static

Definition at line 6 of file WeightCalcFactory.cxx.

References util::end(), and GetTable().

Referenced by evwgh::WeightManager::Configure().

7  {
9  i = GetTable().find(wghcalcname);
10 
11  if (i != GetTable().end())
12  return i->second->Create();
13  else
14  return (WeightCalc*)NULL;
15  }
intermediate_table::iterator iterator
static std::map< std::string, WeightCalcCreator * > & GetTable()
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
std::map< std::string, WeightCalcCreator * > & evwgh::WeightCalcFactory::GetTable ( )
staticprivate

Definition at line 22 of file WeightCalcFactory.cxx.

Referenced by Create(), and Register().

23  {
24  static std::map<std::string, WeightCalcCreator*> table;
25  return table;
26  }
void evwgh::WeightCalcFactory::Register ( const std::string &  wghcalcname,
WeightCalcCreator creator 
)
static

Definition at line 17 of file WeightCalcFactory.cxx.

References GetTable().

Referenced by evwgh::WeightCalcCreator::WeightCalcCreator().

18  {
19  GetTable()[wghcalcname] = creator;
20  }
static std::map< std::string, WeightCalcCreator * > & GetTable()

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