aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
PRMClass.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright (c) 2005-2021 by 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) = delete;
121 
122  /// Move operator. Don't use it.
123  PRMClass< GUM_SCALAR >& operator=(const PRMClass< GUM_SCALAR >&& source) = delete;
124 
125  /// Destructor.
126  virtual ~PRMClass();
127 
128  /// Implementation of pure virtual method of PRMObject.
129  virtual PRMObject::prm_type obj_type() const;
130  /// @}
131  // ========================================================================
132  /// @name Graphical operator
133  // ========================================================================
134  /// @{
135 
136  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
138 
139  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
140  const PRMClassElement< GUM_SCALAR >& get(NodeId id) const;
141 
142  /// @}
143  // ========================================================================
144  /// @name PRMClassElement<GUM_SCALAR> getters and setters
145  // ========================================================================
146  /// @{
147 
148  /**
149  * @brief Returns true if elt is an output node.
150  * @param elt A node of this class.
151  * @return Returns true if elt is an output node.
152  */
153  virtual bool isOutputNode(const PRMClassElement< GUM_SCALAR >& elt) const;
154 
155  /**
156  * @brief Return true if the attribute named safe_name is a cast
157  * descendant.
158  * Cast descendant are automatically added PRMAttribute<GUM_SCALAR> for
159  * type
160  * casting.
161  * @param safe_name The safe name of an PRMAttribute<GUM_SCALAR> of this
162  * class.
163  * @return true if safe_name is a cast descendant.
164  * @throw NotFound Raised if safe_name does not name an
165  * PRMAttribute<GUM_SCALAR> in this Class<GUM_SCALAR>.
166  */
167  bool isCastDescendant(const std::string& safe_name) const;
168 
169  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const
170  /// std::string&).
172 
173  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const
174  /// std::string&).
175  const PRMClassElement< GUM_SCALAR >& get(const std::string& name) const;
176 
177  /// See gum::prm::add(PRMClassElement<GUM_SCALAR>*).
178  virtual NodeId add(PRMClassElement< GUM_SCALAR >* elt);
179 
180  /// See gum::prm::overload(PRMClassElement<GUM_SCALAR>*).
182 
183  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::addArc().
184  virtual void addArc(const std::string& tail, const std::string& head);
185 
186  /**
187  * Returns the set of PRMAttribute<GUM_SCALAR> of this Class<GUM_SCALAR>.
188  * @return Returns the set of PRMAttribute<GUM_SCALAR> of this
189  * Class<GUM_SCALAR>.
190  */
191  const Set< PRMAttribute< GUM_SCALAR >* >& attributes() const;
192 
193  /**
194  * Returns the set of parameters of this Class<GUM_SCALAR>.
195  * @return Returns the set of parameters of this Class<GUM_SCALAR>.
196  */
197  const Set< PRMParameter< GUM_SCALAR >* >& parameters() const;
198 
199  /**
200  * Returns all the parameters in the scope of this class.
201  * &return all the parameters in the scope of this class.
202  */
203  HashTable< std::string, const PRMParameter< GUM_SCALAR >* > scope() const;
204 
205  /**
206  * Returns the set of PRMAggregate<GUM_SCALAR> of this Class<GUM_SCALAR>.
207  * @return Returns the set of PRMAggregate<GUM_SCALAR> of this
208  * Class<GUM_SCALAR>.
209  */
210  const Set< PRMAggregate< GUM_SCALAR >* >& aggregates() const;
211 
212  /**
213  * Returns the set of PRMReferenceSlot<GUM_SCALAR> of this
214  * Class<GUM_SCALAR>.
215  * @return Returns the set of PRMReferenceSlot<GUM_SCALAR> of this
216  * Class<GUM_SCALAR>.
217  */
218  const Set< PRMReferenceSlot< GUM_SCALAR >* >& referenceSlots() const;
219 
220  /**
221  * Returns the set of PRMSlotChain<GUM_SCALAR> of this Class<GUM_SCALAR>.
222  * @return Returns the set of PRMSlotChain<GUM_SCALAR> of this
223  * Class<GUM_SCALAR>.
224  */
225  const Set< PRMSlotChain< GUM_SCALAR >* >& slotChains() const;
226 
227  /// @}
228  // ========================================================================
229  /// @name Inheritance methods
230  // ========================================================================
231  /// @{
232 
233  /**
234  * @brief Test if this Class<GUM_SCALAR> is a subclass of cec.
235  *
236  * If cec is a Class<GUM_SCALAR> then this Class<GUM_SCALAR> is a subclass
237  *of cec if they are
238  * equal or there exists a superclass of this Class<GUM_SCALAR> which is
239  *equal to cec.
240  *
241  * If cec is an PRMInterface<GUM_SCALAR> then this Class<GUM_SCALAR> is a
242  *subclass of cec if it
243  * implements cec or if there exists a superclass of this
244  *Class<GUM_SCALAR> which
245  * implements cec.
246  *
247  * @param cec The PRMClassElementContainer<GUM_SCALAR> for which we
248  *determine
249  *if this
250  * Class<GUM_SCALAR> is a subclass of it.
251  * @return Returns true if this Class<GUM_SCALAR> is a subclass of cec.
252  */
253  virtual bool isSubTypeOf(const PRMClassElementContainer< GUM_SCALAR >& cec) const;
254 
255  /**
256  * @brief Returns the super Class<GUM_SCALAR> of this Class<GUM_SCALAR>.
257  * @return Returns the super Class<GUM_SCALAR> of this Class<GUM_SCALAR>.
258  * @throw NotFound Raised if this has no super Class<GUM_SCALAR>.
259  */
260  const PRMClass< GUM_SCALAR >& super() const;
261 
262  /**
263  * @brief Returns the Set of PRMInterface<GUM_SCALAR> implemented by this
264  * Class<GUM_SCALAR>.
265  * @return Returns the Set of PRMInterface<GUM_SCALAR> implemented by this
266  * Class<GUM_SCALAR>.
267  * @throw NotFound Raised if this Class<GUM_SCALAR> doesn't implement any
268  * PRMInterface<GUM_SCALAR>.
269  */
270  const Set< PRMInterface< GUM_SCALAR >* >& implements() const;
271 
272  /// Returns the set of Class@<GUM_SCALAR@> which are direct
273  /// sub-Class@<GUM_SCALAR@> of this Class@<GUM_SCALAR@>.
274  const Set< PRMClass< GUM_SCALAR >* >& extensions() const;
275 
276  /// @}
277  // ========================================================================
278  /// @name Getters & setters operators
279  // ========================================================================
280  /// @{
281 
282  /// See
283  /// gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).
285 
286  /// See
287  /// gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).
288  const PRMClassElement< GUM_SCALAR >& operator[](NodeId id) const;
289 
290  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const
291  /// std::string&).
293 
294  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const
295  /// std::string&).
296  const PRMClassElement< GUM_SCALAR >& operator[](const std::string& name) const;
297 
298  /// @}
299 
300  /// @name For custom inheritance
301  /// @{
302  void inheritReferenceSlots();
303  void inheritParameters();
304  void inheritAttributes();
305  void inheritAggregates();
306  void inheritSlotChains();
307  void initializeInheritance();
308  void completeInheritance(const std::string& attr);
309  /// @}
310 
311  protected:
312  /// returns a constant reference over this interface's dag.
313  virtual const DAG& dag_() const;
314 
315  /// Returns a non constant reference over this PRMInterface<GUM_SCALAR>'s
316  /// DAG.
317  virtual DAG& dag_();
318 
319  /// Fills set with all the subtypes of this Class<GUM_SCALAR>.
321 
322  /// See gum::prm::PRMClassElementContainer<GUM_SCALAR>(const
323  /// PRMClassElement<GUM_SCALAR>&).
324  void updateDescendants_(const PRMClassElement< GUM_SCALAR >& elt);
325 
326  private:
327  /// Proceed with the copy of c in this.
328  // void _copyClass_<GUM_SCALAR>(const Class<GUM_SCALAR>& c);
329 
330  // ========================================================================
331  /// @name Graphical model members
332  // ========================================================================
333  /// @{
334 
335  /// The dag representing dependencies between formal attributes and
336  /// slots.
338 
339  /// Mapping between node's id and their name (being an attribute or a
340  /// slot). Used for fast access to a member given it's node id.
342 
343  /// @}
344  // ========================================================================
345  /// @name PRMClassElement<GUM_SCALAR> members
346  // ========================================================================
347  /// @{
348 
349  /// Mapping between a member's name and itself.
350  /// Used for fast access to a member given it's name
352 
353  /// The sequence of PRMAttribute<GUM_SCALAR>s.
355 
356  /// The sequence of PRMReferenceSlot<GUM_SCALAR>.
358 
359  /// The sequence of aggregate.
361 
362  /// The set of gum::PRMSlotChain<GUM_SCALAR>s
364 
365  /// The Set of parameters in this Class<GUM_SCALAR>.
367 
368  /// Recursively adds cast descendant of attr in this Class<GUM_SCALAR>.
369  void _addCastDescendants_(PRMClassElement< GUM_SCALAR >* attr);
370 
371  /// Recursively adds cast descendant from start to end in this
372  /// Class<GUM_SCALAR>.
373  void _addCastDescendants_(PRMAttribute< GUM_SCALAR >* start, PRMAttribute< GUM_SCALAR >* end);
374 
375  /// @}
376  // ========================================================================
377  /// @name Inheritance members
378  // ========================================================================
379  /// @{
380 
381  /// @brief The alternate PRMClassElementContainer<GUM_SCALAR> searched for
382  /// elements defined in
383  /// this.
384  /// Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.
385  PRMClass< GUM_SCALAR >* _superClass_;
386 
387  /// The Set of implemented interface of this.
389 
390  /// The set of Class<GUM_SCALAR> which are extension of this
391  /// Class<GUM_SCALAR> (i.e. direct subtypes).
393 
394  /// The bijection between variables in super and variables in this
395  /// The bijection's firsts are attributes in this and its seconds are
396  /// attributes in c.
398 
399  /// a dummy member used to fix a compilation issue in clang4
401 
402 
403  /// Proceed with the copy when this inherits c.
404  void _inheritClass_(const PRMClass< GUM_SCALAR >& c);
405 
406  /// Proceed with the implementation of interfaces
407  void _implementInterfaces_(bool delayInheritance);
408 
409  /// Check that a given element respects all the class interfaces
410  void _checkInterfaces_(PRMClassElement< GUM_SCALAR >* elt);
411 
412  /// Check that a given element respects a specific interface
413  void _checkInterface_(PRMClassElement< GUM_SCALAR >* elt, PRMInterface< GUM_SCALAR >* i);
414 
415  /// Check that a given element respects all the class interfaces
416  void _checkRefInterfaces_(PRMReferenceSlot< GUM_SCALAR >* elt);
417 
418  /// Check that a given element respects a specific interface
419  void _checkRefInterface_(PRMReferenceSlot< GUM_SCALAR >* elt, PRMInterface< GUM_SCALAR >* i);
420 
421  /// Check if elt is present in an implementation. If it is, its IO flags
422  /// are updated.
423  void _addIOInterfaceFlags_(PRMClassElement< GUM_SCALAR >* elt);
424 
425  /// This method is called when a sub-Class@<GUM_SCALAR@> of this
426  /// Class@<GUM_SCALAR@> is created.
427  /// @param c The Class@<GUM_SCALAR@> added as a direct
428  /// sub-Class@<GUM_SCALAR@>
429  /// of this.
430  /// @throw DuplicateElement Raised if c is already a
431  /// sub-Class@<GUM_SCALAR@>
432  /// of this.
433  void _addExtension_(PRMClass< GUM_SCALAR >* c);
434 
435  /// Return true of overloaded can be overload by overloader.
436  bool _checkOverloadLegality_(const PRMClassElement< GUM_SCALAR >* overloaded,
437  const PRMClassElement< GUM_SCALAR >* overloader);
438 
439  /// Overloads an attribute.
440  void _overloadAttribute_(PRMAttribute< GUM_SCALAR >* overloader,
441  PRMAttribute< GUM_SCALAR >* overloaded);
442 
443  /// Overloads an aggregate.
444  void _overloadAggregate_(PRMAggregate< GUM_SCALAR >* overloader,
445  PRMClassElement< GUM_SCALAR >* overloaded);
446 
447  /// Overloads a reference slot.
448  void _overloadReference_(PRMReferenceSlot< GUM_SCALAR >* overloader,
449  PRMReferenceSlot< GUM_SCALAR >* overloaded);
450 
451  /// Overloads a parameter.
452  void _overloadParameter_(PRMParameter< GUM_SCALAR >* overloader,
453  PRMParameter< GUM_SCALAR >* overloaded);
454 
455  /// @}
456  };
457 
458 
459 #ifndef GUM_NO_EXTERN_TEMPLATE_CLASS
460  extern template class PRMClass< double >;
461 #endif
462 
463 
464  } /* namespace prm */
465 
466 } // namespace gum
467 
468 #include <agrum/PRM/elements/PRMClass_tpl.h>
469 
470 
471 namespace gum {
472 
473  namespace prm {} /* namespace prm */
474 
475 } // namespace gum
476 
477 
478 #endif /* GUM_CLASS_H */
virtual NodeId add(PRMClassElement< GUM_SCALAR > *elt)
See gum::prm::add(PRMClassElement<GUM_SCALAR>*).
Definition: PRMClass_tpl.h:593
void _addCastDescendants_(PRMClassElement< GUM_SCALAR > *attr)
Recursively adds cast descendant of attr in this Class<GUM_SCALAR>.
Definition: PRMClass_tpl.h:666
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.
Definition: PRMClass_tpl.h:974
virtual const DAG & dag_() const
returns a constant reference over this interface&#39;s dag.
Definition: PRMClass_tpl.h:969
void _checkRefInterface_(PRMReferenceSlot< GUM_SCALAR > *elt, PRMInterface< GUM_SCALAR > *i)
Check that a given element respects a specific interface.
Definition: PRMClass_tpl.h:569
PRMClass< GUM_SCALAR > & operator=(const PRMClass< GUM_SCALAR > &&source)=delete
Move operator. Don&#39;t use it.
void _inheritClass_(const PRMClass< GUM_SCALAR > &c)
Proceed with the copy when this inherits c.
Definition: PRMClass_tpl.h:299
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:643
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:898
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:278
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:72
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:507
void _overloadParameter_(PRMParameter< GUM_SCALAR > *overloader, PRMParameter< GUM_SCALAR > *overloaded)
Overloads a parameter.
Definition: PRMClass_tpl.h:886
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:98
bool _checkOverloadLegality_(const PRMClassElement< GUM_SCALAR > *overloaded, const PRMClassElement< GUM_SCALAR > *overloader)
Return true of overloaded can be overload by overloader.
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:932
void _addExtension_(PRMClass< GUM_SCALAR > *c)
This method is called when a sub-Class<GUM_SCALAR> of this Class<GUM_SCALAR> is created.
void _checkRefInterfaces_(PRMReferenceSlot< GUM_SCALAR > *elt)
Check that a given element respects all the class interfaces.
Definition: PRMClass_tpl.h:558
void initializeInheritance()
Definition: PRMClass_tpl.h:128
Set< PRMInterface< GUM_SCALAR > *> * _implements_
The Set of implemented interface of this.
Definition: PRMClass.h:388
void updateDescendants_(const PRMClassElement< GUM_SCALAR > &elt)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>(const PRMClassElement<GUM_SCALAR>&).
Definition: PRMClass_tpl.h:954
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).
Definition: PRMClass_tpl.h:979
virtual void addArc(const std::string &tail, const std::string &head)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::addArc().
Definition: PRMClass_tpl.h:464
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:397
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:703
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:428
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.
Definition: PRMClass_tpl.h:964
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).
Definition: PRMClass_tpl.h:988
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:392
void _checkInterface_(PRMClassElement< GUM_SCALAR > *elt, PRMInterface< GUM_SCALAR > *i)
Check that a given element respects a specific interface.
Definition: PRMClass_tpl.h:518
void _overloadAggregate_(PRMAggregate< GUM_SCALAR > *overloader, PRMClassElement< GUM_SCALAR > *overloaded)
Overloads an aggregate.
PRMClassElement< GUM_SCALAR > & get(const std::string &name)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
Definition: PRMClass_tpl.h:997
void _overloadReference_(PRMReferenceSlot< GUM_SCALAR > *overloader, PRMReferenceSlot< GUM_SCALAR > *overloaded)
Overloads a reference slot.
Definition: PRMClass_tpl.h:791
void inheritReferenceSlots()
Definition: PRMClass_tpl.h:146
void _overloadAttribute_(PRMAttribute< GUM_SCALAR > *overloader, PRMAttribute< GUM_SCALAR > *overloaded)
Overloads an attribute.
Definition: PRMClass_tpl.h:765
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:60
PRMClass< GUM_SCALAR > & operator=(const PRMClass< GUM_SCALAR > &source)=delete
Copy operator. Don&#39;t use it.
virtual ~PRMClass()
Destructor.
Definition: PRMClass_tpl.h:115
const PRMClass< GUM_SCALAR > & super() const
Returns the super Class<GUM_SCALAR> of this Class<GUM_SCALAR>.
PRMClassElement< GUM_SCALAR > & operator[](const std::string &name)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const std::string&).
DAG _dag_
The dag representing dependencies between formal attributes and slots.
Definition: PRMClass.h:337
void findAllSubtypes_(Set< PRMClassElementContainer< GUM_SCALAR > * > &set)
Fills set with all the subtypes of this Class<GUM_SCALAR>.
Definition: PRMClass_tpl.h:923
PRMClass< GUM_SCALAR > * _superClass_
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this...
Definition: PRMClass.h:385
PRMClass(const std::string &name, PRMClass< GUM_SCALAR > &super, bool delayInheritance=false)
Constructor for building a subclass of super.
Definition: PRMClass_tpl.h:46