Bayeux  3.4.1
Core Foundation library for SuperNEMO
parameter_physical.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date : 2014-05-11
4  * Last modified : 2014-07-18
5  *
6  * Copyright (C) 2014 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 physical instance of a configuration parameter.
26  *
27  */
28 
29 #ifndef DATATOOLS_CONFIGURATION_PARAMETER_PHYSICAL_H
30 #define DATATOOLS_CONFIGURATION_PARAMETER_PHYSICAL_H
31 
32 // Standard library:
33 #include <string>
34 #include <memory>
35 
36 // Third party:
37 // #include <boost/shared_ptr.hpp>
38 
39 // This project (Bayeux/datatools)
40 #include <datatools/i_tree_dump.h>
43 
44 namespace datatools {
45 
46  namespace configuration {
47 
48  // Forward declaration:
49  class parameter_model;
50  class i_occurrence;
51 
54  {
55  public:
56 
58  virtual bool is_name_valid(const std::string & name_) const;
59 
62 
65 
67  void reset();
68 
70  void set(const std::string & name_,
71  const std::string & desc_,
72  const pm_handle_type & parameter_model_handle_);
73 
75  const parameter_model & get_model() const;
76 
78  const pm_handle_type & get_model_handle() const;
79 
81  virtual void tree_dump(std::ostream& out_ = std::clog,
82  const std::string& title_ = "",
83  const std::string& indent_ = "",
84  bool inherit_ = false) const;
85 
87  bool has_occurrence() const;
88 
90  const i_occurrence & get_occurrence() const;
91 
93  void install_occurrence(const std::string & occurrence_def_);
94 
95  private:
96 
97  pm_handle_type _model_;
98  std::shared_ptr<i_occurrence> _occurrence_;
99 
100  };
101 
102  } // end of namespace configuration
103 
104 } // end of namespace datatools
105 
106 #endif // DATATOOLS_CONFIGURATION_PARAMETER_PHYSICAL_H
107 
108 // Local Variables: --
109 // mode: c++ --
110 // c-file-style: "gnu" --
111 // tab-width: 2 --
112 // End: --
virtual bool is_name_valid(const std::string &name_) const
Check if a name is valid.
bool has_occurrence() const
Check occurrence.
void install_occurrence(const std::string &occurrence_def_)
Install an occurrence object.
const parameter_model & get_model() const
Return the model of the parameter.
const i_occurrence & get_occurrence() const
Return the occurrence of the parameter.
const pm_handle_type & get_model_handle() const
Return the handle on the model of the parameter.
Physical parameter physical.
Definition: parameter_physical.h:53
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
void set(const std::string &name_, const std::string &desc_, const pm_handle_type &parameter_model_handle_)
Set the physical.
Abstract interface for all occurrence objects.
Definition: i_occurrence.h:48
A base class with useful attributes usable in many contexts.
Definition: enriched_base.h:52
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Smart print.
Description/model of a configuration parameter.
Definition: parameter_model.h:60