-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSkeletonModule.cc
74 lines (53 loc) · 1.83 KB
/
SkeletonModule.cc
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
#include <bayeux/dpp/base_module.h>
//////////////////////////////
// Module class declaration //
//////////////////////////////
class SkeletonModule : public dpp::base_module
{
public:
// Constructor
SkeletonModule();
// Destructor
~SkeletonModule();
// Initialize called before processing (inherited from dpp:base_module)
void initialize(const datatools::properties &, datatools::service_manager &, dpp::module_handle_dict_type &);
// Process function for each events (inherited from dpp:base_module)
dpp::base_module::process_status process(datatools::things &);
// Finalize function (costum method) called at the class destruction
void finalize();
// Reset function
void reset () {};
private:
// Bayeux' macro to register this class as data processing module
DPP_MODULE_REGISTRATION_INTERFACE(SkeletonModule);
// Members
unsigned long long nb_events_processed;
};
/////////////////////////////
// Module class definition //
/////////////////////////////
// Bayeux' macro to register this class as data processing module
DPP_MODULE_REGISTRATION_IMPLEMENT(SkeletonModule, "Skeleton");
SkeletonModule::SkeletonModule() : dpp::base_module() {}
SkeletonModule::~SkeletonModule()
{
if (this->is_initialized())
this->finalize();
}
void SkeletonModule::initialize(const datatools::properties &, datatools::service_manager &, dpp::module_handle_dict_type &)
{
std::cout << "+++ SkeletonModule::initialize()" << std::endl;
nb_events_processed = 0;
this->_set_initialized(true);
}
dpp::base_module::process_status SkeletonModule::process (datatools::things &event)
{
std::cout << "+++ SkeletonModule::process()" << std::endl;
++nb_events_processed;
return PROCESS_OK;
}
void SkeletonModule::finalize()
{
std::cout << "+++ SkeletonModule::finalize()" << std::endl;
this->_set_initialized(false);
}