Bayeux  3.4.1
Core Foundation library for SuperNEMO
library_query_service.h
Go to the documentation of this file.
1 //
5 // Copyright (c) 2017 by Francois Mauger <mauger@lpccaen.in2p3.fr>
6 // Copyright (c) 2017 by Université de Caen
7 //
8 // This file is part of Bayeux/datatools.
9 //
10 // Bayeux/datatools is free software: you can redistribute it and/or modify
11 // it under the terms of the GNU General Public License as published by
12 // the Free Software Foundation, either version 3 of the License, or
13 // (at your option) any later version.
14 //
15 // Bayeux/datatools is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19 //
20 // You should have received a copy of the GNU General Public License
21 // along with Bayeux/datatools. If not, see <http://www.gnu.org/licenses/>.
22 
23 #ifndef DATATOOLS_LIBRARY_QUERY_SERVICE_H
24 #define DATATOOLS_LIBRARY_QUERY_SERVICE_H
25 
26 // This project
27 #include <datatools/properties.h>
28 #include <datatools/base_service.h>
29 #include <datatools/library_info.h>
30 
31 namespace datatools {
32 
36  {
37  public:
38 
41 
43  virtual ~library_query_service();
44 
46  virtual bool is_initialized() const;
47 
49  virtual int initialize(const datatools::properties & config_,
50  datatools::service_dict_type & services_);
51 
53  virtual int reset();
54 
56  virtual void tree_dump(std::ostream & out_ = std::clog,
57  const std::string & title_ = "",
58  const std::string & indent_ = "",
59  bool inherit_ = false) const;
60 
63 
65  const library_info & get_libinfo() const;
66 
67  private:
68 
69  void _init_();
70 
71  void _reset_();
72 
73  private:
74 
75  // Management:
76  bool _initialized_ = false;
77 
78  // Private data:
79  library_info _libinfo_;
80 
82 
83  };
84 
85 } // end of namespace datatools
86 
87 #endif // DATATOOLS_LIBRARY_QUERY_SERVICE_H
88 
89 // Local Variables: --
90 // mode: c++ --
91 // c-file-style: "gnu" --
92 // tab-width: 2 --
93 // End: --
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
virtual bool is_initialized() const
Check initialization status.
Host a register of static and/or dynamic informations about libraries or software components.
Definition: library_info.h:51
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
#define DATATOOLS_SERVICE_REGISTRATION_INTERFACE(SERVICE_CLASS_NAME)
Definition: base_service.h:152
virtual int initialize(const datatools::properties &config_, datatools::service_dict_type &services_)
Initialize the service from a list of properties.
library_info & grab_libinfo()
Return a mutable reference to the embedded library info dictionary.
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
const library_info & get_libinfo() const
Return a non mutable reference to the embedded library info dictionary.
virtual ~library_query_service()
Destructor.
Library information query service.
Definition: library_query_service.h:34
A dictionary of arbitrary properties.
Definition: properties.h:125