Bayeux  3.4.1
Core Foundation library for SuperNEMO
dpp_driver.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date : 2011-06-19
4  * Last modified : 2017-05-19
5  *
6  * Copyright (C) 2011-2017 Francois Mauger <mauger@lpccaen.in2p3.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or (at
11  * your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  *
23  * Description:
24  *
25  * The dpp driver.
26  *
27  */
28 
29 #ifndef DPP_DPP_DRIVER_H
30 #define DPP_DPP_DRIVER_H 1
31 
32 // Standard library:
33 #include <iostream>
34 #include <string>
35 #include <vector>
36 #include <memory>
37 
38 // Third party:
39 // - Boost:
40 #include <boost/utility.hpp>
41 // - Bayeux/datatools:
42 #include <datatools/logger.h>
44 
45 namespace dpp {
46 
49  {
52 
54  void reset();
55 
57  void dump(std::ostream & out_ = std::clog) const;
58 
60  void tree_dump(std::ostream & out_ = std::clog,
61  const std::string & title_ = "",
62  const std::string & indent_ = "",
63  bool inherit_ = false) const;
64 
65  std::string logging_label;
69  std::vector<std::string> module_names;
70  std::string LL_config;
71  std::vector<std::string> LL_dlls;
72  std::vector<std::string> input_files;
73  std::vector<std::string> output_files;
83 
84  };
85 
86  class module_manager;
87  class base_module;
88  class input_module;
89  class output_module;
90 
92  class dpp_driver
93  : boost::noncopyable
94  {
95  public:
96 
98  dpp_driver();
99 
101  ~dpp_driver();
102 
104  bool is_initialized() const;
105 
107  void setup(const dpp_driver_params &);
108 
110  void initialize();
111 
113  void run();
114 
116  void reset();
117 
118  private:
119 
120  // Management:
121  bool _initialized_;
122  datatools::logger::priority _logging_;
123 
124  // Parameters:
125  dpp_driver_params _params_;
126  bool _use_slice_;
127 
128  // Working data:
129  std::unique_ptr<datatools::library_loader> _lib_loader_;
130  std::unique_ptr<dpp::module_manager> _module_mgr_;
131  std::vector<dpp::base_module*> _modules_;
132  std::unique_ptr<dpp::output_module> _sink_;
133  std::unique_ptr<dpp::input_module> _source_;
134 
135  };
136 
137 }
138 
139 #endif // DPP_DPP_DRIVER_H
140 
141 // Local Variables: --
142 // mode: c++ --
143 // c-file-style: "gnu" --
144 // tab-width: 2 --
145 // End: --
int slice_width
Definition: dpp_driver.h:79
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
void run()
Run.
int slice_start
Definition: dpp_driver.h:77
dpp_driver_params()
Default constructor.
Top-level namespace of the Bayeux/dpp module library.
Definition: base_module.h:56
std::vector< std::string > LL_dlls
Definition: dpp_driver.h:71
~dpp_driver()
Destructor.
void reset()
Reset.
bool break_on_error_as_fatal
Definition: dpp_driver.h:66
int slice_stop
Definition: dpp_driver.h:78
void setup(const dpp_driver_params &)
Setup from configuration parameters.
std::string LL_config
Definition: dpp_driver.h:70
void initialize()
Initialization.
std::vector< std::string > output_files
Definition: dpp_driver.h:73
int max_records
Definition: dpp_driver.h:75
The data processing pipeline driver.
Definition: dpp_driver.h:92
An input data processing module for automated I/O operations.
Definition: input_module.h:50
The set of configuration parameters for the data processing pipeline driver.
Definition: dpp_driver.h:48
Base processing module (abstract interface)
Definition: base_module.h:59
bool no_max_records
Definition: dpp_driver.h:74
std::vector< std::string > input_files
Definition: dpp_driver.h:72
bool is_initialized() const
Check initialization flag.
std::string module_manager_config_file
Definition: dpp_driver.h:68
A output data processing module for automated I/O operations.
Definition: output_module.h:49
bool save_stopped_data_records
Definition: dpp_driver.h:81
int print_modulo
Definition: dpp_driver.h:67
Utilities for logging information.
void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
dpp_driver()
Default constructor.
int max_records_per_output_file
Definition: dpp_driver.h:76
std::vector< std::string > module_names
Definition: dpp_driver.h:69
A manager for data processing modules.
Definition: module_manager.h:49
void dump(std::ostream &out_=std::clog) const
Print.
bool preserve_existing_files
Definition: dpp_driver.h:82
bool slice_store_out
Definition: dpp_driver.h:80
std::string logging_label
Definition: dpp_driver.h:65