Bayeux  3.4.1
Core Foundation library for SuperNEMO
skip_module.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 : 2013-12-13
5  *
6  * Copyright (C) 2011-2013 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  * A skip data record processing module.
26  *
27  */
28 
29 #ifndef DPP_SKIP_MODULE_H
30 #define DPP_SKIP_MODULE_H 1
31 
32 // This project:
33 #include <dpp/base_module.h>
34 
35 namespace dpp {
36 
39  : public base_module
40  {
41  public:
42 
44  enum mode_type
45  {
49  };
50 
53 
55  virtual ~skip_module();
56 
58  virtual void initialize(const ::datatools::properties & /* config_ */,
59  datatools::service_manager & /* service_mgr_ */,
60  dpp::module_handle_dict_type & /* modules_map_ */);
61 
63  virtual void reset();
64 
66  virtual process_status process(::datatools::things & /* data_ */);
67 
69  struct module_entry
70  {
71  std::string label;
73  };
74 
75  int get_first() const;
76 
77  int get_last() const;
78 
79  bool is_inverted() const;
80 
81  void set_first_last(int first_,
82  int last_,
83  bool inverted_ = false);
84 
85  void set_first_number(int first_,
86  int number_,
87  bool inverted_ = false);
88 
89  protected:
90 
92  void _set_defaults();
93 
94  private:
95 
96  module_entry _module_;
97  int _counter_;
98  int _first_;
99  int _last_;
100  bool _inverted_;
101 
102  // Macro to automate the registration of the module :
104 
105  };
106 
107 } // end of namespace dpp
108 
109 #endif // DPP_SKIP_MODULE_H
110 
111 // Local Variables: --
112 // mode: c++ --
113 // c-file-style: "gnu" --
114 // tab-width: 2 --
115 // End: --
A generic serializable and noncopyable container for arbitrary serializable objects.
Definition: things.h:85
skip_module(datatools::logger::priority=datatools::logger::PRIO_FATAL)
Constructor.
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
Definition: skip_module.h:46
Definition: skip_module.h:47
Top-level namespace of the Bayeux/dpp module library.
Definition: base_module.h:56
int get_last() const
Internal class of the skip_module class.
Definition: skip_module.h:69
A fatal error. The application will most likely terminate. This is the highest priority.
Definition: logger.h:85
virtual void reset()
Reset.
Definition: skip_module.h:48
process_status
Processing status flags used as the returned value of data processing methods through the pipeline.
Definition: base_module.h:65
bool is_inverted() const
virtual void initialize(const ::datatools::properties &, datatools::service_manager &, dpp::module_handle_dict_type &)
Initialization.
virtual process_status process(::datatools::things &)
Data record processing.
int get_first() const
module_handle_type handle
Definition: skip_module.h:72
void _set_defaults()
Set default values before explicit settings and initialization.
std::string label
Definition: skip_module.h:71
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
#define DPP_MODULE_REGISTRATION_INTERFACE(T)
Definition: base_module.h:231
void set_first_last(int first_, int last_, bool inverted_=false)
virtual ~skip_module()
Destructor.
void set_first_number(int first_, int number_, bool inverted_=false)
mode_type
Skip mode.
Definition: skip_module.h:44
A data processing module to skip some data records.
Definition: skip_module.h:38
Service management class.
Definition: service_manager.h:57