Bayeux  3.4.1
Core Foundation library for SuperNEMO
cut_service.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date : 2011-09-20
4  * Last modified : 2013-04-22
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 cut distribution service embedding a cut manager.
26  *
27  * History:
28  *
29  */
30 
31 #ifndef CUTS_CUT_SERVICE_H
32 #define CUTS_CUT_SERVICE_H 1
33 
34 // Standard library:
35 #include <string>
36 
37 // Third party:
38 // - Bayeux/datatools:
39 #include <datatools/base_service.h>
41 
42 // Forward declaration :
43 namespace datatools {
44  class properties;
45 }
46 
47 namespace cuts {
48 
49  // Forward declaration :
50  class cut_manager;
51 
54  {
55  public:
56 
58  bool owns_cut_manager () const;
59 
61  const cut_manager & get_cut_manager () const;
62 
65 
67  void set_cut_manager (const cut_manager & a_cut_manager);
68 
70  virtual bool is_initialized () const;
71 
73  virtual int initialize (const datatools::properties & a_config,
74  datatools::service_dict_type & a_service_dict);
75 
77  virtual int reset ();
78 
80  cut_service ();
81 
83  virtual ~cut_service ();
84 
86  virtual void tree_dump (std::ostream & a_out = std::clog,
87  const std::string & a_title = "",
88  const std::string & a_indent = "",
89  bool a_inherit = false) const;
90 
91  private:
92 
93  bool _owns_manager_;
94  cut_manager * _cut_manager_;
95 
96  // Registration :
98 
99  };
100 
101 } // end of namespace cuts
102 
103 #endif // CUTS_CUT_SERVICE_H
104 
105 /***************
106  * OCD support *
107  ***************/
108 #include <datatools/ocd_macros.h>
110 
111 /*
112 ** Local Variables: --
113 ** mode: c++ --
114 ** c-file-style: "gnu" --
115 ** tab-width: 2 --
116 ** End: --
117 */
The cut service.
Definition: cut_service.h:53
cut_manager & grab_cut_manager()
Return a mutable reference to the cut manager.
std::map< std::string, service_entry_ptr > service_dict_type
Type alias for a flat dictionary of service entries.
Definition: service_tools.h:196
The base service class.
Definition: base_service.h:68
bool owns_cut_manager() const
Check if the cut manager is owned by the service.
Top-level namespace of the Bayeux/cuts module library.
Definition: accept_cut.h:21
#define DATATOOLS_SERVICE_REGISTRATION_INTERFACE(SERVICE_CLASS_NAME)
Definition: base_service.h:152
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
virtual void tree_dump(std::ostream &a_out=std::clog, const std::string &a_title="", const std::string &a_indent="", bool a_inherit=false) const
Smart print.
The cut manager class.
Definition: cut_manager.h:59
virtual int initialize(const datatools::properties &a_config, datatools::service_dict_type &a_service_dict)
Initialize the service through a collection of setup properties.
virtual int reset()
Reset.
virtual bool is_initialized() const
Check the initialization status.
virtual ~cut_service()
Destructor.
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
const cut_manager & get_cut_manager() const
Return a const reference to the cut manager.
void set_cut_manager(const cut_manager &a_cut_manager)
Set the reference to an external cut manager.
cut_service()
Constructor.
A dictionary of arbitrary properties.
Definition: properties.h:125