Bayeux  3.4.1
Core Foundation library for SuperNEMO
utils_cut.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date : 2011-09-18
4  * Last modified : 2013-02-18
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  * Utility cut.
26  *
27  */
28 
29 #ifndef DPP_UTILS_CUT_H
30 #define DPP_UTILS_CUT_H 1
31 
32 // Standard library:
33 #include <string>
34 #include <vector>
35 
36 // Third party:
37 // - Bayeux/:
38 #include <cuts/i_cut.h>
39 
40 namespace datatools {
41  class properties;
42  class service_manager;
43 }
44 
45 namespace dpp {
46 
47  class utils_cut
48  : public cuts::i_cut
49  {
50  public:
51 
52  enum mode_type {
55  };
56 
57  void set_mode (int mode_);
58 
59  void reset_mode ();
60 
61  int get_mode () const;
62 
63  bool is_mode_has_bank () const;
64 
65  void set_has_bank_name (const std::string & bank_name_);
66 
67  const std::string & get_has_bank_name () const;
68 
69  void set_has_bank_type (const std::string & bank_type_);
70 
71  const std::string & get_has_bank_type () const;
72 
73  void set_has_bank (const std::string & bank_name_,
74  const std::string & bank_type_ = "");
75 
76  utils_cut(datatools::logger::priority a_logging_priority =
78  virtual ~utils_cut();
79 
81  virtual void initialize(const datatools::properties &,
84 
86  virtual void reset();
87 
88 
89  virtual void tree_dump (std::ostream & out_ = std::clog,
90  const std::string & title_ = "",
91  const std::string & indent_ = "",
92  bool inherit_ = false) const;
93 
94  protected:
95  virtual int _accept();
96 
97  private:
98 
99  int _mode_;
100  std::vector<std::string> _bank_names_;
101  std::vector<std::string> _bank_types_;
102 
103  private:
104 
105  // Macro to automate the registration of the cut :
107 
108  };
109 
110 } // end of namespace dpp
111 
112 #endif //DPP_UTILS_CUT_H
113 
114 // Local Variables: --
115 // mode: c++ --
116 // c-file-style: "gnu" --
117 // End: --
Definition: utils_cut.h:47
priority
Priority levels for logging from most to least critical.
Definition: logger.h:82
virtual void initialize(const datatools::properties &, datatools::service_manager &, cuts::cut_handle_dict_type &)
Initialization.
Top-level namespace of the Bayeux/dpp module library.
Definition: base_module.h:56
void set_has_bank_name(const std::string &bank_name_)
Definition: utils_cut.h:54
A fatal error. The application will most likely terminate. This is the highest priority.
Definition: logger.h:85
The cut abstract base class (interface)
Definition: i_cut.h:62
virtual void reset()
Reset.
bool is_mode_has_bank() const
void set_mode(int mode_)
virtual int _accept()
The main selection method (pure virtual, invoked by the.
mode_type
Definition: utils_cut.h:52
#define CUT_REGISTRATION_INTERFACE(T)
Definition: i_cut.h:411
const std::string & get_has_bank_name() const
virtual ~utils_cut()
const std::string & get_has_bank_type() const
Definition: utils_cut.h:53
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
void set_has_bank_type(const std::string &bank_type_)
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
std::map< std::string, cut_entry_type > cut_handle_dict_type
Alias type of a dictionary of cut entry.
Definition: cut_tools.h:175
int get_mode() const
void set_has_bank(const std::string &bank_name_, const std::string &bank_type_="")
Service management class.
Definition: service_manager.h:57
A dictionary of arbitrary properties.
Definition: properties.h:125
utils_cut(datatools::logger::priority a_logging_priority=datatools::logger::PRIO_FATAL)