aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
gum::prm::PRMInterface< GUM_SCALAR > Class Template Reference

An PRMInterface is implemented by a Class<GUM_SCALAR> and defines a set of PRMReferenceSlot<GUM_SCALAR> and PRMAttribute<GUM_SCALAR> which the implementing Class<GUM_SCALAR> must contain. More...

#include <PRMInterface.h>

Inheritance diagram for gum::prm::PRMInterface< GUM_SCALAR >:
Collaboration diagram for gum::prm::PRMInterface< GUM_SCALAR >:

Public Member Functions

Constructor & destructor.
 PRMInterface (const std::string &name)
 Default constructor.
 PRMInterface (const std::string &name, PRMInterface< GUM_SCALAR > &super, bool delayInheritance=false)
 Constructor for building a subclass of super.
 PRMInterface (const PRMInterface< GUM_SCALAR > &source)
 Copy constructor.
virtual ~PRMInterface ()
 Destructor.
Graphical model getters and setters
virtual PRMObject::prm_type obj_type () const
 Implementation of pure virtual method of PRMObject.
virtual PRMClassElement< GUM_SCALAR > & get (NodeId id)
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
virtual const PRMClassElement< GUM_SCALAR > & get (NodeId id) const
 Se gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
void addArc (const std::string &tail, const std::string &head)
 An Interfance doesn't have any arc, this will raise an OperationNotAllowed exception.
PRMClassElement<GUM_SCALAR> getters and setters
virtual bool isOutputNode (const PRMClassElement< GUM_SCALAR > &elt) const
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
virtual PRMClassElement< GUM_SCALAR > & get (const std::string &name)
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
virtual const PRMClassElement< GUM_SCALAR > & get (const std::string &name) const
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
const Set< PRMAttribute< GUM_SCALAR > * > & attributes () const
 Returns the set of PRMAttribute<GUM_SCALAR> of this Class<GUM_SCALAR>.
const Set< PRMReferenceSlot< GUM_SCALAR > * > & referenceSlots () const
 Returns the set of PRMAggregate of this Class<GUM_SCALAR>.
NodeId add (PRMClassElement< GUM_SCALAR > *elt)
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::add(PRMClassElement<GUM_SCALAR>*).
NodeId overload (PRMClassElement< GUM_SCALAR > *elt)
 Add a new PRMClassElement<GUM_SCALAR> which overload an inherited PRMClassElement<GUM_SCALAR>.
Inheritance methods
virtual bool isSubTypeOf (const PRMClassElementContainer< GUM_SCALAR > &cec) const
 Test if this PRMInterface is a sub PRMInterface of cec.
PRMInterface< GUM_SCALAR > & super ()
 Returns the superInterface of this PRMInterface.
const PRMInterface< GUM_SCALAR > & super () const
 Returns the superInterface of this PRMInterface.
Set< PRMClass< GUM_SCALAR > * > & implementations ()
 Returns the set of Class<GUM_SCALAR> implementing this PRMInterface.
const Set< PRMClass< GUM_SCALAR > * > & implementations () const
 Returns the set of Class<GUM_SCALAR> implementing this PRMInterface.
void inheritInterface ()
 Inherits from this interface super interface, this should only be done when this inteface inheritance was delayed.
Getters & setters operators
PRMClassElement< GUM_SCALAR > & operator[] (NodeId id)
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).
const PRMClassElement< GUM_SCALAR > & operator[] (NodeId id) const
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).
PRMClassElement< GUM_SCALAR > & operator[] (const std::string &name)
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const std::string&).
const PRMClassElement< GUM_SCALAR > & operator[] (const std::string &name) const
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const std::string&).
Getters on the gum::PRMClassElement<GUM_SCALAR>.
virtual bool belongsTo (const PRMClassElement< GUM_SCALAR > &elt) const
 Returns true if elt belongs to this PRMClassElementContainer.
virtual bool exists (const std::string &name) const
 Returns true if a member with the given name exists in this PRMClassElementContainer or in the PRMClassElementContainer hierarchy.
virtual bool isInputNode (const PRMClassElement< GUM_SCALAR > &elt) const
 Returns true if the node is an input node.
virtual void setInputNode (const PRMClassElement< GUM_SCALAR > &elt, bool b)
 Set the input flag value of id at b.
virtual void setOutputNode (const PRMClassElement< GUM_SCALAR > &elt, bool b)
 Set the output flag value of id at b.
virtual bool isInnerNode (const PRMClassElement< GUM_SCALAR > &elt) const
 Returns true if the node is an inner node.
Graphical operator
virtual bool exists (NodeId id) const
 Returns true if a member with the given id exists in this PRMClassElementContainer or in the PRMClassElementContainer hierarchy.
virtual const DAGcontainerDag () const
 Returns the gum::DAG of this PRMClassElementContainer.
Inheritance getters and setters
virtual bool isSuperTypeOf (const PRMClassElementContainer< GUM_SCALAR > &cec) const
 Test if this PRMClassElementContainer is a super type of cec.
Getters & setters.
const std::string & name () const
 Returns the name of this object.
void name (const std::string &name)
 Change the name of the PRM Object.
Operators
bool operator== (const PRMObject &obj) const
 To PRMObject are equal if they have the same name (which is unique).
bool operator!= (const PRMObject &obj) const
 To PRMObject are equal if they have the same name (which is unique).

Protected Member Functions

const DAGdag_ () const
 Returns a constant reference over this PRMInterface's DAG.
DAGdag_ ()
 Returns a non constant reference over this PRMInterface's DAG.
void findAllSubtypes_ (Set< PRMClassElementContainer< GUM_SCALAR > * > &set)
 Fills set with all the subtypes of this PRMInterface, this includes extensions and implementations.
void updateDescendants_ (const PRMClassElement< GUM_SCALAR > &elt)
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>(const PRMClassElement<GUM_SCALAR>&).
virtual std::pair< bool, bool > & getIOFlag_ (const PRMClassElement< GUM_SCALAR > &elt)
 Returns the IO flags of a PRMClassElement<GUM_SCALAR>.
virtual const std::pair< bool, bool > & getIOFlag_ (const PRMClassElement< GUM_SCALAR > &elt) const
 Returns the IO flags of a PRMClassElement<GUM_SCALAR>.
virtual void setIOFlag_ (const PRMClassElement< GUM_SCALAR > &elt, const std::pair< bool, bool > &flags)
 Defines the IO flags of a PRMClassElement<GUM_SCALAR>.
virtual void copyIOFlags_ (const PRMClassElementContainer< GUM_SCALAR > &c)
 Copy the IO Flags of c in this PRMClassElementContainer.

Private Member Functions

PRMInterface< GUM_SCALAR > & operator= (const PRMInterface< GUM_SCALAR > &source)
 Copy operator. Don't use it.
void _inheritInterface_ (const PRMInterface< GUM_SCALAR > &i)
 Proceed with the copy of i in this.

Private Attributes

HashTable< std::string, std::pair< bool, bool > > _IOFlags_
 input / output flags, useful when inheriting or copying.
Graphical model members
DAG _dag_
 The dag representing dependencies between formal attributes and slots.
NodeProperty< PRMClassElement< GUM_SCALAR > * > _nodeIdMap_
 Mapping between node's id and their name (being an attribute or a slot). Used for fast access to a member given it's node id.
PRMClassElement<GUM_SCALAR> members
HashTable< std::string, PRMClassElement< GUM_SCALAR > * > _nameMap_
 Mapping between a member's name and itself. Used for fast access to a member given it's name.
Set< PRMAttribute< GUM_SCALAR > * > _attributes_
 The sequence of PRMAttribute<GUM_SCALAR>s.
Set< PRMReferenceSlot< GUM_SCALAR > * > _referenceSlots_
 The sequence of PRMReferenceSlot<GUM_SCALAR>.
Private members.
std::string _name_

Friends

class PRMClass< GUM_SCALAR >

Iterators

using ClassEltIterator = typename NodeProperty< PRMClassElement< GUM_SCALAR >* >::iterator
using const_ClassEltIterator
ClassEltIterator begin ()
const ClassEltIteratorend ()
const_ClassEltIterator begin () const
const const_ClassEltIteratorend () const

Built-in types.

enum class  prm_type : char {
  ALL , CLASS , PRM_INTERFACE , CLASS_ELT ,
  TYPE , SYSTEM , INSTANCE
}
 Enumeration of the different types of objects handled by a PRM. More...
static std::string LEFT_CAST ()
 Enumeration of the different types of objects handled by a PRM.
static std::string RIGHT_CAST ()
 Enumeration of the different types of objects handled by a PRM.
static std::string enum2str (prm_type type)
 Returns the string representation of a PRMObject.
static INLINE bool isClass (const PRMObject &obj)
 Returns true if obj_ptr is of type Class.
static INLINE bool isInterface (const PRMObject &obj)
 Returns true if obj_ptr is of type PRMInterface.
static INLINE bool isInstance (const PRMObject &obj)
 Returns true if obj_ptr is of type PRMInstance.

Inheritance members

PRMInterface< GUM_SCALAR > * _superInterface_
 The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this. Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.
Set< PRMClass< GUM_SCALAR > * > _implementations_
 The set of Class<GUM_SCALAR> which implements this PRMInterface.
Set< PRMInterface< GUM_SCALAR > * > _extensions_
 The set of Class<GUM_SCALAR> which implements this PRMInterface.
void _addImplementation_ (PRMClass< GUM_SCALAR > *c)
 Add an Class<GUM_SCALAR> to the set of Class<GUM_SCALAR> which implements this PRMInterface.
void _addExtension_ (PRMInterface< GUM_SCALAR > *c)
 Add an Class<GUM_SCALAR> to the set of Class<GUM_SCALAR> which implements this PRMInterface.
bool _checkOverloadLegality_ (const PRMClassElement< GUM_SCALAR > *overloaded, const PRMClassElement< GUM_SCALAR > *overloader)
 The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this. Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.
void _overloadAttribute_ (PRMAttribute< GUM_SCALAR > *overloader, PRMAttribute< GUM_SCALAR > *overloaded)
 The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this. Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.
void _overloadReferenceSlot_ (PRMReferenceSlot< GUM_SCALAR > *overloader, PRMReferenceSlot< GUM_SCALAR > *overloaded)
 The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this. Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.
void _addCastDescendants_ (PRMAttribute< GUM_SCALAR > *start, PRMAttribute< GUM_SCALAR > *end)
 The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this. Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.

Detailed Description

template<typename GUM_SCALAR>
class gum::prm::PRMInterface< GUM_SCALAR >

An PRMInterface is implemented by a Class<GUM_SCALAR> and defines a set of PRMReferenceSlot<GUM_SCALAR> and PRMAttribute<GUM_SCALAR> which the implementing Class<GUM_SCALAR> must contain.

See also
PRM Class<GUM_SCALAR> PRMClassElement<GUM_SCALAR>

Definition at line 80 of file PRMInterface.h.

Member Typedef Documentation

◆ ClassEltIterator

template<typename GUM_SCALAR>
using gum::prm::PRMInterface< GUM_SCALAR >::ClassEltIterator = typename NodeProperty< PRMClassElement< GUM_SCALAR >* >::iterator

Definition at line 295 of file PRMInterface.h.

◆ const_ClassEltIterator

template<typename GUM_SCALAR>
using gum::prm::PRMInterface< GUM_SCALAR >::const_ClassEltIterator
Initial value:
HashTable< NodeId, VAL > NodeProperty
Property on graph elements.

Definition at line 299 of file PRMInterface.h.

Member Enumeration Documentation

◆ prm_type

enum class gum::prm::PRMObject::prm_type : char
stronginherited

Enumeration of the different types of objects handled by a PRM.

The "all" type is used to tell that we want any kind of PRMType (useful with iterators for example). No PRMObject will ever have "all" as type.

Enumerator
ALL 
CLASS 
PRM_INTERFACE 
CLASS_ELT 
TYPE 
SYSTEM 
INSTANCE 

Definition at line 88 of file PRMObject.h.

88: char { ALL, CLASS, PRM_INTERFACE, CLASS_ELT, TYPE, SYSTEM, INSTANCE };

Constructor & Destructor Documentation

◆ PRMInterface() [1/3]

template<typename GUM_SCALAR>
gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface ( const std::string & name)
explicit

Default constructor.

Parameters
nameThe interface name.

Definition at line 56 of file PRMInterface_tpl.h.

56 :
59 }
PRMClassElementContainer(const std::string &name)
Default constructor.
An PRMInterface is implemented by a Class<GUM_SCALAR> and defines a set of PRMReferenceSlot<GUM_SCALA...
PRMInterface(const std::string &name)
Default constructor.
PRMInterface< GUM_SCALAR > * _superInterface_
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this....
const std::string & name() const
Returns the name of this object.

References gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), PRMInterface(), _superInterface_, and gum::prm::PRMObject::name().

Referenced by PRMInterface(), PRMInterface(), PRMInterface(), ~PRMInterface(), _addExtension_(), _inheritInterface_(), _overloadAttribute_(), operator=(), super(), and super().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PRMInterface() [2/3]

template<typename GUM_SCALAR>
gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface ( const std::string & name,
PRMInterface< GUM_SCALAR > & super,
bool delayInheritance = false )

Constructor for building a subclass of super.

Parameters
nameThe sub-interface name.
superThe super PRMInterface of this.
delayInheritanceIf true, inheritance will be delayed.

Definition at line 62 of file PRMInterface_tpl.h.

64 :
68 }
void _inheritInterface_(const PRMInterface< GUM_SCALAR > &i)
Proceed with the copy of i in this.
PRMInterface< GUM_SCALAR > & super()
Returns the superInterface of this PRMInterface.

References gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), PRMInterface(), _inheritInterface_(), _superInterface_, gum::prm::PRMObject::name(), and super().

Here is the call graph for this function:

◆ PRMInterface() [3/3]

template<typename GUM_SCALAR>
gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface ( const PRMInterface< GUM_SCALAR > & source)

Copy constructor.

Definition at line 71 of file PRMInterface_tpl.h.

71 :
75 GUM_ERROR(FatalError, "don't copy an interface")
76 }
DAG _dag_
The dag representing dependencies between formal attributes and slots.
#define GUM_ERROR(type, msg)
Definition exceptions.h:72

References gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), PRMInterface(), _dag_, _superInterface_, GUM_ERROR, and gum::prm::PRMObject::name().

Here is the call graph for this function:

◆ ~PRMInterface()

template<typename GUM_SCALAR>
gum::prm::PRMInterface< GUM_SCALAR >::~PRMInterface ( )
virtual

Destructor.

Definition at line 79 of file PRMInterface_tpl.h.

79 {
81
82 for (const auto& elt: _nodeIdMap_) {
83 delete elt.second;
84 }
85 }
NodeProperty< PRMClassElement< GUM_SCALAR > * > _nodeIdMap_
Mapping between node's id and their name (being an attribute or a slot). Used for fast access to a me...

References PRMInterface(), and _nodeIdMap_.

Here is the call graph for this function:

Member Function Documentation

◆ _addCastDescendants_()

template<typename GUM_SCALAR>
void gum::prm::PRMInterface< GUM_SCALAR >::_addCastDescendants_ ( PRMAttribute< GUM_SCALAR > * start,
PRMAttribute< GUM_SCALAR > * end )
private

The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this. Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.

Definition at line 251 of file PRMInterface_tpl.h.

252 {
255
256 while (parent->type().superType() != end->type()) {
257 child = parent->getCastDescendant();
258 child->setId(nextNodeId());
259 _dag_.addNodeWithId(child->id());
260 _nodeIdMap_.insert(child->id(), child);
261 // Only use child's safe name when adding to the name map!
262 _nameMap_.insert(child->safeName(), child);
263 _attributes_.insert(child);
264 // Do ! use Class<GUM_SCALAR>::insertArc(), child's CPF is already
265 // initialized properly
266 parent = child;
267 }
268
269 parent->setAsCastDescendant(end);
270 }
Set< PRMAttribute< GUM_SCALAR > * > _attributes_
The sequence of PRMAttribute<GUM_SCALAR>s.
HashTable< std::string, PRMClassElement< GUM_SCALAR > * > _nameMap_
Mapping between a member's name and itself. Used for fast access to a member given it's name.
const ClassEltIterator & end()

References end().

Here is the call graph for this function:

◆ _addExtension_()

template<typename GUM_SCALAR>
INLINE void gum::prm::PRMInterface< GUM_SCALAR >::_addExtension_ ( PRMInterface< GUM_SCALAR > * c)
private

Add an Class<GUM_SCALAR> to the set of Class<GUM_SCALAR> which implements this PRMInterface.

Definition at line 378 of file PRMInterface_tpl.h.

378 {
379 _extensions_.insert(i);
380 }
Set< PRMInterface< GUM_SCALAR > * > _extensions_
The set of Class<GUM_SCALAR> which implements this PRMInterface.

References PRMInterface(), and _extensions_.

Here is the call graph for this function:

◆ _addImplementation_()

template<typename GUM_SCALAR>
INLINE void gum::prm::PRMInterface< GUM_SCALAR >::_addImplementation_ ( PRMClass< GUM_SCALAR > * c)
private

Add an Class<GUM_SCALAR> to the set of Class<GUM_SCALAR> which implements this PRMInterface.

Definition at line 373 of file PRMInterface_tpl.h.

373 {
374 _implementations_.insert(c);
375 }
Set< PRMClass< GUM_SCALAR > * > _implementations_
The set of Class<GUM_SCALAR> which implements this PRMInterface.

References _implementations_, and PRMClass< GUM_SCALAR >.

Here is the call graph for this function:

◆ _checkOverloadLegality_()

template<typename GUM_SCALAR>
bool gum::prm::PRMInterface< GUM_SCALAR >::_checkOverloadLegality_ ( const PRMClassElement< GUM_SCALAR > * overloaded,
const PRMClassElement< GUM_SCALAR > * overloader )
private

The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this. Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.

Definition at line 273 of file PRMInterface_tpl.h.

275 {
276 if (overloaded->elt_type() != overloader->elt_type()) { return false; }
277
279 if (!overloader->type().isSubTypeOf(overloaded->type())) { return false; }
280 } else if (overloaded->elt_type() == PRMClassElement< GUM_SCALAR >::prm_refslot) {
281 auto ref_overloader = static_cast< const PRMReferenceSlot< GUM_SCALAR >* >(overloader);
282 auto ref_overloaded = static_cast< const PRMReferenceSlot< GUM_SCALAR >* >(overloaded);
283 if (!ref_overloader->slotType().isSubTypeOf(ref_overloaded->slotType())) { return false; }
284 } else {
285 return false;
286 }
287 return true;
288 }
virtual bool isSubTypeOf(const PRMClassElementContainer< GUM_SCALAR > &cec) const
Test if this PRMInterface is a sub PRMInterface of cec.

◆ _inheritInterface_()

template<typename GUM_SCALAR>
void gum::prm::PRMInterface< GUM_SCALAR >::_inheritInterface_ ( const PRMInterface< GUM_SCALAR > & i)
private

Proceed with the copy of i in this.

Definition at line 93 of file PRMInterface_tpl.h.

93 {
94 // Copying attributes
95 for (const auto i_attr: i._attributes_) {
97 attr->setId(i_attr->id());
98 _nodeIdMap_.insert(attr->id(), attr);
99 _attributes_.insert(attr);
100
101 if (i._nameMap_[i_attr->name()] == i._nameMap_[i_attr->safeName()]) {
102 _nameMap_.insert(attr->name(), attr);
103 }
104
105 _nameMap_.insert(attr->safeName(), attr);
106 _dag_.addNodeWithId(attr->id());
107 }
108
109 // Copying reference slots
110 for (const auto i_ref: i._referenceSlots_) {
112 i_ref->name(),
113 const_cast< PRMClassElementContainer< GUM_SCALAR >& >(i_ref->slotType()),
114 i_ref->isArray());
115
116 ref->setId(i_ref->id());
117 _nodeIdMap_.insert(ref->id(), ref);
118 _referenceSlots_.insert(ref);
119
120 if (i._nameMap_.exists(ref->name())) { _nameMap_.insert(ref->name(), ref); }
121
122 _nameMap_.insert(ref->safeName(), ref);
123 _dag_.addNodeWithId(ref->id());
124 }
125 }
Set< PRMReferenceSlot< GUM_SCALAR > * > _referenceSlots_
The sequence of PRMReferenceSlot<GUM_SCALAR>.

References PRMInterface().

Referenced by PRMInterface(), and inheritInterface().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _overloadAttribute_()

template<typename GUM_SCALAR>
void gum::prm::PRMInterface< GUM_SCALAR >::_overloadAttribute_ ( PRMAttribute< GUM_SCALAR > * overloader,
PRMAttribute< GUM_SCALAR > * overloaded )
private

The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this. Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.

Definition at line 209 of file PRMInterface_tpl.h.

210 {
211 if (overloader->type() != overloaded->type()) {
212 overloader->setId(nextNodeId());
213 _dag_.addNodeWithId(overloader->id());
214 _nodeIdMap_.insert(overloader->id(), overloader);
216 _nameMap_.insert(overloader->safeName(), overloader);
217 _attributes_.insert(overloader);
219 } else {
220 overloader->setId(overloaded->id());
223 _nameMap_[overloader->safeName()] = overloader;
225 _attributes_.insert(overloader);
226 // Swapping types, ugly but necessary to preserve the
227 // PRMType<GUM_SCALAR>
228 // pointer of overloaded
230 delete overloaded;
231 }
232 }
void _addCastDescendants_(PRMAttribute< GUM_SCALAR > *start, PRMAttribute< GUM_SCALAR > *end)
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this....
NodeId overload(PRMClassElement< GUM_SCALAR > *elt)
Add a new PRMClassElement<GUM_SCALAR> which overload an inherited PRMClassElement<GUM_SCALAR>.

References PRMInterface(), and _overloadAttribute_().

Referenced by _overloadAttribute_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _overloadReferenceSlot_()

template<typename GUM_SCALAR>
void gum::prm::PRMInterface< GUM_SCALAR >::_overloadReferenceSlot_ ( PRMReferenceSlot< GUM_SCALAR > * overloader,
PRMReferenceSlot< GUM_SCALAR > * overloaded )
private

The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this. Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.

Definition at line 235 of file PRMInterface_tpl.h.

237 {
238 // Adding overloading reference
239 overloader->setId(overloaded->id());
242 _nameMap_.insert(overloader->safeName(), overloader);
244 // Removing overloaded PRMReferenceSlot<GUM_SCALAR>
246 _nameMap_.erase(overloaded->safeName());
247 delete overloaded;
248 }

References _nameMap_, _nodeIdMap_, gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::prm::PRMObject::name(), and gum::prm::PRMClassElement< GUM_SCALAR >::setId().

Here is the call graph for this function:

◆ add()

template<typename GUM_SCALAR>
NodeId gum::prm::PRMInterface< GUM_SCALAR >::add ( PRMClassElement< GUM_SCALAR > * elt)
virtual

See gum::prm::PRMClassElementContainer<GUM_SCALAR>::add(PRMClassElement<GUM_SCALAR>*).

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 128 of file PRMInterface_tpl.h.

128 {
129 if (_nameMap_.exists(elt->name())) {
131 "name '" << elt->name() << "' is already used by another ClassElement");
132 }
133
136 _nameMap_.insert(attr->name(), attr);
137
138 while (true) {
139 attr->setId(nextNodeId());
140 _dag_.addNodeWithId(attr->id());
141 _nodeIdMap_.insert(attr->id(), attr);
142 _nameMap_.insert(attr->safeName(), attr);
143 _attributes_.insert(attr);
144
145 if (attr->type().isSubType()) {
146 attr = attr->getCastDescendant();
147 } else {
148 break;
149 }
150 }
152 elt->setId(nextNodeId());
153 _dag_.addNodeWithId(elt->id());
154 _nodeIdMap_.insert(elt->id(), elt);
155 _referenceSlots_.insert(static_cast< PRMReferenceSlot< GUM_SCALAR >* >(elt));
156 _nameMap_.insert(elt->name(), elt);
157 _nameMap_.insert(elt->safeName(), elt);
158 } else {
159 GUM_ERROR(WrongClassElement, "illegal ClassElement<GUM_SCALAR> for an Interface")
160 }
161
162 return elt->id();
163 }

References _nameMap_, GUM_ERROR, gum::prm::PRMClassElement< GUM_SCALAR >::isAttribute(), and gum::prm::PRMObject::name().

Here is the call graph for this function:

◆ addArc()

template<typename GUM_SCALAR>
INLINE void gum::prm::PRMInterface< GUM_SCALAR >::addArc ( const std::string & tail,
const std::string & head )
virtual

An Interfance doesn't have any arc, this will raise an OperationNotAllowed exception.

Parameters
tailThe tail of the added arc.
headThe head of the added arc.
Exceptions
OperationNotAllowedSystematically throws an OperationNotAllowed.

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 355 of file PRMInterface_tpl.h.

356 {
357 GUM_ERROR(OperationNotAllowed, "an Interface does ! have arcs")
358 }

References GUM_ERROR.

◆ attributes()

template<typename GUM_SCALAR>
INLINE const Set< PRMAttribute< GUM_SCALAR > * > & gum::prm::PRMInterface< GUM_SCALAR >::attributes ( ) const

Returns the set of PRMAttribute<GUM_SCALAR> of this Class<GUM_SCALAR>.

Returns
Returns the set of PRMAttribute<GUM_SCALAR> of this Class<GUM_SCALAR>.

Definition at line 459 of file PRMInterface_tpl.h.

459 {
460 return _attributes_;
461 }

References _attributes_.

◆ begin() [1/2]

template<typename GUM_SCALAR>
INLINE PRMInterface< GUM_SCALAR >::ClassEltIterator gum::prm::PRMInterface< GUM_SCALAR >::begin ( )

Definition at line 332 of file PRMInterface_tpl.h.

332 {
333 return _nodeIdMap_.begin();
334 }

References _nodeIdMap_.

◆ begin() [2/2]

template<typename GUM_SCALAR>
INLINE PRMInterface< GUM_SCALAR >::const_ClassEltIterator gum::prm::PRMInterface< GUM_SCALAR >::begin ( ) const

Definition at line 344 of file PRMInterface_tpl.h.

344 {
345 return _nodeIdMap_.begin();
346 }

References _nodeIdMap_.

◆ belongsTo()

template<typename GUM_SCALAR>
INLINE bool gum::prm::PRMClassElementContainer< GUM_SCALAR >::belongsTo ( const PRMClassElement< GUM_SCALAR > & elt) const
virtualinherited

Returns true if elt belongs to this PRMClassElementContainer.

Parameters
eltA PRMClassElement<GUM_SCALAR>.
Returns
true if elt beglons to this PRMClassElementContainer.

Definition at line 190 of file PRMClassElementContainer_tpl.h.

191 {
192 try {
193 return &elt == &(get(elt.safeName()));
194 } catch (NotFound const&) { return false; }
195 }
<agrum/PRM/classElementContainer.h>
virtual PRMClassElement< GUM_SCALAR > & get(const std::string &name)=0
Getter on a member of this PRMClassElementContainer.

References get(), and gum::prm::PRMClassElement< GUM_SCALAR >::safeName().

Here is the call graph for this function:

◆ containerDag()

template<typename GUM_SCALAR>
INLINE const DAG & gum::prm::PRMClassElementContainer< GUM_SCALAR >::containerDag ( ) const
virtualinherited

Returns the gum::DAG of this PRMClassElementContainer.

Be very careful when using NodeId with PRMClassElement<GUM_SCALAR>: there is no guarantee that an inherited PRMClassElement<GUM_SCALAR> will have the same NodeId than its superclass counterpart.

When dealing with different classes and interfaces ALWAYS use safe-name as identifier.

Returns
the DAG of this PRMClassElementContainer.

Definition at line 198 of file PRMClassElementContainer_tpl.h.

198 {
199 return dag_();
200 }
virtual const DAG & dag_() const =0

References dag_().

Referenced by gum::prm::ClassDependencyGraph< GUM_SCALAR >::_addArcs_(), gum::prm::ClassBayesNet< GUM_SCALAR >::_init_(), gum::prm::SVE< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::SVED< GUM_SCALAR >::_initLiftedNodes_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadReference_(), gum::prm::PRMFactory< GUM_SCALAR >::addAttribute(), gum::prm::PRMClass< GUM_SCALAR >::completeInheritance(), exists(), and gum::prm::PRMClassElementContainer< double >::isInputNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ copyIOFlags_()

template<typename GUM_SCALAR>
void gum::prm::PRMClassElementContainer< GUM_SCALAR >::copyIOFlags_ ( const PRMClassElementContainer< GUM_SCALAR > & c)
protectedvirtualinherited

Copy the IO Flags of c in this PRMClassElementContainer.

Parameters
cA PRMClassElementContainer.

Definition at line 57 of file PRMClassElementContainer_tpl.h.

58 {
59 for (const auto& flag: c._IOFlags_)
60 setIOFlag_(get(flag.first), flag.second);
61 }
HashTable< std::string, std::pair< bool, bool > > _IOFlags_
input / output flags, useful when inheriting or copying.
virtual void setIOFlag_(const PRMClassElement< GUM_SCALAR > &elt, const std::pair< bool, bool > &flags)
Defines the IO flags of a PRMClassElement<GUM_SCALAR>.

References PRMClassElementContainer(), _IOFlags_, get(), and setIOFlag_().

Here is the call graph for this function:

◆ dag_() [1/2]

template<typename GUM_SCALAR>
INLINE DAG & gum::prm::PRMInterface< GUM_SCALAR >::dag_ ( )
protectedvirtual

Returns a non constant reference over this PRMInterface's DAG.

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 416 of file PRMInterface_tpl.h.

416 {
417 return _dag_;
418 }

References _dag_.

◆ dag_() [2/2]

template<typename GUM_SCALAR>
INLINE const DAG & gum::prm::PRMInterface< GUM_SCALAR >::dag_ ( ) const
protectedvirtual

Returns a constant reference over this PRMInterface's DAG.

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 411 of file PRMInterface_tpl.h.

411 {
412 return _dag_;
413 }

References _dag_.

◆ end() [1/2]

template<typename GUM_SCALAR>
INLINE const PRMInterface< GUM_SCALAR >::ClassEltIterator & gum::prm::PRMInterface< GUM_SCALAR >::end ( )

Definition at line 338 of file PRMInterface_tpl.h.

338 {
339 return _nodeIdMap_.end();
340 }

References _nodeIdMap_.

Referenced by _addCastDescendants_().

Here is the caller graph for this function:

◆ end() [2/2]

template<typename GUM_SCALAR>
INLINE const PRMInterface< GUM_SCALAR >::const_ClassEltIterator & gum::prm::PRMInterface< GUM_SCALAR >::end ( ) const

Definition at line 350 of file PRMInterface_tpl.h.

350 {
351 return _nodeIdMap_.end();
352 }

References _nodeIdMap_.

◆ enum2str()

std::string gum::prm::PRMObject::enum2str ( prm_type type)
inlinestaticinherited

Returns the string representation of a PRMObject.

Definition at line 95 of file PRMObject.h.

95 {
96 switch (type) {
97 case prm_type::CLASS : return "PRMType::CLASS";
98
99 case prm_type::CLASS_ELT : return "PRMType::CLASS_ELT";
100
101 case prm_type::TYPE : return "PRMType::TYPE";
102
103 case prm_type::SYSTEM : return "PRMType::SYSTEM";
104
105 case prm_type::INSTANCE : return "PRMType::INSTANCE";
106
107 case prm_type::PRM_INTERFACE : return "PRMType::PRM_INTERFACE";
108
109 default : return "unknown";
110 }
111 }

References CLASS, CLASS_ELT, INSTANCE, PRM_INTERFACE, SYSTEM, and TYPE.

Referenced by gum::prm::operator<<().

Here is the caller graph for this function:

◆ exists() [1/2]

template<typename GUM_SCALAR>
INLINE bool gum::prm::PRMClassElementContainer< GUM_SCALAR >::exists ( const std::string & name) const
virtualinherited

Returns true if a member with the given name exists in this PRMClassElementContainer or in the PRMClassElementContainer hierarchy.

Definition at line 182 of file PRMClassElementContainer_tpl.h.

182 {
183 try {
184 get(name);
185 return true;
186 } catch (NotFound const&) { return false; }
187 }

References get(), and gum::prm::PRMObject::name().

Referenced by gum::prm::PRMClass< GUM_SCALAR >::_checkInterface_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkLocalParent_(), gum::prm::o3prm::O3SystemFactory< GUM_SCALAR >::_checkParameters_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkSlotChainLink_(), gum::prm::PRMFactory< GUM_SCALAR >::addNoisyOrCompound(), gum::prm::PRMFactory< GUM_SCALAR >::continueAggregator(), gum::prm::PRMFactory< GUM_SCALAR >::continueAttribute(), gum::prm::PRMClass< GUM_SCALAR >::overload(), gum::prm::PRMInterface< GUM_SCALAR >::overload(), setInputNode(), setOutputNode(), and gum::prm::PRMFactory< GUM_SCALAR >::startAttribute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exists() [2/2]

template<typename GUM_SCALAR>
INLINE bool gum::prm::PRMClassElementContainer< GUM_SCALAR >::exists ( NodeId id) const
virtualinherited

Returns true if a member with the given id exists in this PRMClassElementContainer or in the PRMClassElementContainer hierarchy.

Parameters
idA NodeId.
Returns
true if id matches a PRMClassElement<GUM_SCALAR>.

Definition at line 177 of file PRMClassElementContainer_tpl.h.

177 {
178 return containerDag().exists(id);
179 }
bool exists(const NodeId id) const
alias for existsNode
virtual const DAG & containerDag() const
Returns the gum::DAG of this PRMClassElementContainer.

References containerDag().

Here is the call graph for this function:

◆ findAllSubtypes_()

template<typename GUM_SCALAR>
void gum::prm::PRMInterface< GUM_SCALAR >::findAllSubtypes_ ( Set< PRMClassElementContainer< GUM_SCALAR > * > & set)
protectedvirtual

Fills set with all the subtypes of this PRMInterface, this includes extensions and implementations.

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 481 of file PRMInterface_tpl.h.

482 {
483 for (const auto impl: _implementations_) {
484 set.insert(impl);
486 }
487
488 for (const auto ext: _extensions_) {
489 set.insert(ext);
491 }
492 }
void findAllSubtypes_(Set< PRMClassElementContainer< GUM_SCALAR > * > &set)
Fills set with all the subtypes of this PRMInterface, this includes extensions and implementations.

References gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), _extensions_, and _implementations_.

Here is the call graph for this function:

◆ get() [1/4]

template<typename GUM_SCALAR>
INLINE PRMClassElement< GUM_SCALAR > & gum::prm::PRMInterface< GUM_SCALAR >::get ( const std::string & name)
virtual

See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 439 of file PRMInterface_tpl.h.

439 {
440 try {
441 return *(_nameMap_[name]);
442 } catch (NotFound const&) {
443 GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> with the given name")
444 }
445 }

References _nameMap_, GUM_ERROR, and gum::prm::PRMObject::name().

Here is the call graph for this function:

◆ get() [2/4]

template<typename GUM_SCALAR>
INLINE const PRMClassElement< GUM_SCALAR > & gum::prm::PRMInterface< GUM_SCALAR >::get ( const std::string & name) const
virtual

See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 449 of file PRMInterface_tpl.h.

449 {
450 try {
451 return *(_nameMap_[name]);
452 } catch (NotFound const&) {
453 GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> with the given name")
454 }
455 }

References _nameMap_, GUM_ERROR, and gum::prm::PRMObject::name().

Here is the call graph for this function:

◆ get() [3/4]

template<typename GUM_SCALAR>
INLINE PRMClassElement< GUM_SCALAR > & gum::prm::PRMInterface< GUM_SCALAR >::get ( NodeId id)
virtual

See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 421 of file PRMInterface_tpl.h.

421 {
422 try {
423 return *(_nodeIdMap_[id]);
424 } catch (NotFound const&) {
425 GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> with the given NodeId")
426 }
427 }

References _nodeIdMap_, and GUM_ERROR.

Referenced by gum::prm::PRMClass< GUM_SCALAR >::_checkInterface_(), gum::prm::PRMClass< GUM_SCALAR >::_checkRefInterface_(), and operator[]().

Here is the caller graph for this function:

◆ get() [4/4]

template<typename GUM_SCALAR>
INLINE const PRMClassElement< GUM_SCALAR > & gum::prm::PRMInterface< GUM_SCALAR >::get ( NodeId id) const
virtual

Se gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 430 of file PRMInterface_tpl.h.

430 {
431 try {
432 return *(_nodeIdMap_[id]);
433 } catch (NotFound const&) {
434 GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> with the given NodeId")
435 }
436 }

References _nodeIdMap_, and GUM_ERROR.

◆ getIOFlag_() [1/2]

template<typename GUM_SCALAR>
INLINE std::pair< bool, bool > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::getIOFlag_ ( const PRMClassElement< GUM_SCALAR > & elt)
protectedvirtualinherited

Returns the IO flags of a PRMClassElement<GUM_SCALAR>.

Parameters
eltThe PRMClassElement<GUM_SCALAR>.
Returns
elt's IO flags.
Exceptions
NotFoundRaised if elt does not have any IO flags.

Definition at line 148 of file PRMClassElementContainer_tpl.h.

149 {
150 try {
151 return _IOFlags_[elt.safeName()];
152 } catch (NotFound const&) {
153 GUM_ERROR(NotFound, "this ClassElement<GUM_SCALAR> does not have any IO flags")
154 }
155 }

References _IOFlags_, GUM_ERROR, and gum::prm::PRMClassElement< GUM_SCALAR >::safeName().

Referenced by gum::prm::PRMClass< GUM_SCALAR >::_addIOInterfaceFlags_(), isInnerNode(), gum::prm::PRMClass< GUM_SCALAR >::isOutputNode(), gum::prm::PRMInterface< GUM_SCALAR >::isOutputNode(), and setOutputNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getIOFlag_() [2/2]

template<typename GUM_SCALAR>
INLINE const std::pair< bool, bool > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::getIOFlag_ ( const PRMClassElement< GUM_SCALAR > & elt) const
protectedvirtualinherited

Returns the IO flags of a PRMClassElement<GUM_SCALAR>.

Parameters
eltThe PRMClassElement<GUM_SCALAR>.
Returns
elt's IO flags.
Exceptions
NotFoundRaised if elt does not have any IO flags.

Definition at line 158 of file PRMClassElementContainer_tpl.h.

159 {
160 try {
161 return _IOFlags_[elt.safeName()];
162 } catch (NotFound const&) {
163 GUM_ERROR(NotFound, "this ClassElement<GUM_SCALAR> does not have any IO flags")
164 }
165 }

References _IOFlags_, GUM_ERROR, and gum::prm::PRMClassElement< GUM_SCALAR >::safeName().

Here is the call graph for this function:

◆ implementations() [1/2]

template<typename GUM_SCALAR>
INLINE Set< PRMClass< GUM_SCALAR > * > & gum::prm::PRMInterface< GUM_SCALAR >::implementations ( )

Returns the set of Class<GUM_SCALAR> implementing this PRMInterface.

Definition at line 470 of file PRMInterface_tpl.h.

470 {
471 return _implementations_;
472 }

References _implementations_.

◆ implementations() [2/2]

template<typename GUM_SCALAR>
INLINE const Set< PRMClass< GUM_SCALAR > * > & gum::prm::PRMInterface< GUM_SCALAR >::implementations ( ) const

Returns the set of Class<GUM_SCALAR> implementing this PRMInterface.

Definition at line 476 of file PRMInterface_tpl.h.

476 {
477 return _implementations_;
478 }

References _implementations_.

◆ inheritInterface()

template<typename GUM_SCALAR>
void gum::prm::PRMInterface< GUM_SCALAR >::inheritInterface ( )

Inherits from this interface super interface, this should only be done when this inteface inheritance was delayed.

Definition at line 88 of file PRMInterface_tpl.h.

88 {
90 }

References _inheritInterface_(), and _superInterface_.

Here is the call graph for this function:

◆ isClass()

INLINE bool gum::prm::PRMObject::isClass ( const PRMObject & obj)
inlinestaticinherited

Returns true if obj_ptr is of type Class.

Definition at line 114 of file PRMObject.h.

114{ return obj.obj_type() == prm_type::CLASS; }

References PRMObject(), CLASS, and obj_type().

Referenced by gum::prm::PRMClass< GUM_SCALAR >::scope(), and gum::prm::PRMFactory< GUM_SCALAR >::startAttribute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInnerNode()

template<typename GUM_SCALAR>
INLINE bool gum::prm::PRMClassElementContainer< GUM_SCALAR >::isInnerNode ( const PRMClassElement< GUM_SCALAR > & elt) const
virtualinherited

Returns true if the node is an inner node.

PRMAttribute or PRMAggregate can either be input, output, both or internal nodes.

By defaut, attributes and aggregates are inner nodes.

Parameters
eltA PRMClassElement<GUM_SCALAR>.
Returns
true if elt is an inner node.
Exceptions
NotFoundRaised if NodeId does'nt match any PRMClassElement<GUM_SCALAR> in this.
WrongClassElementRaised if NodeId is neither an PRMAttribute nor an PRMAggregate.

Definition at line 134 of file PRMClassElementContainer_tpl.h.

135 {
136 try {
137 return !(getIOFlag_(elt).first || getIOFlag_(elt).second);
138 } catch (NotFound const&) { return true; }
139 }
virtual std::pair< bool, bool > & getIOFlag_(const PRMClassElement< GUM_SCALAR > &elt)
Returns the IO flags of a PRMClassElement<GUM_SCALAR>.

References getIOFlag_().

Referenced by gum::prm::SVE< GUM_SCALAR >::_initLiftedNodes_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInputNode()

template<typename GUM_SCALAR>
INLINE bool gum::prm::PRMClassElementContainer< GUM_SCALAR >::isInputNode ( const PRMClassElement< GUM_SCALAR > & elt) const
virtualinherited

Returns true if the node is an input node.

PRMAttribute or PRMAggregate can either be input, output, both or internal nodes.

By defaut, attributes and aggregates are inner nodes.

Parameters
eltA PRMClassElement<GUM_SCALAR>.
Returns
Returns true if id is an input node.

Definition at line 90 of file PRMClassElementContainer_tpl.h.

91 {
92 try {
93 return getIOFlag_(elt).first;
94 } catch (NotFound const&) { return false; }
95 }

◆ isInstance()

INLINE bool gum::prm::PRMObject::isInstance ( const PRMObject & obj)
inlinestaticinherited

Returns true if obj_ptr is of type PRMInstance.

Definition at line 122 of file PRMObject.h.

122 {
123 return obj.obj_type() == prm_type::INSTANCE;
124 }

References PRMObject(), INSTANCE, and obj_type().

Here is the call graph for this function:

◆ isInterface()

INLINE bool gum::prm::PRMObject::isInterface ( const PRMObject & obj)
inlinestaticinherited

Returns true if obj_ptr is of type PRMInterface.

Definition at line 117 of file PRMObject.h.

117 {
118 return obj.obj_type() == prm_type::PRM_INTERFACE;
119 }

References PRMObject(), obj_type(), and PRM_INTERFACE.

Here is the call graph for this function:

◆ isOutputNode()

template<typename GUM_SCALAR>
INLINE bool gum::prm::PRMInterface< GUM_SCALAR >::isOutputNode ( const PRMClassElement< GUM_SCALAR > & elt) const
virtual

See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 496 of file PRMInterface_tpl.h.

496 {
497 try {
498 if (!this->getIOFlag_(elt).second) {
499 for (auto i: _implementations_) {
500 if (i->isOutputNode(elt)) { return true; }
501 }
502
503 if (_superInterface_ && _superInterface_->isOutputNode(elt)) { return true; }
504
505 } else {
506 return true;
507 }
508 } catch (NotFound const&) {}
509 return false;
510 }
virtual bool isOutputNode(const PRMClassElement< GUM_SCALAR > &elt) const
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(conststd::string&).

References _implementations_, _superInterface_, gum::prm::PRMClassElementContainer< GUM_SCALAR >::getIOFlag_(), and isOutputNode().

Referenced by isOutputNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isSubTypeOf()

template<typename GUM_SCALAR>
bool gum::prm::PRMInterface< GUM_SCALAR >::isSubTypeOf ( const PRMClassElementContainer< GUM_SCALAR > & cec) const
virtual

Test if this PRMInterface is a sub PRMInterface of cec.

PRMInterface can not be a sub PRMInterface of a Class<GUM_SCALAR>, so if cec is a Class<GUM_SCALAR> this method will return false.

If cec is an PRMInterface then this PRMInterface is a sub PRMInterface of cec if they are equal or there exists a super PRMInterface of this PRMInterface which is equal to cec.

Parameters
cecThe PRMClassElementContainer<GUM_SCALAR> for which we determine if this PRMInterface is a sub PRMInterface of it.
Returns
Returns true if this Class<GUM_SCALAR> is a subclass of cec.

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 291 of file PRMInterface_tpl.h.

292 {
293 switch (cec.obj_type()) {
295 return false;
296 }
297
299 const PRMInterface* current = this;
300
301 while (current != 0) {
302 if (current == &(cec)) return true;
303
305 }
306
307 return false;
308 }
309
310 default : {
311 GUM_ERROR(FatalError, "unknown ClassElementContainer<GUM_SCALAR>")
312 }
313 }
314 }
virtual PRMObject::prm_type obj_type() const
Implementation of pure virtual method of PRMObject.

References gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), gum::prm::PRMObject::CLASS, and gum::prm::PRMObject::obj_type().

Here is the call graph for this function:

◆ isSuperTypeOf()

template<typename GUM_SCALAR>
INLINE bool gum::prm::PRMClassElementContainer< GUM_SCALAR >::isSuperTypeOf ( const PRMClassElementContainer< GUM_SCALAR > & cec) const
virtualinherited

Test if this PRMClassElementContainer is a super type of cec.

This returns cec.isSubTypeOf(*this).

Parameters
cec
Returns
return true if this PRMClassElementContainer is a super type of cec.

Definition at line 142 of file PRMClassElementContainer_tpl.h.

143 {
144 return cec.isSubTypeOf(*this);
145 }
virtual bool isSubTypeOf(const PRMClassElementContainer< GUM_SCALAR > &cec) const =0
Test if this PRMClassElementContainer is a subtype of cec.

References PRMClassElementContainer(), and isSubTypeOf().

Here is the call graph for this function:

◆ LEFT_CAST()

std::string gum::prm::PRMObject::LEFT_CAST ( )
inlinestaticinherited

Enumeration of the different types of objects handled by a PRM.

The "all" type is used to tell that we want any kind of PRMType (useful with iterators for example). No PRMObject will ever have "all" as type.

Definition at line 90 of file PRMObject.h.

90{ return "("; }

Referenced by gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMReferenceSlot< GUM_SCALAR >::PRMReferenceSlot(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMClassElement< GUM_SCALAR >::cast(), and gum::prm::decomposePath().

Here is the caller graph for this function:

◆ name() [1/2]

INLINE const std::string & gum::prm::PRMObject::name ( ) const
inherited

Returns the name of this object.

Definition at line 54 of file PRMObject_inl.h.

54{ return _name_; }
std::string _name_
Definition PRMObject.h:211

References _name_.

Referenced by gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMAttribute< GUM_SCALAR >::PRMAttribute(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClassElement< GUM_SCALAR >::PRMClassElement(), gum::prm::PRMClassElement< GUM_SCALAR >::PRMClassElement(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMFuncAttribute< GUM_SCALAR >::PRMFuncAttribute(), gum::prm::PRMInstance< GUM_SCALAR >::PRMInstance(), gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface(), gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface(), gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface(), PRMObject(), gum::prm::PRMParameter< GUM_SCALAR >::PRMParameter(), gum::prm::PRMParameter< GUM_SCALAR >::PRMParameter(), gum::prm::PRMReferenceSlot< GUM_SCALAR >::PRMReferenceSlot(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMSlotChain< double >::PRMSlotChain(), gum::prm::PRMSystem< GUM_SCALAR >::PRMSystem(), gum::prm::__print_attribute__(), gum::prm::__print_instance__(), gum::prm::SVE< GUM_SCALAR >::_addDelayedVariable_(), gum::prm::PRMClass< GUM_SCALAR >::_addIOInterfaceFlags_(), gum::prm::PRMFactory< GUM_SCALAR >::_addParent_(), gum::prm::PRMInstance< GUM_SCALAR >::_addReferingInstance_(), gum::prm::PRMClass< GUM_SCALAR >::_checkInterface_(), gum::prm::PRMFactory< GUM_SCALAR >::_checkInterfaceImplementation_(), gum::prm::PRMClass< GUM_SCALAR >::_checkInterfaces_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkRawCPT_(), gum::prm::PRMClass< GUM_SCALAR >::_checkRefInterface_(), gum::prm::PRMClass< GUM_SCALAR >::_checkRefInterfaces_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkRuleCPTSumsTo1_(), gum::prm::PRMInstance< GUM_SCALAR >::_copyAggregates_(), gum::prm::PRMInstance< GUM_SCALAR >::_copyAttribute_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundAgg_(), gum::prm::PRMSystem< double >::_groundAgg_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundRef_(), gum::prm::PRMSystem< double >::_groundTensor_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadAttribute_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadParameter_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadReference_(), gum::prm::PRMInterface< GUM_SCALAR >::_overloadReferenceSlot_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_str_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_str_(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::_str_(), gum::prm::StructuredInference< GUM_SCALAR >::_str_(), gum::prm::StructuredInference< GUM_SCALAR >::_str_(), gum::prm::StructuredInference< GUM_SCALAR >::_str_(), gum::prm::PRMClass< GUM_SCALAR >::add(), gum::prm::PRMInterface< GUM_SCALAR >::add(), gum::prm::PRMSystem< GUM_SCALAR >::add(), gum::prm::PRMFactory< GUM_SCALAR >::addAggregator(), gum::prm::PRMFormAttribute< GUM_SCALAR >::addParent(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::addParent(), gum::prm::PRMClassElement< GUM_SCALAR >::cast(), gum::prm::PRMClass< GUM_SCALAR >::completeInheritance(), gum::prm::PRMFormAttribute< GUM_SCALAR >::copy(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::copy(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::exists(), gum::prm::PRMInstance< GUM_SCALAR >::exists(), gum::prm::PRMSystem< GUM_SCALAR >::exists(), gum::prm::o3prmr::O3prmrInterpreter::findAttributeName(), gum::prm::o3prmr::O3prmrInterpreter::findInstanceName(), gum::prm::PRMClass< GUM_SCALAR >::get(), gum::prm::PRMClass< GUM_SCALAR >::get(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::get(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::get(), gum::prm::PRMInstance< GUM_SCALAR >::get(), gum::prm::PRMInstance< GUM_SCALAR >::get(), gum::prm::PRMInterface< GUM_SCALAR >::get(), gum::prm::PRMInterface< GUM_SCALAR >::get(), gum::prm::PRMSystem< GUM_SCALAR >::get(), gum::prm::PRMSystem< GUM_SCALAR >::get(), gum::prm::PRMSystem< GUM_SCALAR >::getArray(), gum::prm::PRMSystem< GUM_SCALAR >::getArrayType(), gum::prm::PRMSystem< GUM_SCALAR >::getArrayType(), gum::prm::PRMFormAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMSystem< GUM_SCALAR >::groundedBN(), gum::prm::PRMClass< GUM_SCALAR >::inheritAggregates(), gum::prm::PRMSystem< double >::instantiate(), gum::prm::PRMSystem< GUM_SCALAR >::isArray(), gum::prm::PRMClass< GUM_SCALAR >::isCastDescendant(), gum::prm::PRMSystem< GUM_SCALAR >::isInstance(), name(), gum::prm::PRMType::name(), gum::prm::PRMFormAttribute< GUM_SCALAR >::newFactory(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::newFactory(), operator!=(), gum::prm::PRMClass< GUM_SCALAR >::operator=(), operator==(), gum::prm::PRMType::operator==(), gum::prm::PRMClass< GUM_SCALAR >::operator[](), gum::prm::PRMClass< GUM_SCALAR >::operator[](), gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator[](), gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator[](), gum::prm::PRMInterface< GUM_SCALAR >::operator[](), gum::prm::PRMClass< GUM_SCALAR >::overload(), gum::prm::PRMInterface< GUM_SCALAR >::overload(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainterConstIterator, gum::prm::PRMClassElementContainer< GUM_SCALAR >::setInputNode(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::setOutputNode(), gum::prm::PRMFactory< GUM_SCALAR >::startClass(), gum::prm::PRMFactory< GUM_SCALAR >::startInterface(), and gum::prm::PRMFactory< GUM_SCALAR >::startSystem().

◆ name() [2/2]

INLINE void gum::prm::PRMObject::name ( const std::string & name)
inherited

Change the name of the PRM Object.

Warning
Don't do this unless you know what you are doing !

Definition at line 58 of file PRMObject_inl.h.

58{ _name_ = name; }

References _name_, and name().

Here is the call graph for this function:

◆ obj_type()

template<typename GUM_SCALAR>
INLINE PRMObject::prm_type gum::prm::PRMInterface< GUM_SCALAR >::obj_type ( ) const
virtual

Implementation of pure virtual method of PRMObject.

Implements gum::prm::PRMObject.

Definition at line 406 of file PRMInterface_tpl.h.

406 {
408 }

References gum::prm::PRMObject::PRM_INTERFACE.

◆ operator!=()

INLINE bool gum::prm::PRMObject::operator!= ( const PRMObject & obj) const
inherited

To PRMObject are equal if they have the same name (which is unique).

Definition at line 66 of file PRMObject_inl.h.

66{ return _name_ != obj.name(); }

References PRMObject(), _name_, and name().

Here is the call graph for this function:

◆ operator=()

template<typename GUM_SCALAR>
PRMInterface< GUM_SCALAR > & gum::prm::PRMInterface< GUM_SCALAR >::operator= ( const PRMInterface< GUM_SCALAR > & source)
private

Copy operator. Don't use it.

References PRMInterface().

Here is the call graph for this function:

◆ operator==()

INLINE bool gum::prm::PRMObject::operator== ( const PRMObject & obj) const
inherited

To PRMObject are equal if they have the same name (which is unique).

Definition at line 62 of file PRMObject_inl.h.

62{ return _name_ == obj.name(); }

References PRMObject(), _name_, and name().

Here is the call graph for this function:

◆ operator[]() [1/4]

template<typename GUM_SCALAR>
INLINE PRMClassElement< GUM_SCALAR > & gum::prm::PRMInterface< GUM_SCALAR >::operator[] ( const std::string & name)
virtual

See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const std::string&).

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 395 of file PRMInterface_tpl.h.

395 {
396 return get(name);
397 }
virtual PRMClassElement< GUM_SCALAR > & get(NodeId id)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).

◆ operator[]() [2/4]

template<typename GUM_SCALAR>
INLINE const PRMClassElement< GUM_SCALAR > & gum::prm::PRMInterface< GUM_SCALAR >::operator[] ( const std::string & name) const
virtual

See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const std::string&).

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 401 of file PRMInterface_tpl.h.

401 {
402 return get(name);
403 }

References get(), and gum::prm::PRMObject::name().

Here is the call graph for this function:

◆ operator[]() [3/4]

template<typename GUM_SCALAR>
INLINE PRMClassElement< GUM_SCALAR > & gum::prm::PRMInterface< GUM_SCALAR >::operator[] ( NodeId id)
virtual

◆ operator[]() [4/4]

template<typename GUM_SCALAR>
INLINE const PRMClassElement< GUM_SCALAR > & gum::prm::PRMInterface< GUM_SCALAR >::operator[] ( NodeId id) const
virtual

◆ overload()

template<typename GUM_SCALAR>
NodeId gum::prm::PRMInterface< GUM_SCALAR >::overload ( PRMClassElement< GUM_SCALAR > * elt)
virtual

Add a new PRMClassElement<GUM_SCALAR> which overload an inherited PRMClassElement<GUM_SCALAR>.

The pointer is "given" to this class, which will delete it when ~Class<GUM_SCALAR>() is called.

The NodeId of elt is defined when it is added to this, discarding any previous value. There is no garanty that elt will have the same NodeId than the PRMClassElement<GUM_SCALAR> it overloaded.

You can only overload inherited PRMClassElement<GUM_SCALAR> and only if elt is a subtype of the inherited PRMClassElement<GUM_SCALAR>. You do not define dependencies in an PRMInterface so it is useless to overload an PRMAttribute<GUM_SCALAR> with another sharing the same type, and if tried it will raise an OperationNotAllowed exception.

Parameters
eltThe new PRMClassElement<GUM_SCALAR> overloading an inherited PRMClassElement<GUM_SCALAR> in this.
Returns
the NodeId assigned to elt.
Exceptions
NotFoundRaised if no overloaded PRMClassElement<GUM_SCALAR> is found.
OperationNotAllowedRaised if the overloading is impossible.

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 166 of file PRMInterface_tpl.h.

166 {
167 try {
168 if (!super().exists(overloader->name()))
169 GUM_ERROR(OperationNotAllowed, "found no ClassElement<GUM_SCALAR> to overload")
170
171 } catch (NotFound const&) {
172 GUM_ERROR(OperationNotAllowed, "overload is possible only with sub interfaces")
173 }
174
176 if (overloaded == overloader)
177 GUM_ERROR(DuplicateElement, "duplicate ClassElement '" << overloader->name() << "'")
178
180 GUM_ERROR(OperationNotAllowed, "illegal overload")
181
187 break;
188 }
189
194 break;
195 }
196
200 "Element " << overloader->name() << " can not be overloaded")
201 default :
202 GUM_ERROR(FatalError, "Unknown ClassElement<GUM_SCALAR> type for " << overloader->name())
203 }
204
205 return overloader->id();
206 }
virtual bool exists(const std::string &name) const
Returns true if a member with the given name exists in this PRMClassElementContainer or in the PRMCla...
void _overloadReferenceSlot_(PRMReferenceSlot< GUM_SCALAR > *overloader, PRMReferenceSlot< GUM_SCALAR > *overloaded)
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this....
void _overloadAttribute_(PRMAttribute< GUM_SCALAR > *overloader, PRMAttribute< GUM_SCALAR > *overloaded)
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this....
bool _checkOverloadLegality_(const PRMClassElement< GUM_SCALAR > *overloaded, const PRMClassElement< GUM_SCALAR > *overloader)
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this....

References gum::prm::PRMClassElementContainer< GUM_SCALAR >::exists(), GUM_ERROR, gum::prm::PRMObject::name(), and super().

Here is the call graph for this function:

◆ referenceSlots()

template<typename GUM_SCALAR>
INLINE const Set< PRMReferenceSlot< GUM_SCALAR > * > & gum::prm::PRMInterface< GUM_SCALAR >::referenceSlots ( ) const

Returns the set of PRMAggregate of this Class<GUM_SCALAR>.

Returns
Returns the set of PRMAggregate of this Class<GUM_SCALAR>.

Definition at line 465 of file PRMInterface_tpl.h.

465 {
466 return _referenceSlots_;
467 }

References _referenceSlots_.

◆ RIGHT_CAST()

std::string gum::prm::PRMObject::RIGHT_CAST ( )
inlinestaticinherited

Enumeration of the different types of objects handled by a PRM.

The "all" type is used to tell that we want any kind of PRMType (useful with iterators for example). No PRMObject will ever have "all" as type.

Definition at line 92 of file PRMObject.h.

92{ return ")"; }

Referenced by gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMAggregate< GUM_SCALAR >::PRMAggregate(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMReferenceSlot< GUM_SCALAR >::PRMReferenceSlot(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), gum::prm::PRMSlotChain< GUM_SCALAR >::PRMSlotChain(), gum::prm::PRMClassElement< GUM_SCALAR >::cast(), and gum::prm::decomposePath().

Here is the caller graph for this function:

◆ setInputNode()

template<typename GUM_SCALAR>
INLINE void gum::prm::PRMClassElementContainer< GUM_SCALAR >::setInputNode ( const PRMClassElement< GUM_SCALAR > & elt,
bool b )
virtualinherited

Set the input flag value of id at b.

PRMAttribute or PRMAggregate can either be input, output, both or internal nodes.

By defaut, attributes and aggregates are inner nodes.

Parameters
eltA PRMClassElement<GUM_SCALAR>.
bThe flag value.
Exceptions
NotFoundRaised if id does'nt match any PRMClassElement<GUM_SCALAR> in this.
WrongClassElementRaised if NodeId is neither an PRMAttribute nor an PRMAggregate.

Definition at line 98 of file PRMClassElementContainer_tpl.h.

100 {
101 if (!exists(elt.safeName())) {
102 GUM_ERROR(NotFound, ": <" + elt.safeName() + "> is not in <" + name() + ">")
105 try {
106 getIOFlag_(elt).first = b;
107 } catch (NotFound const&) { setIOFlag_(elt, std::make_pair(b, false)); }
108 } else {
109 GUM_ERROR(WrongClassElement, "given id is not an PRMAttribute or an PRMAggregate")
110 }
111 }

References exists(), GUM_ERROR, gum::prm::PRMClassElement< GUM_SCALAR >::isAggregate(), gum::prm::PRMClassElement< GUM_SCALAR >::isAttribute(), gum::prm::PRMObject::name(), and gum::prm::PRMClassElement< GUM_SCALAR >::safeName().

Referenced by gum::prm::PRMClass< GUM_SCALAR >::addArc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setIOFlag_()

template<typename GUM_SCALAR>
INLINE void gum::prm::PRMClassElementContainer< GUM_SCALAR >::setIOFlag_ ( const PRMClassElement< GUM_SCALAR > & elt,
const std::pair< bool, bool > & flags )
protectedvirtualinherited

Defines the IO flags of a PRMClassElement<GUM_SCALAR>.

Parameters
eltThe PRMClassElement<GUM_SCALAR>.
flagsThe IO flags of elt. Overwrite any existing flags.
Returns
elt's IO flags.
Exceptions
NotFoundRaised if elt does not have any IO flags.

Definition at line 169 of file PRMClassElementContainer_tpl.h.

170 {
171 try {
172 _IOFlags_[elt.safeName()] = flags;
173 } catch (NotFound const&) { _IOFlags_.insert(elt.safeName(), flags); }
174 }

References _IOFlags_, and gum::prm::PRMClassElement< GUM_SCALAR >::safeName().

Referenced by gum::prm::PRMClass< GUM_SCALAR >::_addIOInterfaceFlags_(), copyIOFlags_(), and setOutputNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOutputNode()

template<typename GUM_SCALAR>
INLINE void gum::prm::PRMClassElementContainer< GUM_SCALAR >::setOutputNode ( const PRMClassElement< GUM_SCALAR > & elt,
bool b )
virtualinherited

Set the output flag value of id at b.

PRMAttribute or PRMAggregate can either be input, output, both or internal nodes.

By defaut, attributes and aggregates are inner nodes.

Parameters
eltA PRMClassElement<GUM_SCALAR>.
bThe flag value.
Exceptions
NotFoundRaised if id does'nt match any PRMClassElement<GUM_SCALAR> in this.
WrongClassElementRaised if NodeId is neither an PRMAttribute nor an PRMAggregate.

Definition at line 114 of file PRMClassElementContainer_tpl.h.

116 {
117 if (!exists(elt.safeName())) {
118 GUM_ERROR(NotFound, "<" + elt.safeName() + "> is not in <" + name() + ">")
121 try {
122 getIOFlag_(elt).second = b;
123 } catch (NotFound const&) { setIOFlag_(elt, std::make_pair(false, b)); }
124
125 if (b) { updateDescendants_(elt); }
126 } else {
128 "given ClassElement<GUM_SCALAR> is not an "
129 "PRMAttribute or an PRMAggregate");
130 }
131 }
virtual void updateDescendants_(const PRMClassElement< GUM_SCALAR > &elt)=0
When a PRMClassElement<GUM_SCALAR> becomes an Output node we must update any the IO flags of every de...

References exists(), getIOFlag_(), GUM_ERROR, gum::prm::PRMClassElement< GUM_SCALAR >::isAggregate(), gum::prm::PRMClassElement< GUM_SCALAR >::isAttribute(), gum::prm::PRMObject::name(), gum::prm::PRMClassElement< GUM_SCALAR >::safeName(), setIOFlag_(), and updateDescendants_().

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::_buildSlotChain_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ super() [1/2]

template<typename GUM_SCALAR>
INLINE PRMInterface< GUM_SCALAR > & gum::prm::PRMInterface< GUM_SCALAR >::super ( )

Returns the superInterface of this PRMInterface.

Returns
Returns the super PRMInterface of this PRMInterface.
Exceptions
NotFoundRaised if this has no super PRMInterface.

Definition at line 361 of file PRMInterface_tpl.h.

361 {
363 else GUM_ERROR(NotFound, "this Interface is ! a sub interface")
364 }

References PRMInterface(), _superInterface_, and GUM_ERROR.

Referenced by PRMInterface(), and overload().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ super() [2/2]

template<typename GUM_SCALAR>
INLINE const PRMInterface< GUM_SCALAR > & gum::prm::PRMInterface< GUM_SCALAR >::super ( ) const

Returns the superInterface of this PRMInterface.

Returns
Returns the super PRMInterface of this PRMInterface.
Exceptions
NotFoundRaised if this has no super PRMInterface.

Definition at line 367 of file PRMInterface_tpl.h.

367 {
369 else GUM_ERROR(NotFound, "this Interface is ! a sub interface")
370 }

References PRMInterface(), _superInterface_, and GUM_ERROR.

Here is the call graph for this function:

◆ updateDescendants_()

template<typename GUM_SCALAR>
void gum::prm::PRMInterface< GUM_SCALAR >::updateDescendants_ ( const PRMClassElement< GUM_SCALAR > & elt)
protectedvirtual

See gum::prm::PRMClassElementContainer<GUM_SCALAR>(const PRMClassElement<GUM_SCALAR>&).

Implements gum::prm::PRMClassElementContainer< GUM_SCALAR >.

Definition at line 317 of file PRMInterface_tpl.h.

317 {
318 // for ( const auto ext : _extensions_ )
319 // if ( !ext->isOutputNode( elt ) ) ext->setOutputNode( elt, true );
320
321 // for ( const auto impl : _implementations_ ) {
322 // // Because of cyclic dependencies we must use a reinterpret cast.
323 // PRMClassElementContainer<GUM_SCALAR>* c =
324 // reinterpret_cast<PRMClassElementContainer<GUM_SCALAR>*>( impl );
325
326 // if ( ! c->isOutputNode( elt ) ) c->setOutputNode( elt, true );
327 //}
328 }

◆ PRMClass< GUM_SCALAR >

template<typename GUM_SCALAR>
friend class PRMClass< GUM_SCALAR >
friend

Definition at line 402 of file PRMInterface.h.

Referenced by _addImplementation_().

Member Data Documentation

◆ _attributes_

template<typename GUM_SCALAR>
Set< PRMAttribute< GUM_SCALAR >* > gum::prm::PRMInterface< GUM_SCALAR >::_attributes_
private

The sequence of PRMAttribute<GUM_SCALAR>s.

Definition at line 353 of file PRMInterface.h.

Referenced by attributes().

◆ _dag_

template<typename GUM_SCALAR>
DAG gum::prm::PRMInterface< GUM_SCALAR >::_dag_
private

The dag representing dependencies between formal attributes and slots.

Definition at line 336 of file PRMInterface.h.

Referenced by PRMInterface(), dag_(), and dag_().

◆ _extensions_

template<typename GUM_SCALAR>
Set< PRMInterface< GUM_SCALAR >* > gum::prm::PRMInterface< GUM_SCALAR >::_extensions_
private

The set of Class<GUM_SCALAR> which implements this PRMInterface.

Definition at line 379 of file PRMInterface.h.

Referenced by _addExtension_(), and findAllSubtypes_().

◆ _implementations_

template<typename GUM_SCALAR>
Set< PRMClass< GUM_SCALAR >* > gum::prm::PRMInterface< GUM_SCALAR >::_implementations_
private

The set of Class<GUM_SCALAR> which implements this PRMInterface.

Definition at line 371 of file PRMInterface.h.

Referenced by _addImplementation_(), findAllSubtypes_(), implementations(), implementations(), and isOutputNode().

◆ _IOFlags_

template<typename GUM_SCALAR>
HashTable< std::string, std::pair< bool, bool > > gum::prm::PRMClassElementContainer< GUM_SCALAR >::_IOFlags_
privateinherited

input / output flags, useful when inheriting or copying.

Definition at line 451 of file PRMClassElementContainer.h.

Referenced by copyIOFlags_(), getIOFlag_(), getIOFlag_(), and setIOFlag_().

◆ _name_

std::string gum::prm::PRMObject::_name_
privateinherited

◆ _nameMap_

template<typename GUM_SCALAR>
HashTable< std::string, PRMClassElement< GUM_SCALAR >* > gum::prm::PRMInterface< GUM_SCALAR >::_nameMap_
private

Mapping between a member's name and itself. Used for fast access to a member given it's name.

Definition at line 350 of file PRMInterface.h.

Referenced by gum::prm::PRMInterface< double >::PRMInterface(), _overloadReferenceSlot_(), add(), get(), and get().

◆ _nodeIdMap_

template<typename GUM_SCALAR>
NodeProperty< PRMClassElement< GUM_SCALAR >* > gum::prm::PRMInterface< GUM_SCALAR >::_nodeIdMap_
private

Mapping between node's id and their name (being an attribute or a slot). Used for fast access to a member given it's node id.

Definition at line 340 of file PRMInterface.h.

Referenced by ~PRMInterface(), _overloadReferenceSlot_(), begin(), begin(), end(), end(), get(), and get().

◆ _referenceSlots_

template<typename GUM_SCALAR>
Set< PRMReferenceSlot< GUM_SCALAR >* > gum::prm::PRMInterface< GUM_SCALAR >::_referenceSlots_
private

The sequence of PRMReferenceSlot<GUM_SCALAR>.

Definition at line 356 of file PRMInterface.h.

Referenced by referenceSlots().

◆ _superInterface_

template<typename GUM_SCALAR>
PRMInterface< GUM_SCALAR >* gum::prm::PRMInterface< GUM_SCALAR >::_superInterface_
private

The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this. Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.

Definition at line 368 of file PRMInterface.h.

Referenced by PRMInterface(), PRMInterface(), PRMInterface(), gum::prm::PRMInterface< double >::end(), inheritInterface(), isOutputNode(), super(), and super().


The documentation for this class was generated from the following files: