Bayeux  3.4.1
Core Foundation library for SuperNEMO
utils_module.h
Go to the documentation of this file.
1 /* Author (s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2011-01-09
4  * Last modified: 2013-05-15
5  *
6  * License:
7  *
8  * Description:
9  *
10  * Utility processing module
11  *
12  */
13 
14 #ifndef DPP_UTILS_MODULE_H
15 #define DPP_UTILS_MODULE_H 1
16 
17 // Standard library:
18 #include <cstdlib>
19 #include <stdexcept>
20 #include <iostream>
21 #include <string>
22 
23 // Third party:
24 // - Bayeux/datatools:
25 #include <datatools/properties.h>
26 
27 // This project:
28 #include <dpp/base_module.h>
29 
30 namespace dpp {
31 
34  : public base_module
35  {
36  public:
37 
38  enum mode_type {
40  MODE_CLEAR = 0x1,
44  };
45 
48 
50  virtual ~utils_module();
51 
53  virtual void initialize(const ::datatools::properties & /* config_ */,
54  datatools::service_manager & /* service_mgr_ */,
55  dpp::module_handle_dict_type & /* modules_map_ */);
56 
58  virtual void reset();
59 
61  virtual process_status process(::datatools::things & /* data_ */);
62 
63  protected:
64 
66  void _set_defaults();
67 
69  void _process_clear(datatools::things & a_event_record_);
70 
72  void _process_remove_one_typed_bank(datatools::things & a_event_record_);
73 
75  void _process_remove_banks(datatools::things & a_event_record_);
76 
78  void _process_add_property (datatools::things & a_event_record_);
79 
80  private:
81 
82  mode_type _mode_;
83  std::string _remove_one_typed_bank_label_;
84  std::string _remove_one_typed_bank_type_;
85  std::vector<std::string> _remove_bank_labels_;
86  std::string _add_property_bank_label_;
87  std::string _add_property_key_;
88  datatools::properties _add_property_value_;
89  std::string _add_property_description_;
90  bool _add_property_update_;
91 
92  // Macro to automate the registration of the module :
94 
95  };
96 
97 } // end of namespace dpp
98 
99 #endif // DPP_UTILS_MODULE_H
100 
101 // Local Variables: --
102 // mode: c++ --
103 // c-file-style: "gnu" --
104 // tab-width: 2 --
105 // End: --
A generic serializable and noncopyable container for arbitrary serializable objects.
Definition: things.h:85
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
Top-level namespace of the Bayeux/dpp module library.
Definition: base_module.h:56
A fatal error. The application will most likely terminate. This is the highest priority.
Definition: logger.h:85
Remove several banks by label (name)
Definition: utils_module.h:42
process_status
Processing status flags used as the returned value of data processing methods through the pipeline.
Definition: base_module.h:65
Add a property in a bank.
Definition: utils_module.h:43
void _process_add_property(datatools::things &a_event_record_)
Special method to add some property in a 'datatools::properties' bank.
void _process_clear(datatools::things &a_event_record_)
Special method to clear all banks.
utils_module(datatools::logger::priority=datatools::logger::PRIO_FATAL)
Constructor.
std::map< std::string, module_entry_type > module_handle_dict_type
Definition: module_tools.h:141
Base processing module (abstract interface)
Definition: base_module.h:59
Undefined mode.
Definition: utils_module.h:39
#define DPP_MODULE_REGISTRATION_INTERFACE(T)
Definition: base_module.h:231
virtual void reset()
Reset.
A data processing module for automated utility operations (bank removal)
Definition: utils_module.h:33
virtual void initialize(const ::datatools::properties &, datatools::service_manager &, dpp::module_handle_dict_type &)
Initialization.
mode_type
Definition: utils_module.h:38
void _process_remove_one_typed_bank(datatools::things &a_event_record_)
Special method to remove one single bank by label and type (optional)
virtual process_status process(::datatools::things &)
Data record processing.
void _set_defaults()
Set default values for attributes.
Remove one single bank, optionaly with a given type (serial tag)
Definition: utils_module.h:41
Clear all banks mode.
Definition: utils_module.h:40
virtual ~utils_module()
Destructor.
Service management class.
Definition: service_manager.h:57
void _process_remove_banks(datatools::things &a_event_record_)
Special method to remove several banks by label (name)
A dictionary of arbitrary properties.
Definition: properties.h:125