Bayeux  3.4.1
Core Foundation library for SuperNEMO
id_selector.h
Go to the documentation of this file.
1 /* Author(s): Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date: 2010-02-08
4  * Last modified: 2010-02-08
5  *
6  * License:
7  *
8  * Description:
9  * A selector for geometry ID
10  *
11  */
12 
13 #ifndef GEOMTOOLS_ID_SELECTOR_H
14 #define GEOMTOOLS_ID_SELECTOR_H 1
15 
16 // Standard library:
17 #include <string>
18 #include <map>
19 
20 // This project:
21 #include <geomtools/id_mgr.h>
22 #include <geomtools/address_set.h>
23 
24 namespace geomtools {
25 
26  class geom_id;
27 
35  {
36 
37  public:
38 
40  id_selector();
41 
43  id_selector(const id_mgr & id_mgr_);
44 
46  ~id_selector();
47 
49  bool is_initialized() const;
50 
70  void initialize(const std::string & rules_);
71 
84  void initialize(const datatools::properties & config_);
85 
87  void reset();
88 
90  void set_id_mgr(const id_mgr & id_mgr_);
91 
94 
96  bool match(const geom_id & gid_) const;
97 
99  void dump(std::ostream & out_ = std::clog, const std::string & title_ = "") const;
100 
102  void tree_dump(std::ostream & out_ = std::clog,
103  const std::string & title_ = "",
104  const std::string & indent_ = "") const;
105 
106  private:
107 
108  const id_mgr * _id_mgr_;
109  const id_mgr::category_info * _cat_info_;
110  std::map<int, address_set> _addr_sets_;
111 
112  };
113 
114 } // end of namespace geomtools
115 
116 #endif // GEOMTOOLS_ID_SELECTOR_H
117 
118 /*
119 ** Local Variables: --
120 ** mode: c++ --
121 ** c-file-style: "gnu" --
122 ** tab-width: 2 --
123 ** End: --
124 */
void tree_dump(std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="") const
Print.
void reset()
Reset the selector.
bool match(const geom_id &gid_) const
Check if a geometry ID match the selection.
void set_id_mgr(const id_mgr &id_mgr_)
Set the GID manager.
Definition: id_mgr.h:37
bool is_initialized() const
Check initialization status.
void dump(std::ostream &out_=std::clog, const std::string &title_="") const
Print.
A selector of geometry IDs using a specific geometry category.
Definition: id_selector.h:34
Definition: geom_id.h:41
Definition: id_mgr.h:58
id_selector()
Default constructor.
const id_mgr::category_info & get_category_info() const
Get the information associated to the requested geometry category.
void initialize(const std::string &rules_)
~id_selector()
Destructor.
Top-level namespace of the Bayeux/geomtools module library.
Definition: electromagnetic_field_manager.h:39
A dictionary of arbitrary properties.
Definition: properties.h:125