[4c0f6f]: src / modules / base / base.cc Maximize Restore History

Download this file

base.cc    93 lines (74 with data), 1.9 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#include <Module.h>
//Functions
#include <functions/Add.h>
#include <functions/And.h>
#include <functions/Divide.h>
#include <functions/Equal.h>
#include <functions/GreaterOrEqual.h>
#include <functions/GreaterThan.h>
#include <functions/LessOrEqual.h>
#include <functions/LessThan.h>
#include <functions/Multiply.h>
#include <functions/Neg.h>
#include <functions/Not.h>
#include <functions/NotEqual.h>
#include <functions/Or.h>
#include <functions/Pow.h>
#include <functions/Subtract.h>
//Samplers
#include <samplers/SliceFactory.h>
#include <samplers/FiniteFactory.h>
//RNGs
#include <rngs/BaseRNGFactory.h>
//Monitors
#include <monitors/TraceMonitorFactory.h>
using std::vector;
namespace base {
class BaseModule : public Module {
public:
BaseModule();
~BaseModule();
};
BaseModule::BaseModule()
: Module("basemod")
{
insert(new Add);
insert(new And);
insert(new Divide);
insert(new Equal);
insert(new GreaterOrEqual);
insert(new GreaterThan);
insert(new LessOrEqual);
insert(new LessThan);
insert(new Multiply);
insert(new Neg);
insert(new Not);
insert(new NotEqual);
insert(new Or);
insert(new Pow);
insert(new Subtract);
insert(new SliceFactory);
insert(new FiniteFactory);
insert(new BaseRNGFactory);
insert(new TraceMonitorFactory);
}
BaseModule::~BaseModule() {
vector<Function*> const &fvec = functions();
for (unsigned int i = 0; i < fvec.size(); ++i) {
delete fvec[i];
}
vector<MonitorFactory*> const &mvec = monitorFactories();
for (unsigned int i = 0; i < mvec.size(); ++i) {
delete mvec[i];
}
vector<RNGFactory*> const &rvec = rngFactories();
for (unsigned int i = 0; i < rvec.size(); ++i) {
delete rvec[i];
}
vector<SamplerFactory*> const &svec = samplerFactories();
for (unsigned int i = 0; i < svec.size(); ++i) {
delete svec[i];
}
}
}
base::BaseModule _base_module;