aGrUM  0.14.2
PRM.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
27 #ifndef GUM_PRM_H
28 #define GUM_PRM_H
29 
30 #include <string>
31 
32 #include <agrum/core/hashTable.h>
33 #include <agrum/core/sequence.h>
34 
44 
46 
47 namespace gum {
48  namespace prm {
49 
50  template < typename GUM_SCALAR >
51  class PRMSystem;
52  template < typename GUM_SCALAR >
53  class PRMFactory;
62  template < typename GUM_SCALAR >
63  class PRM {
64  public:
65  friend class PRMFactory< GUM_SCALAR >;
66 
67  // ========================================================================
69  // ========================================================================
71 
75  PRM();
76 
80  ~PRM();
81 
83  // ========================================================================
85  // ========================================================================
87 
92  bool isType(const std::string& name) const;
93 
98  bool isClass(const std::string& name) const;
99 
106  bool isInterface(const std::string& name) const;
107 
112  bool isSystem(const std::string& name) const;
113 
118  PRMType& type(const std::string& name);
119 
124  const PRMType& type(const std::string& name) const;
125 
129  const Set< PRMType* >& types() const;
130 
135  PRMClass< GUM_SCALAR >& getClass(const std::string& name);
136 
141  const PRMClass< GUM_SCALAR >& getClass(const std::string& name) const;
142 
146  const Set< PRMClass< GUM_SCALAR >* >& classes() const;
147 
152  PRMInterface< GUM_SCALAR >& getInterface(const std::string& name);
153 
159  getInterface(const std::string& name) const;
160 
165 
171  PRMSystem< GUM_SCALAR >& getSystem(const std::string& name);
172 
178  const PRMSystem< GUM_SCALAR >& getSystem(const std::string& name) const;
179 
183  const Set< PRMSystem< GUM_SCALAR >* >& systems() const;
184 
186  private:
187  // ========================================================================
189  // ========================================================================
191 
195  PRM(const PRM< GUM_SCALAR >& source);
196 
201 
203  void __addBuiltInTypes();
204 
206  // ========================================================================
208  // ========================================================================
210 
213 
216 
219 
222 
225 
228 
231 
234 
236  };
237 
238 
239 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
240  extern template class PRM< double >;
241 #endif
242 
243 
244  } /* namespace prm */
245 } /* namespace gum */
246 
247 #include <agrum/PRM/PRM_tpl.h>
248 
249 #endif /* GUM_PRM_H */
PRMInterface< GUM_SCALAR > & getInterface(const std::string &name)
Returns a constant reference on a Class<GUM_SCALAR> given it&#39;s name.
Definition: PRM_tpl.h:125
const Set< PRMType *> & types() const
Returns the Set of all PRMType in this PRM.
Definition: PRM_tpl.h:101
Headers of gum::PRMSlotChain.
bool isClass(const std::string &name) const
Definition: PRM_tpl.h:76
Header file of gum::Sequence, a class for storing (ordered) sequences of objects. ...
Headers of gum::PRMAttribute.
PRM()
Default constructor.
Definition: PRM_tpl.h:33
const Set< PRMSystem< GUM_SCALAR > *> & systems() const
Returns the Set of all Systems in this PRM.
Definition: PRM_tpl.h:155
Headers of gum::prm::Class<GUM_SCALAR>.
void __addBuiltInTypes()
Add the built-in types in the PRM.
Definition: PRM_tpl.h:61
const Set< PRMClass< GUM_SCALAR > *> & classes() const
Returns the Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM_tpl.h:119
const Set< PRMInterface< GUM_SCALAR > *> & interfaces() const
Returns the Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM_tpl.h:137
Set< PRMType *> __types
Set of all PRMType in this PRM.
Definition: PRM.h:227
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
Inline implementation of PRM.
The class for generic Hash Tables.
Definition: hashTable.h:676
bool isType(const std::string &name) const
Definition: PRM_tpl.h:71
Representation of a setA Set is a structure that contains arbitrary elements.
Definition: set.h:162
HashTable< std::string, PRMType *> __typeMap
Mapping of all PRMType given their name.
Definition: PRM.h:224
~PRM()
Destructor.
Definition: PRM_tpl.h:40
Factory which builds a PRM<GUM_SCALAR>.
Definition: PRMType.h:47
PRMType & type(const std::string &name)
Returns a constant reference on a PRMType given it&#39;s name.
Definition: PRM_tpl.h:91
bool isSystem(const std::string &name) const
Definition: PRM_tpl.h:86
PRMSystem< GUM_SCALAR > & getSystem(const std::string &name)
Returns a constant reference on a PRMSystem<GUM_SCALAR> given it&#39;s name.
Definition: PRM_tpl.h:143
A PRMSystem is a container of PRMInstance and describe a relational skeleton.
Definition: PRMObject.h:226
Set< PRMInterface< GUM_SCALAR > *> __interfaces
Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM.h:221
This is a decoration of the DiscreteVariable class.
Definition: PRMType.h:60
An PRMInterface is implemented by a Class<GUM_SCALAR> and defines a set of PRMReferenceSlot<GUM_SCALA...
Definition: PRMClass.h:51
Headers of PRMSystem.
HashTable< std::string, PRMSystem< GUM_SCALAR > *> __systemMap
Mapping of all Systems given their name.
Definition: PRM.h:230
Headers of gum::PRMAggregate.
Headers of Class.
HashTable< std::string, PRMInterface< GUM_SCALAR > *> __interfaceMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:218
Headers of gum::PRMAttribute.
This class represents a Probabilistic Relational PRMSystem<GUM_SCALAR>.
Definition: PRM.h:63
Headers of gum::prm::PRMInstance<GUM_SCALAR>
A PRMClass is an object of a PRM representing a fragment of a Bayesian Network which can be instantia...
Definition: PRMClass.h:63
Set< PRMClass< GUM_SCALAR > *> __classes
Set of all Class<GUM_SCALAR> in this PRM.
Definition: PRM.h:215
PRMClass< GUM_SCALAR > & getClass(const std::string &name)
Returns a constant reference on a Class<GUM_SCALAR> given it&#39;s name.
Definition: PRM_tpl.h:107
PRM< GUM_SCALAR > & operator=(const PRM< GUM_SCALAR > &source)
Copy operator.
HashTable< std::string, PRMClass< GUM_SCALAR > *> __classMap
Mapping of all Class<GUM_SCALAR> given their name.
Definition: PRM.h:212
bool isInterface(const std::string &name) const
Definition: PRM_tpl.h:81
Headers of gum::PRMClassElement.
Class hash tables iterators.
Headers of PRMObject.
Set< PRMSystem< GUM_SCALAR > *> __systems
Set of all Systems in this PRM.
Definition: PRM.h:233