Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
larsim
larsim
EventWeight
Base
WeightCalcCreator.h
Go to the documentation of this file.
1
#ifndef _WEIGHTCALCCREATOR_H_
2
#define _WEIGHTCALCCREATOR_H_
3
4
#include <iostream>
5
#include <string>
6
7
namespace
evwgh
{
8
class
WeightCalc;
9
10
class
WeightCalcCreator
11
{
12
public
:
13
WeightCalcCreator
(
const
std::string
& classname);
14
virtual
~WeightCalcCreator
() =
default
;
15
16
virtual
WeightCalc
*
Create
() = 0;
17
};
18
19
template
<
class
T>
20
class
WeightCalcImpl
:
public
WeightCalcCreator
21
{
22
public
:
23
WeightCalcImpl<T>
(
const
std::string
& classname) :
WeightCalcCreator
(classname) {std::cout << __PRETTY_FUNCTION__ <<
" called."
<<
std::endl
;}
24
virtual
~
WeightCalcImpl<T>
() {}
25
virtual
WeightCalc
*
Create
() {
return
new
T
; }
26
};
27
28
#define DECLARE_WEIGHTCALC(wghcalc) \
29
private: \
30
static const WeightCalcImpl<wghcalc> creator;
31
32
#define REGISTER_WEIGHTCALC(wghcalc) \
33
const WeightCalcImpl<wghcalc> wghcalc::creator(#wghcalc);
34
}
35
36
#endif // _WEIGHTCALCFACTORY_H_
evwgh::WeightCalcCreator::Create
virtual WeightCalc * Create()=0
string
std::string string
Definition:
nybbler.cc:12
ValidateOpDetSimulation.T
T
Definition:
ValidateOpDetSimulation.py:52
evwgh::WeightCalcImpl::Create
virtual WeightCalc * Create()
Definition:
WeightCalcCreator.h:25
evwgh::WeightCalcCreator::WeightCalcCreator
WeightCalcCreator(const std::string &classname)
Definition:
WeightCalcCreator.cxx:5
evwgh
Definition:
EventWeight_module.cc:31
evwgh::WeightCalcImpl
Definition:
WeightCalcCreator.h:20
evwgh::WeightCalc
Definition:
WeightCalc.h:19
evwgh::WeightCalcCreator
Definition:
WeightCalcCreator.h:10
evwgh::WeightCalcCreator::~WeightCalcCreator
virtual ~WeightCalcCreator()=default
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
Generated by
1.8.11