Bayeux  3.4.1
Core Foundation library for SuperNEMO
pg_tools.h
Go to the documentation of this file.
1 // -*- mode: c++ ; -*-
2 /* pg_tools.h
3  * Author (s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
4  * Creation date: 2013-02-25
5  * Last modified: 2013-02-25
6  *
7  */
8 
9 #ifndef GENBB_DETAIL_PG_TOOLS_H
10 #define GENBB_DETAIL_PG_TOOLS_H 1
11 
12 // Standard library:
13 #include <iostream>
14 #include <string>
15 #include <map>
16 
17 // Third party:
18 // - Bayeux/datatools:
19 #include <datatools/handle.h>
20 #include <datatools/bit_mask.h>
21 #include <datatools/properties.h>
22 #include <datatools/i_tree_dump.h>
23 #include <datatools/factory.h>
24 
25 namespace datatools {
26  class service_manager;
27 }
28 
29 namespace mygsl {
30  class rng;
31 }
32 
33 namespace genbb {
34 
36  class i_genbb;
37  //class i_genbb::factory_register_type;
38 
41 
42  class manager;
43 
44  namespace detail {
45 
47  {
48  public:
49 
51  {
55  };
56 
57  public:
58 
59  uint32_t get_status() const;
60 
61  void update_status(uint32_t);
62 
63  void reset_status(uint32_t);
64 
65  const datatools::properties & get_config () const;
66 
68 
69  void set_config (const datatools::properties &);
70 
71  const std::string & get_name () const;
72 
73  void set_name (const std::string &);
74 
75  const std::string & get_id () const;
76 
77  void set_id (const std::string &);
78 
79  bool has_manager () const;
80 
81  void set_manager (manager &);
82 
83  void reset_manager ();
84 
85  const manager & get_manager() const;
86 
88 
89  void set_blank ();
90 
91  void set_created ();
92 
93  void set_initialized ();
94 
95  void set_uninitialized ();
96 
97  bool is_created () const;
98 
99  bool is_initialized () const;
100 
102  pg_entry_type ();
103 
105  bool has () const;
106 
107  const i_genbb & get () const;
108 
109  i_genbb & grab ();
110 
111  const pg_handle_type & get_handle () const;
112 
114 
116 
117  virtual void tree_dump (std::ostream & out_ = std::clog,
118  const std::string & title_ = "",
119  const std::string & indent_ = "",
120  bool inherit_ = false) const;
121 
122 
123  private:
124 
125  std::string _name_;
126  std::string _id_;
127  datatools::properties _config_;
128  uint32_t _status_;
129  pg_handle_type _handle_;
130  manager * _manager_;
131 
132  };
133 
134  typedef std::map<std::string, pg_entry_type> pg_dict_type;
135 
136  void create(pg_entry_type & entry_,
138  mygsl::rng * external_random_);
139 
140  void initialize(pg_entry_type & entry_,
141  datatools::service_manager * service_manager_,
142  detail::pg_dict_type * dictionary_,
144  mygsl::rng * external_random_);
145 
146  void reset(pg_entry_type& entry_);
147 
148  } // end of namespace detail
149 
150 } // end of namespace genbb
151 
152 #endif // GENBB_DETAIL_PG_TOOLS_H
const pg_handle_type & get_handle() const
bool is_created() const
void set_blank()
bool is_initialized() const
void set_config(const datatools::properties &)
Definition: pg_tools.h:52
GENBB particle generator abstract base class.
Definition: i_genbb.h:59
static const uint32_t bit01
Definition: bit_mask.h:28
bool has() const
Check is the pg is referenced in the embedded handle.
pg_handle_type & grab_initialized_handle()
datatools::properties & grab_config()
pg_entry_type()
Constructor.
void set_manager(manager &)
void reset(pg_entry_type &entry_)
pg_handle_type & grab_handle()
void reset_manager()
const datatools::properties & get_config() const
Template factory registration class.
Definition: factory.h:51
virtual void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const
Definition: pg_tools.h:54
const i_genbb & get() const
Definition: pg_tools.h:46
void update_status(uint32_t)
void set_created()
manager & grab_manager()
void set_initialized()
Top-level namespace of the Bayeux/genbb_help module library.
Definition: alpha_decay.h:51
i_genbb & grab()
Definition: pg_tools.h:53
void create(pg_entry_type &entry_, datatools::factory_register< i_genbb > *factory_, mygsl::rng *external_random_)
void set_name(const std::string &)
Top-level namespace of the Bayeux/mygsl module library.
Definition: base_decay_driver.h:47
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
uint32_t get_status() const
static const uint32_t bit00
Definition: bit_mask.h:27
datatools::handle< i_genbb > pg_handle_type
Handle on GENBB particle generator.
Definition: pg_tools.h:36
const manager & get_manager() const
bool has_manager() const
std::map< std::string, pg_entry_type > pg_dict_type
Definition: pg_tools.h:134
void reset_status(uint32_t)
void set_uninitialized()
void set_id(const std::string &)
GENBB particle manager management class.
Definition: manager.h:69
Service management class.
Definition: service_manager.h:57
const std::string & get_id() const
status_type
Definition: pg_tools.h:50
Pseudo random number generator.
Definition: rng.h:53
const std::string & get_name() const
void initialize(pg_entry_type &entry_, datatools::service_manager *service_manager_, detail::pg_dict_type *dictionary_, datatools::factory_register< i_genbb > *factory_, mygsl::rng *external_random_)
A dictionary of arbitrary properties.
Definition: properties.h:125