aGrUM  0.20.2
a C++ library for (probabilistic) graphical models
PRMClass.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright 2005-2020 Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
4  * info_at_agrum_dot_org
5  *
6  * This library is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 
22 /**
23  * @file
24  * @brief Headers of gum::prm::Class<GUM_SCALAR>.
25  *
26  * @author Lionel TORTI and Pierre-Henri WUILLEMIN(@LIP6)
27  */
28 
29 #ifndef GUM_CLASS_H
30 #define GUM_CLASS_H
31 
32 #include <utility>
33 
34 #include <agrum/agrum.h>
35 #include <agrum/tools/core/hashFunc.h>
36 #include <agrum/tools/core/bijection.h>
37 #include <agrum/tools/core/sequence.h>
38 #include <agrum/tools/core/set.h>
39 #include <agrum/tools/multidim/implementations/multiDimImplementation.h>
40 #include <agrum/tools/multidim/implementations/multiDimSparse.h>
41 #include <agrum/PRM/elements/PRMAggregate.h>
42 #include <agrum/PRM/elements/PRMAttribute.h>
43 #include <agrum/PRM/elements/PRMClassElementContainer.h>
44 #include <agrum/PRM/elements/PRMParameter.h>
45 #include <agrum/PRM/elements/PRMReferenceSlot.h>
46 #include <agrum/PRM/elements/PRMSlotChain.h>
47 
48 
49 namespace gum {
50  namespace prm {
51 
52  template < typename GUM_SCALAR >
53  class PRMInterface;
54 
55  /**
56  * @class PRMClass
57  * @headerfile PRMClass.h <agrum/PRM/elements/PRMClass.h>
58  * @brief A PRMClass is an object of a PRM representing a fragment
59  * of a Bayesian network which can be instantiated in PRMInstance.
60  *
61  * @see PRMClassElement
62  * @ingroup prm_group
63  */
64  template < typename GUM_SCALAR >
66  friend class PRMInterface< GUM_SCALAR >;
67 
68  public:
69  /// @name Constructors & destructor.
70  /// @{
71 
72  /**
73  * Default constructor.
74  * @param name The class name.
75  */
76  explicit PRMClass(const std::string& name);
77 
78  /**
79  * Constructor for building a subclass of super.
80  * @param name The subclass name.
81  * @param super The super Class<GUM_SCALAR> of this.
82  * @param delayInheritance If true, inheritance will be delayed.
83  */
84  PRMClass(const std::string& name,
85  PRMClass< GUM_SCALAR >& super,
86  bool delayInheritance = false);
87 
88  /**
89  * Constructor for building a Class<GUM_SCALAR> implementing several each
90  * interface
91  * in set.
92  * @param name The sub class name.
93  * @param set The Set of implemented interfaces.
94  * @param delayInheritance If true, inheritance will be delayed.
95  */
96  PRMClass(const std::string& name,
97  const Set< PRMInterface< GUM_SCALAR >* >& set,
98  bool delayInheritance = false);
99 
100  /**
101  * Constructor for building a subclass of super and implementing each
102  * interface in set.
103  * @param name The sub class name.
104  * @param super The super Class<GUM_SCALAR> of this.
105  * @param set The Set of implemented interfaces.
106  * @param delayInheritance If true, inheritance will be delayed.
107  */
108  PRMClass(const std::string& name,
109  PRMClass< GUM_SCALAR >& super,
110  const Set< PRMInterface< GUM_SCALAR >* >& set,
111  bool delayInheritance = false);
112 
113  /// Copy constructor.
114  PRMClass(const PRMClass< GUM_SCALAR >& source) = delete;
115 
116  /// Move constructor.
117  PRMClass(const PRMClass< GUM_SCALAR >&& source) = delete;
118 
119  /// Copy operator. Don't use it.
120  PRMClass< GUM_SCALAR >& operator=(const PRMClass< GUM_SCALAR >& source)
121  = delete;
122 
123  /// Move operator. Don't use it.
124  PRMClass< GUM_SCALAR >& operator=(const PRMClass< GUM_SCALAR >&& source)
125  = delete;
126 
127  /// Destructor.
128  virtual ~PRMClass();
129 
130  /// Implementation of pure virtual method of PRMObject.
131  virtual PRMObject::prm_type obj_type() const;
132  /// @}
133  // ========================================================================
134  /// @name Graphical operator
135  // ========================================================================
136  /// @{
137 
138  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
140 
141  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
142  const PRMClassElement< GUM_SCALAR >& get(NodeId id) const;
143 
144  /// @}
145  // ========================================================================
146  /// @name PRMClassElement<GUM_SCALAR> getters and setters
147  // ========================================================================
148  /// @{
149 
150  /**
151  * @brief Returns true if elt is an output node.
152  * @param elt A node of this class.
153  * @return Returns true if elt is an output node.
154  */
155  virtual bool isOutputNode(const PRMClassElement< GUM_SCALAR >& elt) const;
156 
157  /**
158  * @brief Return true if the attribute named safe_name is a cast
159  * descendant.
160  * Cast descendant are automatically added PRMAttribute<GUM_SCALAR> for
161  * type
162  * casting.
163  * @param safe_name The safe name of an PRMAttribute<GUM_SCALAR> of this
164  * class.
165  * @return true if safe_name is a cast descendant.
166  * @throw NotFound Raised if safe_name does not name an
167  * PRMAttribute<GUM_SCALAR> in this Class<GUM_SCALAR>.
168  */
169  bool isCastDescendant(const std::string& safe_name) const;
170 
171  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const
172  /// std::string&).
174 
175  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const
176  /// std::string&).
177  const PRMClassElement< GUM_SCALAR >& get(const std::string& name) const;
178 
179  /// See gum::prm::add(PRMClassElement<GUM_SCALAR>*).
180  virtual NodeId add(PRMClassElement< GUM_SCALAR >* elt);
181 
182  /// See gum::prm::overload(PRMClassElement<GUM_SCALAR>*).
184 
185  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::addArc().
186  virtual void addArc(const std::string& tail, const std::string& head);
187 
188  /**
189  * Returns the set of PRMAttribute<GUM_SCALAR> of this Class<GUM_SCALAR>.
190  * @return Returns the set of PRMAttribute<GUM_SCALAR> of this
191  * Class<GUM_SCALAR>.
192  */
193  const Set< PRMAttribute< GUM_SCALAR >* >& attributes() const;
194 
195  /**
196  * Returns the set of parameters of this Class<GUM_SCALAR>.
197  * @return Returns the set of parameters of this Class<GUM_SCALAR>.
198  */
199  const Set< PRMParameter< GUM_SCALAR >* >& parameters() const;
200 
201  /**
202  * Returns all the parameters in the scope of this class.
203  * &return all the parameters in the scope of this class.
204  */
205  HashTable< std::string, const PRMParameter< GUM_SCALAR >* > scope() const;
206 
207  /**
208  * Returns the set of PRMAggregate<GUM_SCALAR> of this Class<GUM_SCALAR>.
209  * @return Returns the set of PRMAggregate<GUM_SCALAR> of this
210  * Class<GUM_SCALAR>.
211  */
212  const Set< PRMAggregate< GUM_SCALAR >* >& aggregates() const;
213 
214  /**
215  * Returns the set of PRMReferenceSlot<GUM_SCALAR> of this
216  * Class<GUM_SCALAR>.
217  * @return Returns the set of PRMReferenceSlot<GUM_SCALAR> of this
218  * Class<GUM_SCALAR>.
219  */
220  const Set< PRMReferenceSlot< GUM_SCALAR >* >& referenceSlots() const;
221 
222  /**
223  * Returns the set of PRMSlotChain<GUM_SCALAR> of this Class<GUM_SCALAR>.
224  * @return Returns the set of PRMSlotChain<GUM_SCALAR> of this
225  * Class<GUM_SCALAR>.
226  */
227  const Set< PRMSlotChain< GUM_SCALAR >* >& slotChains() const;
228 
229  /// @}
230  // ========================================================================
231  /// @name Inheritance methods
232  // ========================================================================
233  /// @{
234 
235  /**
236  * @brief Test if this Class<GUM_SCALAR> is a subclass of cec.
237  *
238  * If cec is a Class<GUM_SCALAR> then this Class<GUM_SCALAR> is a subclass
239  *of cec if they are
240  * equal or there exists a superclass of this Class<GUM_SCALAR> which is
241  *equal to cec.
242  *
243  * If cec is an PRMInterface<GUM_SCALAR> then this Class<GUM_SCALAR> is a
244  *subclass of cec if it
245  * implements cec or if there exists a superclass of this
246  *Class<GUM_SCALAR> which
247  * implements cec.
248  *
249  * @param cec The PRMClassElementContainer<GUM_SCALAR> for which we
250  *determine
251  *if this
252  * Class<GUM_SCALAR> is a subclass of it.
253  * @return Returns true if this Class<GUM_SCALAR> is a subclass of cec.
254  */
255  virtual bool
256  isSubTypeOf(const PRMClassElementContainer< GUM_SCALAR >& cec) const;
257 
258  /**
259  * @brief Returns the super Class<GUM_SCALAR> of this Class<GUM_SCALAR>.
260  * @return Returns the super Class<GUM_SCALAR> of this Class<GUM_SCALAR>.
261  * @throw NotFound Raised if this has no super Class<GUM_SCALAR>.
262  */
263  const PRMClass< GUM_SCALAR >& super() const;
264 
265  /**
266  * @brief Returns the Set of PRMInterface<GUM_SCALAR> implemented by this
267  * Class<GUM_SCALAR>.
268  * @return Returns the Set of PRMInterface<GUM_SCALAR> implemented by this
269  * Class<GUM_SCALAR>.
270  * @throw NotFound Raised if this Class<GUM_SCALAR> doesn't implement any
271  * PRMInterface<GUM_SCALAR>.
272  */
273  const Set< PRMInterface< GUM_SCALAR >* >& implements() const;
274 
275  /// Returns the set of Class@<GUM_SCALAR@> which are direct
276  /// sub-Class@<GUM_SCALAR@> of this Class@<GUM_SCALAR@>.
277  const Set< PRMClass< GUM_SCALAR >* >& extensions() const;
278 
279  /// @}
280  // ========================================================================
281  /// @name Getters & setters operators
282  // ========================================================================
283  /// @{
284 
285  /// See
286  /// gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).
288 
289  /// See
290  /// gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).
291  const PRMClassElement< GUM_SCALAR >& operator[](NodeId id) const;
292 
293  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const
294  /// std::string&).
296 
297  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const
298  /// std::string&).
299  const PRMClassElement< GUM_SCALAR >&
300  operator[](const std::string& name) const;
301 
302  /// @}
303 
304  /// @name For custom inheritance
305  /// @{
306  void inheritReferenceSlots();
307  void inheritParameters();
308  void inheritAttributes();
309  void inheritAggregates();
310  void inheritSlotChains();
311  void initializeInheritance();
312  void completeInheritance(const std::string& attr);
313  /// @}
314 
315  protected:
316  /// returns a constant reference over this interface's dag.
317  virtual const DAG& dag_() const;
318 
319  /// Returns a non constant reference over this PRMInterface<GUM_SCALAR>'s
320  /// DAG.
321  virtual DAG& dag_();
322 
323  /// Fills set with all the subtypes of this Class<GUM_SCALAR>.
325 
326  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>(const
327  /// PRMClassElement<GUM_SCALAR>&).
328  void updateDescendants_(const PRMClassElement< GUM_SCALAR >& elt);
329 
330  private:
331  /// Proceed with the copy of c in this.
332  // void copyClass__<GUM_SCALAR>(const Class<GUM_SCALAR>& c);
333 
334  // ========================================================================
335  /// @name Graphical model members
336  // ========================================================================
337  /// @{
338 
339  /// The dag representing dependencies between formal attributes and
340  /// slots.
342 
343  /// Mapping between node's id and their name (being an attribute or a
344  /// slot). Used for fast access to a member given it's node id.
346 
347  /// @}
348  // ========================================================================
349  /// @name PRMClassElement<GUM_SCALAR> members
350  // ========================================================================
351  /// @{
352 
353  /// Mapping between a member's name and itself.
354  /// Used for fast access to a member given it's name
356 
357  /// The sequence of PRMAttribute<GUM_SCALAR>s.
359 
360  /// The sequence of PRMReferenceSlot<GUM_SCALAR>.
362 
363  /// The sequence of aggregate.
365 
366  /// The set of gum::PRMSlotChain<GUM_SCALAR>s
368 
369  /// The Set of parameters in this Class<GUM_SCALAR>.
371 
372  /// Recursively adds cast descendant of attr in this Class<GUM_SCALAR>.
373  void addCastDescendants__(PRMClassElement< GUM_SCALAR >* attr);
374 
375  /// Recursively adds cast descendant from start to end in this
376  /// Class<GUM_SCALAR>.
377  void addCastDescendants__(PRMAttribute< GUM_SCALAR >* start,
378  PRMAttribute< GUM_SCALAR >* end);
379 
380  /// @}
381  // ========================================================================
382  /// @name Inheritance members
383  // ========================================================================
384  /// @{
385 
386  /// @brief The alternate PRMClassElementContainer<GUM_SCALAR> searched for
387  /// elements defined in
388  /// this.
389  /// Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.
390  PRMClass< GUM_SCALAR >* superClass__;
391 
392  /// The Set of implemented interface of this.
394 
395  /// The set of Class<GUM_SCALAR> which are extension of this
396  /// Class<GUM_SCALAR> (i.e. direct subtypes).
398 
399  /// The bijection between variables in super and variables in this
400  /// The bijection's firsts are attributes in this and its seconds are
401  /// attributes in c.
403 
404  /// a dummy member used to fix a compilation issue in clang4
406 
407 
408  /// Proceed with the copy when this inherits c.
409  void inheritClass__(const PRMClass< GUM_SCALAR >& c);
410 
411  /// Proceed with the implementation of interfaces
412  void implementInterfaces__(bool delayInheritance);
413 
414  /// Check that a given element respects all the class interfaces
415  void checkInterfaces__(PRMClassElement< GUM_SCALAR >* elt);
416 
417  /// Check that a given element respects a specific interface
418  void checkInterface__(PRMClassElement< GUM_SCALAR >* elt,
419  PRMInterface< GUM_SCALAR >* i);
420 
421  /// Check that a given element respects all the class interfaces
422  void checkRefInterfaces__(PRMReferenceSlot< GUM_SCALAR >* elt);
423 
424  /// Check that a given element respects a specific interface
425  void checkRefInterface__(PRMReferenceSlot< GUM_SCALAR >* elt,
426  PRMInterface< GUM_SCALAR >* i);
427 
428  /// Check if elt is present in an implementation. If it is, its IO flags
429  /// are updated.
430  void addIOInterfaceFlags__(PRMClassElement< GUM_SCALAR >* elt);
431 
432  /// This method is called when a sub-Class@<GUM_SCALAR@> of this
433  /// Class@<GUM_SCALAR@> is created.
434  /// @param c The Class@<GUM_SCALAR@> added as a direct
435  /// sub-Class@<GUM_SCALAR@>
436  /// of this.
437  /// @throw DuplicateElement Raised if c is already a
438  /// sub-Class@<GUM_SCALAR@>
439  /// of this.
440  void addExtension__(PRMClass< GUM_SCALAR >* c);
441 
442  /// Return true of overloaded can be overload by overloader.
443  bool
444  checkOverloadLegality__(const PRMClassElement< GUM_SCALAR >* overloaded,
445  const PRMClassElement< GUM_SCALAR >* overloader);
446 
447  /// Overloads an attribute.
448  void overloadAttribute__(PRMAttribute< GUM_SCALAR >* overloader,
449  PRMAttribute< GUM_SCALAR >* overloaded);
450 
451  /// Overloads an aggregate.
452  void overloadAggregate__(PRMAggregate< GUM_SCALAR >* overloader,
453  PRMClassElement< GUM_SCALAR >* overloaded);
454 
455  /// Overloads a reference slot.
456  void overloadReference__(PRMReferenceSlot< GUM_SCALAR >* overloader,
457  PRMReferenceSlot< GUM_SCALAR >* overloaded);
458 
459  /// Overloads a parameter.
460  void overloadParameter__(PRMParameter< GUM_SCALAR >* overloader,
461  PRMParameter< GUM_SCALAR >* overloaded);
462 
463  /// @}
464  };
465 
466 
467 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
468  extern template class PRMClass< double >;
469 #endif
470 
471 
472  } /* namespace prm */
473 
474 } // namespace gum
475 
476 #include <agrum/PRM/elements/PRMClass_tpl.h>
477 
478 
479 namespace gum {
480 
481  namespace prm {} /* namespace prm */
482 
483 } // namespace gum
484 
485 
486 #endif /* GUM_CLASS_H */
void checkInterface__(PRMClassElement< GUM_SCALAR > *elt, PRMInterface< GUM_SCALAR > *i)
Check that a given element respects a specific interface.
Definition: PRMClass_tpl.h:549
virtual NodeId add(PRMClassElement< GUM_SCALAR > *elt)
See gum::prm::add(PRMClassElement<GUM_SCALAR>*).
Definition: PRMClass_tpl.h:629
const Set< PRMInterface< GUM_SCALAR > *> & implements() const
Returns the Set of PRMInterface<GUM_SCALAR> implemented by this Class<GUM_SCALAR>.
const PRMClassElement< GUM_SCALAR > & get(const std::string &name) const
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
virtual DAG & dag_()
Returns a non constant reference over this PRMInterface<GUM_SCALAR>&#39;s DAG.
void addIOInterfaceFlags__(PRMClassElement< GUM_SCALAR > *elt)
Check if elt is present in an implementation. If it is, its IO flags are updated. ...
Definition: PRMClass_tpl.h:987
void overloadParameter__(PRMParameter< GUM_SCALAR > *overloader, PRMParameter< GUM_SCALAR > *overloaded)
Overloads a parameter.
Definition: PRMClass_tpl.h:939
virtual const DAG & dag_() const
returns a constant reference over this interface&#39;s dag.
PRMClass< GUM_SCALAR > & operator=(const PRMClass< GUM_SCALAR > &&source)=delete
Move operator. Don&#39;t use it.
void checkRefInterface__(PRMReferenceSlot< GUM_SCALAR > *elt, PRMInterface< GUM_SCALAR > *i)
Check that a given element respects a specific interface.
Definition: PRMClass_tpl.h:603
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:669
PRMClass(const PRMClass< GUM_SCALAR > &&source)=delete
Move constructor.
const Set< PRMSlotChain< GUM_SCALAR > *> & slotChains() const
Returns the set of PRMSlotChain<GUM_SCALAR> of this Class<GUM_SCALAR>.
PRMClassElement< GUM_SCALAR > & operator[](NodeId id)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).
bool isCastDescendant(const std::string &safe_name) const
Return true if the attribute named safe_name is a cast descendant.
PRMClass(const PRMClass< GUM_SCALAR > &source)=delete
Copy constructor.
void completeInheritance(const std::string &attr)
Definition: PRMClass_tpl.h:295
bool checkOverloadLegality__(const PRMClassElement< GUM_SCALAR > *overloaded, const PRMClassElement< GUM_SCALAR > *overloader)
Return true of overloaded can be overload by overloader.
PRMClass(const std::string &name, PRMClass< GUM_SCALAR > &super, const Set< PRMInterface< GUM_SCALAR > * > &set, bool delayInheritance=false)
Constructor for building a subclass of super and implementing each interface in set.
Definition: PRMClass_tpl.h:74
DAG dag__
The dag representing dependencies between formal attributes and slots.
Definition: PRMClass.h:341
const Set< PRMClass< GUM_SCALAR > *> & extensions() const
Returns the set of Class<GUM_SCALAR> which are direct sub-Class<GUM_SCALAR> of this Class<GUM_SCALAR>...
void checkInterfaces__(PRMClassElement< GUM_SCALAR > *elt)
Check that a given element respects all the class interfaces.
Definition: PRMClass_tpl.h:536
void addCastDescendants__(PRMAttribute< GUM_SCALAR > *start, PRMAttribute< GUM_SCALAR > *end)
Recursively adds cast descendant from start to end in this Class<GUM_SCALAR>.
Definition: PRMClass_tpl.h:952
void inheritClass__(const PRMClass< GUM_SCALAR > &c)
Proceed with the copy when this inherits c.
Definition: PRMClass_tpl.h:318
const PRMClassElement< GUM_SCALAR > & operator[](const std::string &name) const
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const std::string&).
void implementInterfaces__(bool delayInheritance)
Proceed with the implementation of interfaces.
Definition: PRMClass_tpl.h:101
void checkRefInterfaces__(PRMReferenceSlot< GUM_SCALAR > *elt)
Check that a given element respects all the class interfaces.
Definition: PRMClass_tpl.h:591
void initializeInheritance()
Definition: PRMClass_tpl.h:132
void overloadReference__(PRMReferenceSlot< GUM_SCALAR > *overloader, PRMReferenceSlot< GUM_SCALAR > *overloaded)
Overloads a reference slot.
Definition: PRMClass_tpl.h:843
void updateDescendants_(const PRMClassElement< GUM_SCALAR > &elt)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>(const PRMClassElement<GUM_SCALAR>&).
PRMClass(const std::string &name)
Default constructor.
Definition: PRMClass_tpl.h:39
PRMClassElement< GUM_SCALAR > & get(NodeId id)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
virtual void addArc(const std::string &tail, const std::string &head)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::addArc().
Definition: PRMClass_tpl.h:490
ParamScopeData(const std::string &s, const PRMReferenceSlot< GUM_SCALAR > &ref, Idx d)
virtual NodeId overload(PRMClassElement< GUM_SCALAR > *elt)
See gum::prm::overload(PRMClassElement<GUM_SCALAR>*).
Definition: PRMClass_tpl.h:741
void addExtension__(PRMClass< GUM_SCALAR > *c)
This method is called when a sub-Class<GUM_SCALAR> of this Class<GUM_SCALAR> is created.
const PRMClassElement< GUM_SCALAR > & operator[](NodeId id) const
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).
virtual bool isSubTypeOf(const PRMClassElementContainer< GUM_SCALAR > &cec) const
Test if this Class<GUM_SCALAR> is a subclass of cec.
Definition: PRMClass_tpl.h:452
const Set< PRMReferenceSlot< GUM_SCALAR > *> & referenceSlots() const
Returns the set of PRMAggregate of this Class<GUM_SCALAR>.
virtual PRMObject::prm_type obj_type() const
Implementation of pure virtual method of PRMObject.
virtual bool isOutputNode(const PRMClassElement< GUM_SCALAR > &elt) const
Returns true if elt is an output node.
const PRMClassElement< GUM_SCALAR > & get(NodeId id) const
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
void addCastDescendants__(PRMClassElement< GUM_SCALAR > *attr)
Recursively adds cast descendant of attr in this Class<GUM_SCALAR>.
Definition: PRMClass_tpl.h:703
PRMClassElement< GUM_SCALAR > & get(const std::string &name)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
void inheritReferenceSlots()
Definition: PRMClass_tpl.h:151
Bijection< const DiscreteVariable *, const DiscreteVariable *> * bijection__
The bijection between variables in super and variables in this The bijection&#39;s firsts are attributes ...
Definition: PRMClass.h:402
PRMClass(const std::string &name, const Set< PRMInterface< GUM_SCALAR > * > &set, bool delayInheritance=false)
Constructor for building a Class<GUM_SCALAR> implementing several each interface in set...
Definition: PRMClass_tpl.h:61
PRMClass< GUM_SCALAR > & operator=(const PRMClass< GUM_SCALAR > &source)=delete
Copy operator. Don&#39;t use it.
virtual ~PRMClass()
Destructor.
Definition: PRMClass_tpl.h:119
const PRMClass< GUM_SCALAR > & super() const
Returns the super Class<GUM_SCALAR> of this Class<GUM_SCALAR>.
void overloadAggregate__(PRMAggregate< GUM_SCALAR > *overloader, PRMClassElement< GUM_SCALAR > *overloaded)
Overloads an aggregate.
PRMClassElement< GUM_SCALAR > & operator[](const std::string &name)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const std::string&).
void findAllSubtypes_(Set< PRMClassElementContainer< GUM_SCALAR > * > &set)
Fills set with all the subtypes of this Class<GUM_SCALAR>.
Definition: PRMClass_tpl.h:978
Set< PRMClass< GUM_SCALAR > *> extensions__
The set of Class<GUM_SCALAR> which are extension of this Class<GUM_SCALAR> (i.e. direct subtypes)...
Definition: PRMClass.h:397
void overloadAttribute__(PRMAttribute< GUM_SCALAR > *overloader, PRMAttribute< GUM_SCALAR > *overloaded)
Overloads an attribute.
Definition: PRMClass_tpl.h:816
Set< PRMInterface< GUM_SCALAR > *> * implements__
The Set of implemented interface of this.
Definition: PRMClass.h:393
PRMClass(const std::string &name, PRMClass< GUM_SCALAR > &super, bool delayInheritance=false)
Constructor for building a subclass of super.
Definition: PRMClass_tpl.h:46
PRMClass< GUM_SCALAR > * superClass__
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this...
Definition: PRMClass.h:390