All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Static Public Member Functions | Static Private Member Functions | List of all members
sbn::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 15 of file sbncode/sbncode/SBNEventWeight/Base/WeightCalcFactory.h.

Member Function Documentation

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

Definition at line 7 of file sbncode/sbncode/SBNEventWeight/Base/WeightCalcFactory.cxx.

7  {
8  std::map<std::string, WeightCalcCreator*>::iterator i;
9  i = GetTable().find(wghcalcname);
10 
11  if (i != GetTable().end()) {
12  return i->second->Create();
13  }
14  else {
15  return (WeightCalc*) NULL;
16  }
17 }
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
static std::map< std::string, WeightCalcCreator * > & GetTable()
std::map< std::string, WeightCalcCreator * > & sbn::evwgh::WeightCalcFactory::GetTable ( )
staticprivate

Definition at line 27 of file sbncode/sbncode/SBNEventWeight/Base/WeightCalcFactory.cxx.

27  {
28  static std::map<std::string, WeightCalcCreator*> table;
29  return table;
30 }
void sbn::evwgh::WeightCalcFactory::Register ( const std::string &  wghcalcname,
WeightCalcCreator creator 
)
static

Definition at line 20 of file sbncode/sbncode/SBNEventWeight/Base/WeightCalcFactory.cxx.

22  {
23  GetTable()[wghcalcname] = creator;
24 }
static std::map< std::string, WeightCalcCreator * > & GetTable()

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