Bayeux  3.4.1
Core Foundation library for SuperNEMO
simulated_data_input_module.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date : 2011-07-04
4  * Last modified : 2013-06-22
5  *
6  * Description:
7  *
8  * Copyright (C) 2013 Francois Mauger <mauger@lpccaen.in2p3.fr>
9  *
10  */
11 
12 #ifndef MCTOOLS_SIMULATED_DATA_INPUT_MODULE_H
13 #define MCTOOLS_SIMULATED_DATA_INPUT_MODULE_H 1
14 
15 // Third party:
16 // - Bayeux/datatools:
18 // - Bayeux/dpp:
19 #include <dpp/base_module.h>
20 
21 // This project:
22 #include <mctools/simulated_data.h>
23 
24 namespace mctools {
25 
26  class simulated_data_reader;
27 
30  : public dpp::base_module
31  {
32  public:
33 
34  static const std::string DEFAULT_SD_BANK_LABEL;
35  static const std::string & default_sd_bank_label();
36 
37  // Constructor :
39 
40  // Destructor :
42 
44  virtual void initialize(const datatools::properties & /* config_ */,
45  datatools::service_manager & /* service_mgr_ */,
46  dpp::module_handle_dict_type & /* modules_map_ */);
47 
49  virtual void reset();
50 
53 
54  bool is_terminated() const;
55 
56  void set_single_input_file(const std::string & filepath_);
57 
58  void set_list_of_input_files(const std::vector<std::string> & filepaths_,
59  bool allow_duplicate_ = false);
60 
61  void set_incremental_input_files(const std::string & path_,
62  const std::string & prefix_,
63  const std::string & extension_,
64  unsigned int stop_,
65  unsigned int start_ = 0,
66  int increment_ = 1);
67 
68  void set_sd_bank_label(const std::string & bank_label_);
69 
71 
72  void set_limits(int max_record_total_, int max_record_per_file_ = 0, int max_files_ = -1);
73 
74  protected:
75 
77 
78  private:
79 
80  bool _overwrite_existing_sd_bank_label_;
81  std::string _sd_bank_label_;
82  datatools::properties _reader_setup_;
83  boost::scoped_ptr<mctools::simulated_data_reader> _reader_;
84 
85  // Macro to automate the registration of the module :
87 
88  };
89 
90 } // end of namespace mctools
91 
92 // Object configuration description (OCD) support :
93 #include <datatools/ocd_macros.h>
95 
96 #endif // MCTOOLS_SIMULATED_DATA_INPUT_MODULE_H
97 
98 // Local Variables: --
99 // mode: c++ --
100 // c-file-style: "gnu" --
101 // tab-width: 2 --
102 // 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
simulated_data_input_module(datatools::logger::priority logging_priority_=datatools::logger::PRIO_FATAL)
Definition: base_step_hit.h:32
A fatal error. The application will most likely terminate. This is the highest priority.
Definition: logger.h:85
process_status
Processing status flags used as the returned value of data processing methods through the pipeline.
Definition: base_module.h:65
Simulation data input module.
Definition: simulated_data_input_module.h:29
void set_incremental_input_files(const std::string &path_, const std::string &prefix_, const std::string &extension_, unsigned int stop_, unsigned int start_=0, int increment_=1)
virtual dpp::base_module::process_status process(datatools::things &)
Data record processing.
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
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
void set_limits(int max_record_total_, int max_record_per_file_=0, int max_files_=-1)
dpp::base_module::process_status _load(datatools::things &event_record_)
void set_list_of_input_files(const std::vector< std::string > &filepaths_, bool allow_duplicate_=false)
#define DPP_MODULE_REGISTRATION_INTERFACE(T)
Definition: base_module.h:231
static const std::string DEFAULT_SD_BANK_LABEL
Definition: simulated_data_input_module.h:34
void set_sd_bank_label(const std::string &bank_label_)
virtual void initialize(const datatools::properties &, datatools::service_manager &, dpp::module_handle_dict_type &)
Initialization.
static const std::string & default_sd_bank_label()
Service management class.
Definition: service_manager.h:57
void set_single_input_file(const std::string &filepath_)
A dictionary of arbitrary properties.
Definition: properties.h:125