Bayeux  3.4.1
Core Foundation library for SuperNEMO
factory.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-09-22
4  * Last modified: 2014-06-13
5  *
6  * License:
7  *
8  * Description:
9  * A factory for dynamic creation of isotopes/elements/materials
10  *
11  * History:
12  *
13  */
14 
15 #ifndef MATERIALS_FACTORY_H
16 #define MATERIALS_FACTORY_H 1
17 
18 // Standard library:
19 #include <string>
20 
21 // This project:
22 #include <materials/detail/tools.h>
23 
24 namespace datatools {
25  // Forward declarations:
26  class properties;
27 }
28 
29 namespace materials {
30 
31  // Forward declarations:
32  class isotope;
33  class element;
34  class material;
35  class manager;
36 
38  class factory
39  {
40  public:
41 
43  bool is_debug() const;
44 
46  void set_debug(bool);
47 
49  factory();
50 
52  virtual ~factory();
53 
55  bool has_manager() const;
56 
58  void set_manager(manager &);
59 
61  isotope * create_isotope(const std::string & name_,
62  const datatools::properties & config_) const;
63 
65  element * create_element(const std::string & name_,
66  const datatools::properties & config_,
67  const isotope_dict_type & isotopes_) const;
68 
70  material * create_material(const std::string & name_,
71  const datatools::properties & config_,
72  const element_dict_type & elements_,
73  const material_dict_type & materials_) const;
74 
75  private:
76 
77  bool _debug_;
78  manager * _manager_;
79 
80  };
81 
82 } // end of namespace materials
83 
84 /***************
85  * OCD support *
86  ***************/
87 #include <datatools/ocd_macros.h>
91 
92 #endif // MATERIALS_FACTORY_H
93 
94 /*
95 ** Local Variables: --
96 ** mode: c++ --
97 ** c-file-style: "gnu" --
98 ** tab-width: 2 --
99 ** End: --
100 */
Factory for isotopes, elements and materials.
Definition: factory.h:38
bool has_manager() const
Check for a manager.
std::map< std::string, smart_ref< element > > element_dict_type
Definition: tools.h:149
isotope * create_isotope(const std::string &name_, const datatools::properties &config_) const
Isotope factory method.
void set_debug(bool)
Set debug status.
factory()
Constructor.
The manager object for isotopes, elements and materials.
Definition: manager.h:53
std::map< std::string, smart_ref< isotope > > isotope_dict_type
Definition: tools.h:146
DOCD_CLASS_DECLARATION(my::algo)
Declaration of the OCD support for the my::algo class.
material * create_material(const std::string &name_, const datatools::properties &config_, const element_dict_type &elements_, const material_dict_type &materials_) const
Material factory method.
element * create_element(const std::string &name_, const datatools::properties &config_, const isotope_dict_type &isotopes_) const
Element factory method.
std::map< std::string, smart_ref< material > > material_dict_type
Definition: tools.h:150
void set_manager(manager &)
Set a manager.
A simple class to handle known isotopes (ZAI) and their basic properties (mass & decays).
Definition: isotope.h:60
virtual ~factory()
Destructor.
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
bool is_debug() const
Check debug status.
The description of a material.
Definition: material.h:116
The description of an element.
Definition: element.h:93
Top-level namespace of the Bayeux/materials module library.
Definition: geom_manager_utils.h:14
A dictionary of arbitrary properties.
Definition: properties.h:125