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

A PRMClass is an object of a PRM representing a fragment of a Bayesian network which can be instantiated in PRMInstance. More...

#include <agrum/PRM/elements/PRMClass.h>

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

Public Member Functions

Constructors & destructor.
 PRMClass (const std::string &name)
 Default constructor.
 PRMClass (const std::string &name, PRMClass< GUM_SCALAR > &super, bool delayInheritance=false)
 Constructor for building a subclass of super.
 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.
 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.
 PRMClass (const PRMClass< GUM_SCALAR > &source)=delete
 Copy constructor.
 PRMClass (const PRMClass< GUM_SCALAR > &&source)=delete
 Move constructor.
PRMClass< GUM_SCALAR > & operator= (const PRMClass< GUM_SCALAR > &source)=delete
 Copy operator. Don't use it.
PRMClass< GUM_SCALAR > & operator= (const PRMClass< GUM_SCALAR > &&source)=delete
 Move operator. Don't use it.
virtual ~PRMClass ()
 Destructor.
virtual PRMObject::prm_type obj_type () const
 Implementation of pure virtual method of PRMObject.
Graphical operator
PRMClassElement< GUM_SCALAR > & get (NodeId id)
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
const PRMClassElement< GUM_SCALAR > & get (NodeId id) const
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
PRMClassElement<GUM_SCALAR> getters and setters
virtual bool isOutputNode (const PRMClassElement< GUM_SCALAR > &elt) const
 Returns true if elt is an output node.
bool isCastDescendant (const std::string &safe_name) const
 Return true if the attribute named safe_name is a cast descendant.
PRMClassElement< GUM_SCALAR > & get (const std::string &name)
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
const PRMClassElement< GUM_SCALAR > & get (const std::string &name) const
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
virtual NodeId add (PRMClassElement< GUM_SCALAR > *elt)
 See gum::prm::add(PRMClassElement<GUM_SCALAR>*).
virtual NodeId overload (PRMClassElement< GUM_SCALAR > *elt)
 See gum::prm::overload(PRMClassElement<GUM_SCALAR>*).
virtual void addArc (const std::string &tail, const std::string &head)
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::addArc().
const Set< PRMAttribute< GUM_SCALAR > * > & attributes () const
 Returns the set of PRMAttribute<GUM_SCALAR> of this Class<GUM_SCALAR>.
const Set< PRMParameter< GUM_SCALAR > * > & parameters () const
 Returns the set of parameters of this Class<GUM_SCALAR>.
HashTable< std::string, const PRMParameter< GUM_SCALAR > * > scope () const
 Returns all the parameters in the scope of this class.
const Set< PRMAggregate< GUM_SCALAR > * > & aggregates () const
 Returns the set of PRMAggregate<GUM_SCALAR> of this Class<GUM_SCALAR>.
const Set< PRMReferenceSlot< GUM_SCALAR > * > & referenceSlots () const
 Returns the set of PRMReferenceSlot<GUM_SCALAR> of this Class<GUM_SCALAR>.
const Set< PRMSlotChain< GUM_SCALAR > * > & slotChains () const
 Returns the set of PRMSlotChain<GUM_SCALAR> of this Class<GUM_SCALAR>.
Inheritance methods
virtual bool isSubTypeOf (const PRMClassElementContainer< GUM_SCALAR > &cec) const
 Test if this Class<GUM_SCALAR> is a subclass of cec.
const PRMClass< GUM_SCALAR > & super () const
 Returns the super Class<GUM_SCALAR> of this Class<GUM_SCALAR>.
const Set< PRMInterface< GUM_SCALAR > * > & implements () const
 Returns the Set of PRMInterface<GUM_SCALAR> implemented by this Class<GUM_SCALAR>.
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>.
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&).
For custom inheritance
void inheritReferenceSlots ()
void inheritParameters ()
void inheritAttributes ()
void inheritAggregates ()
void inheritSlotChains ()
void initializeInheritance ()
void completeInheritance (const std::string &attr)
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

virtual const DAGdag_ () const
 returns a constant reference over this interface's dag.
virtual DAGdag_ ()
 Returns a non constant reference over this PRMInterface<GUM_SCALAR>'s DAG.
void findAllSubtypes_ (Set< PRMClassElementContainer< GUM_SCALAR > * > &set)
 Fills set with all the subtypes of this Class<GUM_SCALAR>.
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 Attributes

HashTable< std::string, std::pair< bool, bool > > _IOFlags_
 input / output flags, useful when inheriting or copying.
Graphical model members

Proceed with the copy of c in this.

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.
Private members.
std::string _name_

Friends

class PRMInterface< GUM_SCALAR >

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>.
Set< PRMAggregate< GUM_SCALAR > * > _aggregates_
 The sequence of aggregate.
Set< PRMSlotChain< GUM_SCALAR > * > _slotChains_
 The set of gum::PRMSlotChain<GUM_SCALAR>s.
Set< PRMParameter< GUM_SCALAR > * > _parameters_
 The Set of parameters in this Class<GUM_SCALAR>.
void _addCastDescendants_ (PRMClassElement< GUM_SCALAR > *attr)
 Recursively adds cast descendant of attr in this Class<GUM_SCALAR>.
void _addCastDescendants_ (PRMAttribute< GUM_SCALAR > *start, PRMAttribute< GUM_SCALAR > *end)
 Recursively adds cast descendant from start to end in this Class<GUM_SCALAR>.

Inheritance members

PRMClass< GUM_SCALAR > * _superClass_
 The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this. Note that this is first searched for gum::PRMClassElement<GUM_SCALAR>.
Set< PRMInterface< GUM_SCALAR > * > * _implements_
 The Set of implemented interface of this.
Set< PRMClass< GUM_SCALAR > * > _extensions_
 The set of Class<GUM_SCALAR> which are extension of this Class<GUM_SCALAR> (i.e. direct subtypes).
Bijection< const DiscreteVariable *, const DiscreteVariable * > * _bijection_
 The bijection between variables in super and variables in this The bijection's firsts are attributes in this and its seconds are attributes in c.
HashFunc< PRMClassElementContainer< GUM_SCALAR > * > _dummy_hashfunc_
 a dummy member used to fix a compilation issue in clang4
void _inheritClass_ (const PRMClass< GUM_SCALAR > &c)
 Proceed with the copy when this inherits c.
void _implementInterfaces_ (bool delayInheritance)
 Proceed with the implementation of interfaces.
void _checkInterfaces_ (PRMClassElement< GUM_SCALAR > *elt)
 Check that a given element respects all the class interfaces.
void _checkInterface_ (PRMClassElement< GUM_SCALAR > *elt, PRMInterface< GUM_SCALAR > *i)
 Check that a given element respects a specific interface.
void _checkRefInterfaces_ (PRMReferenceSlot< GUM_SCALAR > *elt)
 Check that a given element respects all the class interfaces.
void _checkRefInterface_ (PRMReferenceSlot< GUM_SCALAR > *elt, PRMInterface< GUM_SCALAR > *i)
 Check that a given element respects a specific interface.
void _addIOInterfaceFlags_ (PRMClassElement< GUM_SCALAR > *elt)
 Check if elt is present in an implementation. If it is, its IO flags are updated.
void _addExtension_ (PRMClass< GUM_SCALAR > *c)
 This method is called when a sub-Class<GUM_SCALAR> of this Class<GUM_SCALAR> is created.
bool _checkOverloadLegality_ (const PRMClassElement< GUM_SCALAR > *overloaded, const PRMClassElement< GUM_SCALAR > *overloader)
 Return true of overloaded can be overload by overloader.
void _overloadAttribute_ (PRMAttribute< GUM_SCALAR > *overloader, PRMAttribute< GUM_SCALAR > *overloaded)
 Overloads an attribute.
void _overloadAggregate_ (PRMAggregate< GUM_SCALAR > *overloader, PRMClassElement< GUM_SCALAR > *overloaded)
 Overloads an aggregate.
void _overloadReference_ (PRMReferenceSlot< GUM_SCALAR > *overloader, PRMReferenceSlot< GUM_SCALAR > *overloaded)
 Overloads a reference slot.
void _overloadParameter_ (PRMParameter< GUM_SCALAR > *overloader, PRMParameter< GUM_SCALAR > *overloaded)
 Overloads a parameter.

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.

Detailed Description

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

A PRMClass is an object of a PRM representing a fragment of a Bayesian network which can be instantiated in PRMInstance.

See also
PRMClassElement

Definition at line 75 of file PRMClass.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

◆ PRMClass() [1/6]

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

Default constructor.

Parameters
nameThe class name.

Definition at line 59 of file PRMClass_tpl.h.

59 :
61 _bijection_(nullptr) {
63 }
PRMClassElementContainer(const std::string &name)
Default constructor.
A PRMClass is an object of a PRM representing a fragment of a Bayesian network which can be instantia...
Definition PRMClass.h:75
PRMClass< GUM_SCALAR > * _superClass_
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this....
Definition PRMClass.h:395
PRMClass(const std::string &name)
Default constructor.
Bijection< const DiscreteVariable *, const DiscreteVariable * > * _bijection_
The bijection between variables in super and variables in this The bijection's firsts are attributes ...
Definition PRMClass.h:407
Set< PRMInterface< GUM_SCALAR > * > * _implements_
The Set of implemented interface of this.
Definition PRMClass.h:398
const std::string & name() const
Returns the name of this object.

References PRMClass(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), _bijection_, _implements_, _superClass_, and gum::prm::PRMObject::name().

Referenced by PRMClass(), PRMClass(), PRMClass(), PRMClass(), PRMClass(), PRMClass(), ~PRMClass(), _addExtension_(), _inheritClass_(), operator=(), operator=(), and super().

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

◆ PRMClass() [2/6]

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

Constructor for building a subclass of super.

Parameters
nameThe subclass name.
superThe super Class<GUM_SCALAR> of this.
delayInheritanceIf true, inheritance will be delayed.

Definition at line 66 of file PRMClass_tpl.h.

68 :
72 if (!delayInheritance) {
73 _dag_ = super.containerDag();
75 }
76 }
DAG _dag_
The dag representing dependencies between formal attributes and slots.
Definition PRMClass.h:347
void _inheritClass_(const PRMClass< GUM_SCALAR > &c)
Proceed with the copy when this inherits c.
const PRMClass< GUM_SCALAR > & super() const
Returns the super Class<GUM_SCALAR> of this Class<GUM_SCALAR>.

References PRMClass(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), _bijection_, _dag_, _implements_, _inheritClass_(), _superClass_, gum::prm::PRMObject::name(), and super().

Here is the call graph for this function:

◆ PRMClass() [3/6]

template<typename GUM_SCALAR>
gum::prm::PRMClass< GUM_SCALAR >::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.

Parameters
nameThe sub class name.
setThe Set of implemented interfaces.
delayInheritanceIf true, inheritance will be delayed.

Definition at line 79 of file PRMClass_tpl.h.

81 :
85
87 }
void _implementInterfaces_(bool delayInheritance)
Proceed with the implementation of interfaces.
friend class PRMInterface< GUM_SCALAR >
Definition PRMClass.h:76

References PRMClass(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), _bijection_, _implements_, _superClass_, gum::prm::PRMObject::name(), and PRMInterface< GUM_SCALAR >.

Here is the call graph for this function:

◆ PRMClass() [4/6]

template<typename GUM_SCALAR>
gum::prm::PRMClass< GUM_SCALAR >::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.

Parameters
nameThe sub class name.
superThe super Class<GUM_SCALAR> of this.
setThe Set of implemented interfaces.
delayInheritanceIf true, inheritance will be delayed.

Definition at line 90 of file PRMClass_tpl.h.

93 :
97 if (!delayInheritance) {
98 _dag_ = super.containerDag();
100 }
101
102 // Adding other implementation
103 if (_implements_ == nullptr) { // super has not created _implements_
105 } else { // we just add the new implementations
106 for (const auto elt: set) {
107 _implements_->insert(elt);
108 }
109 }
110
112 }

References PRMClass(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), _bijection_, _dag_, _implementInterfaces_(), _implements_, _inheritClass_(), _superClass_, gum::prm::PRMObject::name(), PRMInterface< GUM_SCALAR >, and super().

Here is the call graph for this function:

◆ PRMClass() [5/6]

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

Copy constructor.

References PRMClass().

Here is the call graph for this function:

◆ PRMClass() [6/6]

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

Move constructor.

References PRMClass().

Here is the call graph for this function:

◆ ~PRMClass()

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

Destructor.

Definition at line 132 of file PRMClass_tpl.h.

132 {
134
135 for (const auto& elt: _nodeIdMap_) {
136 delete elt.second;
137 }
138
139 if (_implements_) { delete _implements_; }
140
141 if (_bijection_) { delete _bijection_; }
142 }
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...
Definition PRMClass.h:351

References PRMClass(), and _nodeIdMap_.

Here is the call graph for this function:

Member Function Documentation

◆ _addCastDescendants_() [1/2]

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

Recursively adds cast descendant from start to end in this Class<GUM_SCALAR>.

Definition at line 915 of file PRMClass_tpl.h.

916 {
919
920 while (parent->type().superType() != end->type()) {
921 child = parent->getCastDescendant();
922 child->setId(nextNodeId());
923 _nodeIdMap_.insert(child->id(), child);
924 _dag_.addNodeWithId(child->id());
925 // Only use child's safe name when adding to the name map!
926 _nameMap_.insert(child->safeName(), child);
927 _attributes_.insert(child);
929 // Do not use Class<GUM_SCALAR>::insertArc(), child's CPF is already
930 // initialized properly
931 _dag_.addArc(parent->id(), child->id());
932 parent = child;
933 }
934
935 parent->setAsCastDescendant(end);
936 _dag_.addArc(parent->id(), end->id());
937 }
void _addIOInterfaceFlags_(PRMClassElement< GUM_SCALAR > *elt)
Check if elt is present in an implementation. If it is, its IO flags are updated.
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.
Definition PRMClass.h:361
Set< PRMAttribute< GUM_SCALAR > * > _attributes_
The sequence of PRMAttribute<GUM_SCALAR>s.
Definition PRMClass.h:364

References _addIOInterfaceFlags_(), _attributes_, _dag_, _nameMap_, _nodeIdMap_, gum::prm::PRMAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::prm::nextNodeId(), gum::prm::PRMClassElement< GUM_SCALAR >::safeName(), gum::prm::PRMAttribute< GUM_SCALAR >::setAsCastDescendant(), gum::prm::PRMClassElement< GUM_SCALAR >::setId(), gum::prm::PRMType::superType(), and gum::prm::PRMAttribute< GUM_SCALAR >::type().

Here is the call graph for this function:

◆ _addCastDescendants_() [2/2]

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::_addCastDescendants_ ( PRMClassElement< GUM_SCALAR > * attr)
private

Recursively adds cast descendant of attr in this Class<GUM_SCALAR>.

Definition at line 683 of file PRMClass_tpl.h.

683 {
684 auto parent = attr;
686
687 while (parent->type().isSubType()) {
688 child = parent->getCastDescendant();
689
690 // Check if id was reserved by one of the class interfaces
691 bool found = false;
692 try {
693 for (auto i: implements()) {
694 if (i->exists(child->safeName())) {
695 child->setId(i->get(child->safeName()).id());
696 found = true;
697 break;
698 }
699 }
700 } catch (NotFound const&) {
701 // No interface
702 }
703 if (!found) {
704 child->setId(nextNodeId());
705 _dag_.addNodeWithId(child->id());
706 }
707 _nodeIdMap_.insert(child->id(), child);
708 // Only use child's safe name when adding to the name map!
709 _nameMap_.insert(child->safeName(), child);
710 _attributes_.insert(child);
711 // Do not use Class<GUM_SCALAR>::insertArc(), child's CPF is already
712 // initialized properly
713 _dag_.addArc(parent->id(), child->id());
714
715 parent = child;
716 }
717 }
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...
PRMClassElement< GUM_SCALAR > & get(NodeId id)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
const Set< PRMInterface< GUM_SCALAR > * > & implements() const
Returns the Set of PRMInterface<GUM_SCALAR> implemented by this Class<GUM_SCALAR>.

References _attributes_, _dag_, _nameMap_, _nodeIdMap_, gum::prm::PRMAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMClassElement< GUM_SCALAR >::id(), implements(), gum::prm::nextNodeId(), gum::prm::PRMClassElement< GUM_SCALAR >::safeName(), and gum::prm::PRMClassElement< GUM_SCALAR >::setId().

Referenced by _overloadAttribute_(), and add().

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

◆ _addExtension_()

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

This method is called when a sub-Class<GUM_SCALAR> of this Class<GUM_SCALAR> is created.

Parameters
cThe Class<GUM_SCALAR> added as a direct sub-Class<GUM_SCALAR> of this.
Exceptions
DuplicateElementRaised if c is already a sub-Class<GUM_SCALAR> of this.

Definition at line 1203 of file PRMClass_tpl.h.

1203 {
1204 _extensions_.insert(c);
1205 }
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:402

References PRMClass(), and _extensions_.

Here is the call graph for this function:

◆ _addIOInterfaceFlags_()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::_addIOInterfaceFlags_ ( PRMClassElement< GUM_SCALAR > * elt)
private

Check if elt is present in an implementation. If it is, its IO flags are updated.

Definition at line 949 of file PRMClass_tpl.h.

949 {
950 // We only add IO Flags if elt matches is required by and interface
951 if (_implements_ != nullptr) {
952 for (const auto impl: *_implements_) {
954 while (super) {
955 // If the attribute is defined in an interface, we set it as an
956 // OutputNode
957 if (impl->exists(elt->name())) {
958 try {
959 this->getIOFlag_(*elt).second = true;
960 } catch (NotFound const&) { this->setIOFlag_(*elt, std::make_pair(false, true)); }
961 }
962 try {
963 super = &(super->super());
964 } catch (NotFound const&) { super = nullptr; }
965 }
966 }
967 }
968 }
virtual std::pair< bool, bool > & getIOFlag_(const PRMClassElement< GUM_SCALAR > &elt)
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>.

References _implements_, gum::prm::PRMClassElementContainer< GUM_SCALAR >::getIOFlag_(), gum::prm::PRMObject::name(), PRMInterface< GUM_SCALAR >, gum::prm::PRMClassElementContainer< GUM_SCALAR >::setIOFlag_(), and super().

Referenced by _addCastDescendants_(), add(), and overload().

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

◆ _checkInterface_()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::_checkInterface_ ( PRMClassElement< GUM_SCALAR > * elt,
PRMInterface< GUM_SCALAR > * i )
private

Check that a given element respects a specific interface.

Definition at line 535 of file PRMClass_tpl.h.

536 {
537 const auto& i_elt = i->get(elt->name());
540
541 if (!(is_attr || is_agg)) {
542 GUM_ERROR(OperationNotAllowed, "Class does not respect it's interface")
543 }
544
545 if (!elt->type().isSubTypeOf(i_elt.type())) {
546 GUM_ERROR(OperationNotAllowed, "Attribute type does not respect class interface")
547 }
548
549 if (elt->type() != i_elt.type()) {
550 if (!this->exists(i_elt.safeName())) {
551 GUM_ERROR(OperationNotAllowed, "Attribute type does not respect class interface")
552 }
553 elt = &(this->get(i_elt.safeName()));
554 }
555
556 // Node must be reserved by constructor
557 if (!_dag_.existsNode(i_elt.id())) {
558 GUM_ERROR(FatalError, "Class does not reserved implemented nodes")
559 }
560
561 // Removing unused node and changing to proper node
562 if (elt->id() != i_elt.id()) {
563 // Update cast descendants
564 for (auto child: _dag_.children(elt->id())) {
565 _dag_.addArc(i_elt.id(), child);
566 }
567 _dag_.eraseNode(elt->id());
568 }
569 _nodeIdMap_.erase(elt->id());
570 elt->setId(i_elt.id());
571 _nodeIdMap_.insert(elt->id(), elt);
572 }
static INLINE bool isAggregate(const PRMClassElement< GUM_SCALAR > &elt)
Return true if obj is of type PRMAggregate.
static INLINE bool isAttribute(const PRMClassElement< GUM_SCALAR > &elt)
Returns true if obj_ptr is of type PRMAttribute.
virtual bool isSubTypeOf(const PRMClassElementContainer< GUM_SCALAR > &cec) const
Test if this Class<GUM_SCALAR> is a subclass of cec.
#define GUM_ERROR(type, msg)
Definition exceptions.h:72

References _dag_, _nodeIdMap_, gum::prm::PRMClassElementContainer< GUM_SCALAR >::exists(), get(), gum::prm::PRMInterface< GUM_SCALAR >::get(), GUM_ERROR, gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::prm::PRMClassElement< GUM_SCALAR >::isAggregate(), gum::prm::PRMClassElement< GUM_SCALAR >::isAttribute(), gum::prm::PRMType::isSubTypeOf(), gum::prm::PRMObject::name(), PRMInterface< GUM_SCALAR >, gum::prm::PRMClassElement< GUM_SCALAR >::setId(), and gum::prm::PRMClassElement< GUM_SCALAR >::type().

Referenced by _checkInterfaces_().

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

◆ _checkInterfaces_()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::_checkInterfaces_ ( PRMClassElement< GUM_SCALAR > * elt)
private

Check that a given element respects all the class interfaces.

Definition at line 524 of file PRMClass_tpl.h.

524 {
525 try {
526 for (auto i: implements()) {
527 if (i->exists(elt->name())) { _checkInterface_(elt, i); }
528 }
529 } catch (NotFound const&) {
530 // No interface
531 }
532 }
void _checkInterface_(PRMClassElement< GUM_SCALAR > *elt, PRMInterface< GUM_SCALAR > *i)
Check that a given element respects a specific interface.

References _checkInterface_(), implements(), and gum::prm::PRMObject::name().

Referenced by add().

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

◆ _checkOverloadLegality_()

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

Return true of overloaded can be overload by overloader.

Definition at line 1160 of file PRMClass_tpl.h.

1162 {
1163 if (overloaded->elt_type() != overloader->elt_type()) { return false; }
1164
1165 switch (overloaded->elt_type()) {
1167 if (!overloader->type().isSubTypeOf(overloaded->type())) { return false; }
1168 break;
1169 }
1170
1172 const auto& new_slot_type
1173 = static_cast< const PRMReferenceSlot< GUM_SCALAR >* >(overloader)->slotType();
1174 const auto& old_slot_type
1175 = static_cast< const PRMReferenceSlot< GUM_SCALAR >* >(overloaded)->slotType();
1176
1177 if (!new_slot_type.isSubTypeOf(old_slot_type)) { return false; }
1178
1179 break;
1180 }
1181
1183 auto overloaded_param = static_cast< const PRMParameter< GUM_SCALAR >* >(overloaded);
1184 auto overloader_param = static_cast< const PRMParameter< GUM_SCALAR >* >(overloader);
1185
1186 return overloaded_param->valueType() == overloader_param->valueType();
1187 break;
1188 }
1189
1190 default : {
1191 return false;
1192 }
1193 }
1194 return true;
1195 }

References gum::prm::PRMClassElement< GUM_SCALAR >::elt_type(), gum::prm::PRMType::isSubTypeOf(), gum::prm::PRMClassElement< GUM_SCALAR >::prm_attribute, gum::prm::PRMClassElement< GUM_SCALAR >::prm_parameter, gum::prm::PRMClassElement< GUM_SCALAR >::prm_refslot, gum::prm::PRMClassElement< GUM_SCALAR >::type(), and gum::prm::PRMParameter< GUM_SCALAR >::valueType().

Referenced by overload().

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

◆ _checkRefInterface_()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::_checkRefInterface_ ( PRMReferenceSlot< GUM_SCALAR > * elt,
PRMInterface< GUM_SCALAR > * i )
private

Check that a given element respects a specific interface.

Definition at line 586 of file PRMClass_tpl.h.

587 {
588 auto& i_elt = i->get(ref->name());
589 if (i_elt.elt_type() != ref->elt_type()) {
590 GUM_ERROR(OperationNotAllowed, "Class does not respect it's interface")
591 }
592 auto& i_ref = static_cast< PRMReferenceSlot< GUM_SCALAR >& >(i_elt);
593 if (!ref->slotType().isSubTypeOf(i_ref.slotType())) {
594 GUM_ERROR(OperationNotAllowed, "ReferenceSlot type does not respect class interface")
595 }
596 // Node must be reserved by constructor
597 if (!_dag_.exists(i_ref.id())) {
599 "class " << this->name() << " does not respect interface " << i->name()
600 << " implementation");
601 }
602 // Removing unused node and changin to propoer node
603 if (ref->id() != i_ref.id()) { _dag_.eraseNode(ref->id()); }
604 _nodeIdMap_.erase(ref->id());
605 ref->setId(i_ref.id());
606 _nodeIdMap_.insert(ref->id(), ref);
607 }

References _dag_, _nodeIdMap_, gum::prm::PRMReferenceSlot< GUM_SCALAR >::elt_type(), gum::prm::PRMInterface< GUM_SCALAR >::get(), GUM_ERROR, gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::prm::PRMObject::name(), PRMInterface< GUM_SCALAR >, gum::prm::PRMClassElement< GUM_SCALAR >::setId(), and gum::prm::PRMReferenceSlot< GUM_SCALAR >::slotType().

Referenced by _checkRefInterfaces_().

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

◆ _checkRefInterfaces_()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::_checkRefInterfaces_ ( PRMReferenceSlot< GUM_SCALAR > * elt)
private

Check that a given element respects all the class interfaces.

Definition at line 575 of file PRMClass_tpl.h.

575 {
576 try {
577 for (auto i: implements()) {
578 if (i->exists(ref->name())) { _checkRefInterface_(ref, i); }
579 }
580 } catch (NotFound const&) {
581 // No interface to check
582 }
583 }
void _checkRefInterface_(PRMReferenceSlot< GUM_SCALAR > *elt, PRMInterface< GUM_SCALAR > *i)
Check that a given element respects a specific interface.

References _checkRefInterface_(), implements(), and gum::prm::PRMObject::name().

Referenced by add().

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

◆ _implementInterfaces_()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::_implementInterfaces_ ( bool delayInheritance)
private

Proceed with the implementation of interfaces.

Definition at line 115 of file PRMClass_tpl.h.

115 {
116 for (const auto impl: *_implements_) {
117 impl->_addImplementation_(this);
119 // Reserve reference id in DAG
120 for (auto ref: impl->referenceSlots()) {
121 _dag_.addNodeWithId(ref->id());
122 }
123 // Reserve attribute id in DAG
124 for (auto attr: impl->attributes()) {
125 _dag_.addNodeWithId(attr->id());
126 }
127 }
128 }
129 }
const Set< PRMReferenceSlot< GUM_SCALAR > * > & referenceSlots() const
Returns the set of PRMReferenceSlot<GUM_SCALAR> of this Class<GUM_SCALAR>.
const Set< PRMAttribute< GUM_SCALAR > * > & attributes() const
Returns the set of PRMAttribute<GUM_SCALAR> of this Class<GUM_SCALAR>.

References _dag_, _implements_, _superClass_, isSubTypeOf(), and super().

Referenced by PRMClass(), and gum::prm::PRMClass< double >::PRMClass().

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

◆ _inheritClass_()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::_inheritClass_ ( const PRMClass< GUM_SCALAR > & c)
private

Proceed with the copy when this inherits c.

Definition at line 316 of file PRMClass_tpl.h.

316 {
317 if (_superClass_) {
318 _superClass_->_addExtension_(this);
319 // Adding implemented interfaces of c, if any
320 if (c._implements_) {
321 if (!_implements_) {
323 } else {
324 for (auto i: *(c._implements_)) {
325 _implements_->insert(i);
326 }
327 }
328 }
329
330 // Copying attributes, the bijection's firsts are attributes in this and
331 // its
332 // seconds are attributes
333 // in c.
335
336 // Copying parameters
337 for (const auto c_param: c._parameters_) {
339 c_param->valueType(),
340 c_param->value());
341
342 _parameters_.insert(param);
343
344 param->setId(c_param->id());
345 _nodeIdMap_.insert(param->id(), param);
346 _nameMap_.insert(param->name(), param);
347 }
348
349 // Copying attributes
350 for (const auto c_attr: c._attributes_) {
351 // using multiDimSparse to prevent unecessary memory allocation for
352 // large arrays (the tensors are copied latter)
353 auto attr = c_attr->newFactory(*this);
354
355 bij.insert(&(c_attr->type().variable()), &(attr->type().variable()));
356 attr->setId(c_attr->id());
357 _nodeIdMap_.insert(attr->id(), attr);
358 _attributes_.insert(attr);
359
360 if (c._nameMap_[c_attr->name()] == c._nameMap_[c_attr->safeName()]) {
361 _nameMap_.insert(attr->name(), attr);
362 }
363
364 _nameMap_.insert(attr->safeName(), attr);
365 }
366
367 // Copying aggregates
368 for (const auto c_agg: c._aggregates_) {
370
371 try {
373 c_agg->agg_type(),
374 c_agg->type(),
375 c_agg->label());
376 } catch (OperationNotAllowed const&) {
377 agg = new PRMAggregate< GUM_SCALAR >(c_agg->name(), c_agg->agg_type(), c_agg->type());
378 }
379
380 bij.insert(&(c_agg->type().variable()), &(agg->type().variable()));
381 agg->setId(c_agg->id());
382 _nodeIdMap_.insert(agg->id(), agg);
383 _aggregates_.insert(agg);
384
385 if (c._nameMap_[c_agg->name()] == c._nameMap_[c_agg->safeName()])
386 _nameMap_.insert(agg->name(), agg);
387
388 _nameMap_.insert(agg->safeName(), agg);
389 }
390
391 // Copying reference slots
392 for (const auto c_refslot: c._referenceSlots_) {
394 c_refslot->name(),
395 const_cast< PRMClassElementContainer< GUM_SCALAR >& >(c_refslot->slotType()),
396 c_refslot->isArray());
397
398 ref->setId(c_refslot->id());
399 _nodeIdMap_.insert(ref->id(), ref);
400 _referenceSlots_.insert(ref);
401
402 if (c._nameMap_[c_refslot->name()] == c._nameMap_[c_refslot->safeName()])
403 _nameMap_.insert(ref->name(), ref);
404
405 _nameMap_.insert(ref->safeName(), ref);
406 }
407
408 // Copying slot chains
409 for (const auto c_slotchain: c._slotChains_) {
410 // We just need to change the first PRMReferenceSlot<GUM_SCALAR> in
411 // the
412 // chain
414
415 chain.setAtPos(0, _nameMap_[c_slotchain->chain().front()->name()]);
416
419 bij.insert(&(c_slotchain->type().variable()), &(sc->type().variable()));
420 sc->setId(c_slotchain->id());
421 _nodeIdMap_.insert(sc->id(), sc);
422 _slotChains_.insert(sc);
423
424 _nameMap_.insert(sc->name(), sc);
425 _nameMap_.insert(sc->safeName(), sc);
426 }
427
428 // Copying dependencies yield by arcs
429 for (const auto& arc: c.containerDag().arcs()) {
430 _nodeIdMap_[arc.tail()]->addChild(*(_nodeIdMap_[arc.head()]));
431 _nodeIdMap_[arc.head()]->addParent(*(_nodeIdMap_[arc.tail()]));
432 }
433
434 // Copying the IO flag
435 this->copyIOFlags_(c);
436 // Copying content of CPF
437 for (const auto attr: c._attributes_) {
438 auto a = static_cast< PRMAttribute< GUM_SCALAR >* >(_nameMap_[attr->safeName()]);
439 a->copyCpf(bij, *attr);
440 }
441 }
442 }
const ArcSet & arcs() const
returns the set of arcs stored within the ArcGraphPart
virtual const DAG & containerDag() const
Returns the gum::DAG of this PRMClassElementContainer.
virtual void copyIOFlags_(const PRMClassElementContainer< GUM_SCALAR > &c)
Copy the IO Flags of c in this PRMClassElementContainer.
Set< PRMReferenceSlot< GUM_SCALAR > * > _referenceSlots_
The sequence of PRMReferenceSlot<GUM_SCALAR>.
Definition PRMClass.h:367
Set< PRMSlotChain< GUM_SCALAR > * > _slotChains_
The set of gum::PRMSlotChain<GUM_SCALAR>s.
Definition PRMClass.h:373
Set< PRMAggregate< GUM_SCALAR > * > _aggregates_
The sequence of aggregate.
Definition PRMClass.h:370
Set< PRMParameter< GUM_SCALAR > * > _parameters_
The Set of parameters in this Class<GUM_SCALAR>.
Definition PRMClass.h:376

References PRMClass().

Referenced by PRMClass(), and PRMClass().

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

◆ _overloadAggregate_()

template<typename GUM_SCALAR>
INLINE void gum::prm::PRMClass< GUM_SCALAR >::_overloadAggregate_ ( PRMAggregate< GUM_SCALAR > * overloader,
PRMClassElement< GUM_SCALAR > * overloaded )
private

Overloads an aggregate.

Definition at line 1153 of file PRMClass_tpl.h.

1154 {
1155 _nameMap_.insert(overloader->safeName(), overloader);
1156 _aggregates_.insert(overloader);
1157 }

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

Referenced by overload().

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

◆ _overloadAttribute_()

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

Overloads an attribute.

Definition at line 782 of file PRMClass_tpl.h.

783 {
784 _dag_.eraseParents(overloaded->id());
785
786 // Checking if we have to add cast descendant
787 if (overloader->type() != overloaded->type()) {
788 overloader->setId(nextNodeId());
789 _dag_.addNodeWithId(overloader->id());
790 _nodeIdMap_.insert(overloader->id(), overloader);
792 _nameMap_.insert(overloader->safeName(), overloader);
793 _attributes_.insert(overloader);
795 } else {
796 overloader->setId(overloaded->id());
799 _nameMap_[overloader->safeName()] = overloader;
801 _attributes_.insert(overloader);
803 delete overloaded;
804 }
805 }
void _addCastDescendants_(PRMClassElement< GUM_SCALAR > *attr)
Recursively adds cast descendant of attr in this Class<GUM_SCALAR>.
virtual NodeId overload(PRMClassElement< GUM_SCALAR > *elt)
See gum::prm::overload(PRMClassElement<GUM_SCALAR>*).

References _addCastDescendants_(), _attributes_, _dag_, _nameMap_, _nodeIdMap_, gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::prm::PRMObject::name(), gum::prm::nextNodeId(), gum::prm::PRMAttribute< GUM_SCALAR >::overload(), gum::prm::PRMClassElement< GUM_SCALAR >::safeName(), gum::prm::PRMClassElement< GUM_SCALAR >::setId(), and gum::prm::PRMAttribute< GUM_SCALAR >::type().

Referenced by overload().

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

◆ _overloadParameter_()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::_overloadParameter_ ( PRMParameter< GUM_SCALAR > * overloader,
PRMParameter< GUM_SCALAR > * overloaded )
private

Overloads a parameter.

Definition at line 903 of file PRMClass_tpl.h.

904 {
905 overloader->setId(overloaded->id());
908 _nameMap_[overloader->safeName()] = overloader;
910 _parameters_.insert(overloader);
911 delete overloaded;
912 }

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

Referenced by overload().

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

◆ _overloadReference_()

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

Overloads a reference slot.

Definition at line 808 of file PRMClass_tpl.h.

809 {
810 // Adding overloading reference
811 overloader->setId(overloaded->id());
814 _nameMap_.insert(overloader->safeName(), overloader);
820
821 // Updating PRMSlotChain<GUM_SCALAR> which started with overloaded
822 for (const auto slotchain: _slotChains_) {
823 // If the attribute pointed by this slotchain is overloaded, we need to
824 // change the slotchain
825 // names to it's safename version: ref.attr is replaced by
826 // ref.(type)attr.
827 if ((slotchain->chain().atPos(0) == overloaded)) {
829 seq.insert(overloader);
830
831 auto elt = ++(slotchain->chain().begin());
832
833 while (elt != slotchain->chain().end()) {
834 ref = static_cast< PRMReferenceSlot< GUM_SCALAR >* >(seq.back());
835 next = &(ref->slotType().get((*elt)->name()));
836 seq.insert(next);
837 ++elt;
838 }
839
840 // If the slotchain last element type changes, we change the slotchain
841 // to
842 // point towards the cast decendant
843 // with the correct type
844 if (seq.back()->type() != slotchain->lastElt().type()) {
845 seq.erase(seq.back());
846 seq.insert(&(static_cast< PRMReferenceSlot< GUM_SCALAR >* >(seq.back())
847 ->slotType()
848 .get(slotchain->lastElt().safeName())));
850 std::string dot = ".";
851
852 for (Size i = 0; i < seq.size() - 1; ++i) {
853 sc_name += seq.atPos(i)->name() + dot;
854 }
855
856 sc_name += seq.back()->safeName();
858 sc->setId(slotchain->id());
859
860 for (const auto child: this->containerDag().children(sc->id())) {
861 auto& elt = get(child);
863 auto& attr = static_cast< PRMAttribute< GUM_SCALAR >& >(elt);
864 auto& old_type = slotchain->lastElt().type();
865 auto& new_type = sc->lastElt().type();
866 attr.swap(old_type, new_type);
867 } else {
868 GUM_ERROR(OperationNotAllowed, "unexpected ClassElement")
869 // get( child ).cpf().replace(
870 // slotchain->lastElt().type().variable(),
871 // sc->lastElt().type().variable() );
872 }
873 }
874
875 toAdd.push_back(sc);
876 toRemove.push_back(slotchain);
877 } else {
878 // Types are identical, we just need to change the first reference
879 slotchain->chain().setAtPos(0, overloader);
880 }
881 }
882 }
883
884 for (const auto torem: toRemove) {
885 _nameMap_.erase(torem->name());
886 _slotChains_.erase(torem);
887 delete torem;
888 }
889
890 for (const auto toadd: toAdd) {
891 _nameMap_.insert(toadd->name(), toadd);
892 _nodeIdMap_[toadd->id()] = toadd;
893 _slotChains_.insert(sc);
894 }
895
896 // Removing overloaded PRMReferenceSlot<GUM_SCALAR>
898 _nameMap_.erase(overloaded->safeName());
899 delete overloaded;
900 }

References _nameMap_, _nodeIdMap_, _referenceSlots_, _slotChains_, gum::SequenceImplementation< Key, Gen >::atPos(), gum::SequenceImplementation< Key, Gen >::back(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::containerDag(), gum::SequenceImplementation< Key, Gen >::erase(), get(), GUM_ERROR, gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::SequenceImplementation< Key, Gen >::insert(), gum::prm::PRMClassElement< GUM_SCALAR >::isAttribute(), gum::prm::PRMSlotChain< GUM_SCALAR >::lastElt(), gum::prm::PRMObject::name(), gum::prm::PRMClassElement< GUM_SCALAR >::safeName(), gum::prm::PRMClassElement< GUM_SCALAR >::setId(), gum::SequenceImplementation< Key, Gen >::size(), gum::prm::PRMReferenceSlot< GUM_SCALAR >::slotType(), and gum::prm::PRMAttribute< GUM_SCALAR >::type().

Referenced by overload().

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

◆ add()

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

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

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

Definition at line 610 of file PRMClass_tpl.h.

610 {
611 if (_nameMap_.exists(elt->name())) {
613 "name " << elt->name() << " already used by another ClassElement");
614 }
615
616 elt->setId(nextNodeId());
617 _dag_.addNodeWithId(elt->id());
618 _nodeIdMap_.insert(elt->id(), elt);
619 _nameMap_.insert(elt->name(), elt);
620
621 try {
622 _nameMap_.insert(elt->safeName(), elt);
623 } catch (DuplicateElement& e) {
626 throw DuplicateElement(e);
627 }
628 }
629
630 switch (elt->elt_type()) {
632 _attributes_.insert(static_cast< PRMAttribute< GUM_SCALAR >* >(elt));
634
635 // Update attribute or cast descendant id to respect implemented
636 // interface
638
640 break;
641 }
642
644 _aggregates_.insert(static_cast< PRMAggregate< GUM_SCALAR >* >(elt));
646
647 // Update attribute or cast descendant id to respect implemented
648 // interface
650
652 break;
653 }
654
656 auto ref = static_cast< PRMReferenceSlot< GUM_SCALAR >* >(elt);
657 _referenceSlots_.insert(ref);
658
659 // Updating ref's id if ref implements an interface
661 break;
662 }
663
665 _slotChains_.insert(static_cast< PRMSlotChain< GUM_SCALAR >* >(elt));
666 break;
667 }
668
670 _parameters_.insert(static_cast< PRMParameter< GUM_SCALAR >* >(elt));
671 break;
672 }
673
674 default : {
675 GUM_ERROR(FatalError, "unknown ClassElement<GUM_SCALAR> type")
676 }
677 }
678
679 return elt->id();
680 }
void _checkInterfaces_(PRMClassElement< GUM_SCALAR > *elt)
Check that a given element respects all the class interfaces.
void _checkRefInterfaces_(PRMReferenceSlot< GUM_SCALAR > *elt)
Check that a given element respects all the class interfaces.

References _addCastDescendants_(), _addIOInterfaceFlags_(), _aggregates_, _attributes_, _checkInterfaces_(), _checkRefInterfaces_(), _dag_, _nameMap_, _nodeIdMap_, _parameters_, _referenceSlots_, _slotChains_, gum::prm::PRMClassElement< GUM_SCALAR >::elt_type(), GUM_ERROR, gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::prm::PRMClassElement< GUM_SCALAR >::isParameter(), gum::prm::PRMClassElement< GUM_SCALAR >::isSlotChain(), gum::prm::PRMObject::name(), gum::prm::nextNodeId(), gum::prm::PRMClassElement< GUM_SCALAR >::prm_aggregate, gum::prm::PRMClassElement< GUM_SCALAR >::prm_attribute, gum::prm::PRMClassElement< GUM_SCALAR >::prm_parameter, gum::prm::PRMClassElement< GUM_SCALAR >::prm_refslot, gum::prm::PRMClassElement< GUM_SCALAR >::prm_slotchain, gum::prm::PRMClassElement< GUM_SCALAR >::safeName(), and gum::prm::PRMClassElement< GUM_SCALAR >::setId().

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::_retrieveInputs_(), gum::prm::PRMFactory< GUM_SCALAR >::addAggregator(), gum::prm::PRMFactory< GUM_SCALAR >::addAttribute(), gum::prm::PRMFactory< GUM_SCALAR >::addNoisyOrCompound(), and gum::prm::PRMFactory< GUM_SCALAR >::startAggregator().

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

◆ addArc()

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

See gum::prm::PRMClassElementContainer<GUM_SCALAR>::addArc().

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

Definition at line 481 of file PRMClass_tpl.h.

482 {
485
486 try {
489 } catch (NotFound const&) {
490 GUM_ERROR(NotFound, "tail and/or head of arc does not exists in this Class")
491 }
492
496 "a PRMReferenceSlot<GUM_SCALAR> can "
497 "not on neither side of an arc");
498 }
499
503 "illegal insertion of an arc between two SlotChain<GUM_SCALAR>")
504 }
505
506 if (!_dag_.existsArc(Arc(tail->id(), head->id()))) {
507 _dag_.addArc(tail->id(), head->id());
508 } else {
509 GUM_ERROR(DuplicateElement, "duplicate arc " << tail_name << "->" << head_name)
510 }
511
512 get(tail->id()).addChild(get(head->id()));
513 get(head->id()).addParent(get(tail->id()));
514
515 // Defining input / output nodes
518 this->setInputNode(*head, true);
519 sc->end().setOutputNode(sc->end().get(sc->lastElt().safeName()), true);
520 }
521 }
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.

References _dag_, _nameMap_, gum::prm::PRMClassElement< GUM_SCALAR >::elt_type(), gum::prm::PRMSlotChain< GUM_SCALAR >::end(), get(), GUM_ERROR, gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::prm::PRMSlotChain< GUM_SCALAR >::lastElt(), gum::prm::PRMClassElement< GUM_SCALAR >::prm_refslot, gum::prm::PRMClassElement< GUM_SCALAR >::prm_slotchain, and gum::prm::PRMClassElementContainer< GUM_SCALAR >::setInputNode().

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::_addParent_(), gum::prm::PRMFactory< GUM_SCALAR >::addAggregator(), gum::prm::PRMFactory< GUM_SCALAR >::addAttribute(), and completeInheritance().

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

◆ aggregates()

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

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

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

Definition at line 1095 of file PRMClass_tpl.h.

1095 {
1096 return _aggregates_;
1097 }

References _aggregates_.

◆ attributes()

template<typename GUM_SCALAR>
INLINE const Set< PRMAttribute< GUM_SCALAR > * > & gum::prm::PRMClass< 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 1033 of file PRMClass_tpl.h.

1033 {
1034 return _attributes_;
1035 }

References _attributes_.

◆ 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:

◆ completeInheritance()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::completeInheritance ( const std::string & attr)

Definition at line 295 of file PRMClass_tpl.h.

295 {
296 if (_superClass_) {
297 auto& elt = this->get(name);
300 GUM_ERROR(OperationNotAllowed, "you can only complete inheritance for attributes")
301 }
302
303 for (const auto& prnt: super().containerDag().parents(elt.id())) {
304 this->addArc(super().get(prnt).safeName(), elt.safeName());
305 }
306
308 auto& attr = static_cast< PRMAttribute< GUM_SCALAR >& >(elt);
309 auto& super_attr = static_cast< const PRMAttribute< GUM_SCALAR >& >(super().get(name));
310 attr.copyCpf(*_bijection_, super_attr);
311 }
312 }
313 }
virtual void addArc(const std::string &tail, const std::string &head)
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::addArc().

References _bijection_, _superClass_, addArc(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::containerDag(), gum::prm::PRMAttribute< GUM_SCALAR >::copyCpf(), get(), GUM_ERROR, gum::prm::PRMClassElement< GUM_SCALAR >::isAggregate(), gum::prm::PRMClassElement< GUM_SCALAR >::isAttribute(), gum::prm::PRMObject::name(), and super().

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.

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::PRMClass< GUM_SCALAR >::dag_ ( )
protectedvirtual

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

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

Definition at line 991 of file PRMClass_tpl.h.

991 {
992 return _dag_;
993 }

References _dag_.

◆ dag_() [2/2]

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

returns a constant reference over this interface's dag.

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

Definition at line 986 of file PRMClass_tpl.h.

986 {
987 return _dag_;
988 }

References _dag_.

◆ 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

References containerDag().

Here is the call graph for this function:

◆ extensions()

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

Returns the set of Class<GUM_SCALAR> which are direct sub-Class<GUM_SCALAR> of this Class<GUM_SCALAR>.

Definition at line 1198 of file PRMClass_tpl.h.

1198 {
1199 return _extensions_;
1200 }

References _extensions_.

◆ findAllSubtypes_()

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

Fills set with all the subtypes of this Class<GUM_SCALAR>.

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

Definition at line 940 of file PRMClass_tpl.h.

941 {
942 for (auto ext: _extensions_) {
943 set.insert(ext);
945 }
946 }
void findAllSubtypes_(Set< PRMClassElementContainer< GUM_SCALAR > * > &set)
Fills set with all the subtypes of this Class<GUM_SCALAR>.

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

Here is the call graph for this function:

◆ get() [1/4]

template<typename GUM_SCALAR>
INLINE PRMClassElement< GUM_SCALAR > & gum::prm::PRMClass< 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 1014 of file PRMClass_tpl.h.

1014 {
1015 try {
1016 return *(_nameMap_[name]);
1017 } catch (NotFound const&) {
1018 GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> with the given name (" << name << ")");
1019 }
1020 }

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::PRMClass< 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 1024 of file PRMClass_tpl.h.

1024 {
1025 try {
1026 return *(_nameMap_[name]);
1027 } catch (NotFound const&) {
1028 GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> with the given name (" << name << ")");
1029 }
1030 }

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

Here is the call graph for this function:

◆ get() [3/4]

◆ get() [4/4]

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

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

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

Definition at line 1005 of file PRMClass_tpl.h.

1005 {
1006 try {
1007 return *(_nodeIdMap_[id]);
1008 } catch (NotFound const&) {
1009 GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> with the given NodeId (" << id << ")");
1010 }
1011 }

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:

◆ implements()

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

Returns the Set of PRMInterface<GUM_SCALAR> implemented by this Class<GUM_SCALAR>.

Returns
Returns the Set of PRMInterface<GUM_SCALAR> implemented by this Class<GUM_SCALAR>.
Exceptions
NotFoundRaised if this Class<GUM_SCALAR> doesn't implement any PRMInterface<GUM_SCALAR>.

Definition at line 1120 of file PRMClass_tpl.h.

1120 {
1121 if (_implements_) {
1122 return *_implements_;
1123 } else {
1124 GUM_ERROR(NotFound, "this Class does not implement any Interface<GUM_SCALAR>")
1125 }
1126 }

References _implements_, and GUM_ERROR.

Referenced by _addCastDescendants_(), gum::prm::PRMFactory< GUM_SCALAR >::_checkInterfaceImplementation_(), _checkInterfaces_(), and _checkRefInterfaces_().

Here is the caller graph for this function:

◆ inheritAggregates()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::inheritAggregates ( )

Definition at line 236 of file PRMClass_tpl.h.

236 {
237 if (_superClass_) {
238 for (const auto c_agg: _superClass_->_aggregates_) {
240
241 try {
243 c_agg->agg_type(),
244 c_agg->type(),
245 c_agg->label());
246 } catch (OperationNotAllowed const&) {
247 agg = new PRMAggregate< GUM_SCALAR >(c_agg->name(), c_agg->agg_type(), c_agg->type());
248 agg->sharedLabel(c_agg->sharedLabel());
249 agg->setLabel(c_agg->labelValue());
250 }
251
252 _bijection_->insert(&(c_agg->type().variable()), &(agg->type().variable()));
253 agg->setId(c_agg->id());
254 _dag_.addNodeWithId(agg->id());
255 _nodeIdMap_.insert(agg->id(), agg);
256 _aggregates_.insert(agg);
257
258 if (_superClass_->_nameMap_[c_agg->name()] == _superClass_->_nameMap_[c_agg->safeName()])
259 _nameMap_.insert(agg->name(), agg);
260
261 _nameMap_.insert(agg->safeName(), agg);
262 }
263 }
264 }

References _aggregates_, _bijection_, _dag_, _nameMap_, _nodeIdMap_, _superClass_, gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::prm::PRMObject::name(), gum::prm::PRMClassElement< GUM_SCALAR >::safeName(), gum::prm::PRMClassElement< GUM_SCALAR >::setId(), gum::prm::PRMAggregate< GUM_SCALAR >::setLabel(), gum::prm::PRMAggregate< GUM_SCALAR >::sharedLabel(), gum::prm::PRMAggregate< GUM_SCALAR >::type(), and gum::prm::PRMType::variable().

Here is the call graph for this function:

◆ inheritAttributes()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::inheritAttributes ( )

Definition at line 208 of file PRMClass_tpl.h.

208 {
209 if (_superClass_) {
210 for (const auto c_attr: _superClass_->_attributes_) {
211 // using multiDimSparse to prevent unecessary memory allocation for
212 // large arrays (the tensors are copied latter)
213 auto attr = c_attr->newFactory(*this);
214
215 _bijection_->insert(&(c_attr->type().variable()), &(attr->type().variable()));
216 attr->setId(c_attr->id());
217 try {
218 _dag_.addNodeWithId(attr->id());
219 } catch (gum::Exception&) {
220 // Node reserved by an interface
221 }
222 _nodeIdMap_.insert(attr->id(), attr);
223 _attributes_.insert(attr);
224
225 if (_superClass_->_nameMap_[c_attr->name()]
226 == _superClass_->_nameMap_[c_attr->safeName()]) {
227 _nameMap_.insert(attr->name(), attr);
228 }
229
230 _nameMap_.insert(attr->safeName(), attr);
231 }
232 }
233 }

References _superClass_.

◆ inheritParameters()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::inheritParameters ( )

Definition at line 189 of file PRMClass_tpl.h.

189 {
190 if (_superClass_) {
191 // Copying parameters
192 for (const auto c_param: _superClass_->_parameters_) {
194 c_param->valueType(),
195 c_param->value());
196
197 _parameters_.insert(param);
198
199 param->setId(c_param->id());
200 _dag_.addNodeWithId(param->id());
201 _nodeIdMap_.insert(param->id(), param);
202 _nameMap_.insert(param->name(), param);
203 }
204 }
205 }

References _superClass_.

◆ inheritReferenceSlots()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::inheritReferenceSlots ( )

Definition at line 163 of file PRMClass_tpl.h.

163 {
164 if (_superClass_) {
165 // Copying reference slots
166 for (const auto c_refslot: _superClass_->_referenceSlots_) {
168 c_refslot->name(),
169 const_cast< PRMClassElementContainer< GUM_SCALAR >& >(c_refslot->slotType()),
170 c_refslot->isArray());
171
172 ref->setId(c_refslot->id());
173 // Not reserved by an interface
174 if (!_dag_.existsNode(ref->id())) { _dag_.addNodeWithId(ref->id()); }
175 _nodeIdMap_.insert(ref->id(), ref);
176 _referenceSlots_.insert(ref);
177
178 if (_superClass_->_nameMap_[c_refslot->name()]
179 == _superClass_->_nameMap_[c_refslot->safeName()]) {
180 _nameMap_.insert(ref->name(), ref);
181 }
182
183 _nameMap_.insert(ref->safeName(), ref);
184 }
185 }
186 }

References gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), _dag_, _nodeIdMap_, _referenceSlots_, and _superClass_.

Here is the call graph for this function:

◆ inheritSlotChains()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::inheritSlotChains ( )

Definition at line 267 of file PRMClass_tpl.h.

267 {
268 if (_superClass_) {
269 // Copying slot chains
270 for (const auto c_sc: _superClass_->_slotChains_) {
271 // Because of aggregators, some slotchains may exists already
272 if (!(_nameMap_.exists(c_sc->name()) && _nameMap_.exists(c_sc->safeName()))) {
273 // We just need to change the first PRMReferenceSlot<GUM_SCALAR> in
274 // the
275 // chain
276 auto chain = c_sc->chain();
277
278 chain.setAtPos(0, _nameMap_[c_sc->chain().front()->name()]);
279
281 _bijection_->insert(&(c_sc->type().variable()), &(sc->type().variable()));
282 sc->setId(c_sc->id());
283 _dag_.addNodeWithId(sc->id());
284 _nodeIdMap_.insert(sc->id(), sc);
285 _slotChains_.insert(sc);
286
287 if (!_nameMap_.exists(sc->name())) { _nameMap_.insert(sc->name(), sc); }
288 if (!_nameMap_.exists(sc->safeName())) { _nameMap_.insert(sc->safeName(), sc); }
289 }
290 }
291 }
292 }

References _superClass_.

◆ initializeInheritance()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::initializeInheritance ( )

Definition at line 145 of file PRMClass_tpl.h.

145 {
146 if (_superClass_) {
147 _superClass_->_addExtension_(this);
148 // Adding implemented interfaces, if any
149 if (_superClass_->_implements_) {
150 if (!_implements_) {
152 } else {
153 for (auto i: *(_superClass_->_implements_)) {
154 _implements_->insert(i);
155 }
156 }
157 }
158 }
159 if (_implements_) { _implementInterfaces_(true); }
160 }

References _superClass_.

◆ isCastDescendant()

template<typename GUM_SCALAR>
INLINE bool gum::prm::PRMClass< GUM_SCALAR >::isCastDescendant ( const std::string & safe_name) const

Return true if the attribute named safe_name is a cast descendant.

Cast descendant are automatically added PRMAttribute<GUM_SCALAR> for type casting.

Parameters
safe_nameThe safe name of an PRMAttribute<GUM_SCALAR> of this class.
Returns
true if safe_name is a cast descendant.
Exceptions
NotFoundRaised if safe_name does not name an PRMAttribute<GUM_SCALAR> in this Class<GUM_SCALAR>.

Definition at line 1208 of file PRMClass_tpl.h.

1208 {
1210
1211 try {
1212 return elt.type().name() == get(elt.name()).type().name();
1213 } catch (OperationNotAllowed const&) {
1214 GUM_ERROR(NotFound, "no attribute with the given name")
1215 }
1216 }

References get(), GUM_ERROR, gum::prm::PRMObject::name(), gum::prm::PRMType::name(), and gum::prm::PRMClassElement< GUM_SCALAR >::type().

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 }

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::PRMClass< GUM_SCALAR >::isOutputNode ( const PRMClassElement< GUM_SCALAR > & elt) const
virtual

Returns true if elt is an output node.

Parameters
eltA node of this class.
Returns
Returns true if elt is an output node.

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

Definition at line 1220 of file PRMClass_tpl.h.

1220 {
1221 try {
1222 if (!this->getIOFlag_(elt).second) {
1223 if (_implements_) {
1224 for (auto i: *_implements_) {
1225 if (i->isOutputNode(elt)) { return true; }
1226 }
1227 }
1228
1229 if (_superClass_ && (_superClass_->isOutputNode(elt))) { return true; }
1230
1231 } else {
1232 return true;
1233 }
1234 } catch (NotFound const&) {}
1235 return false;
1236 }
virtual bool isOutputNode(const PRMClassElement< GUM_SCALAR > &elt) const
Returns true if elt is an output node.

References _implements_, _superClass_, and gum::prm::PRMClassElementContainer< GUM_SCALAR >::getIOFlag_().

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

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

◆ isSubTypeOf()

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

Test if this Class<GUM_SCALAR> is a subclass of cec.

If cec is a Class<GUM_SCALAR> then this Class<GUM_SCALAR> is a subclass of cec if they are equal or there exists a superclass of this Class<GUM_SCALAR> which is equal to cec.

If cec is an PRMInterface<GUM_SCALAR> then this Class<GUM_SCALAR> is a subclass of cec if it implements cec or if there exists a superclass of this Class<GUM_SCALAR> which implements cec.

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

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

Definition at line 445 of file PRMClass_tpl.h.

446 {
447 switch (cec.obj_type()) {
449 const PRMClass< GUM_SCALAR >* current = this;
450
451 while (current != 0) {
452 if (current == &(cec)) return true;
453
455 }
456
457 return false;
458 }
459
461 if (_implements_ != nullptr) {
463 = static_cast< const PRMInterface< GUM_SCALAR >& >(cec);
464
465 if (_implements_->exists(const_cast< PRMInterface< GUM_SCALAR >* >(&i))) return true;
466
467 for (const auto impl: *_implements_)
468 if (impl->isSubTypeOf(i)) return true;
469 }
470
471 return false;
472 }
473
474 default : {
475 GUM_ERROR(FatalError, "unknown ClassElementContainer<GUM_SCALAR>")
476 }
477 }
478 }
virtual PRMObject::prm_type obj_type() const
Implementation of pure virtual method of PRMObject.

Referenced by _implementInterfaces_().

Here is the caller 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::PRMClass< GUM_SCALAR >::obj_type ( ) const
virtual

Implementation of pure virtual method of PRMObject.

Implements gum::prm::PRMObject.

Definition at line 981 of file PRMClass_tpl.h.

981 {
983 }

References gum::prm::PRMObject::CLASS.

◆ 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=() [1/2]

template<typename GUM_SCALAR>
PRMClass< GUM_SCALAR > & gum::prm::PRMClass< GUM_SCALAR >::operator= ( const PRMClass< GUM_SCALAR > && source)
delete

Move operator. Don't use it.

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

Here is the call graph for this function:

◆ operator=() [2/2]

template<typename GUM_SCALAR>
PRMClass< GUM_SCALAR > & gum::prm::PRMClass< GUM_SCALAR >::operator= ( const PRMClass< GUM_SCALAR > & source)
delete

Copy operator. Don't use it.

References PRMClass().

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::PRMClass< 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 1141 of file PRMClass_tpl.h.

1141 {
1142 return get(name);
1143 }

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

Here is the call graph for this function:

◆ operator[]() [2/4]

template<typename GUM_SCALAR>
INLINE const PRMClassElement< GUM_SCALAR > & gum::prm::PRMClass< 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 1147 of file PRMClass_tpl.h.

1147 {
1148 return get(name);
1149 }

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::PRMClass< GUM_SCALAR >::operator[] ( NodeId id)
virtual

See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).

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

Definition at line 1129 of file PRMClass_tpl.h.

1129 {
1130 return get(id);
1131 }

References get().

Here is the call graph for this function:

◆ operator[]() [4/4]

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

See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).

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

Definition at line 1135 of file PRMClass_tpl.h.

1135 {
1136 return get(id);
1137 }

References get().

Here is the call graph for this function:

◆ overload()

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

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

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

Definition at line 720 of file PRMClass_tpl.h.

720 {
721 try {
722 if (!super().exists(overloader->name())) {
723 GUM_ERROR(OperationNotAllowed, "found no ClassElement<GUM_SCALAR> to overload")
724 }
725 } catch (NotFound const&) {
726 GUM_ERROR(OperationNotAllowed, "overload is possible only with subclasses")
727 }
728
730 if (overloaded == overloader) {
731 GUM_ERROR(DuplicateElement, "dupplicate ClassElement " << overloader->name())
732 }
733 // Checking overload legality
735 GUM_ERROR(OperationNotAllowed, "illegal overload")
736 }
737
738 switch (overloader->elt_type()) {
744 break;
745 }
746
750 break;
751 }
752
754 // _checkOverloadLegality_ guaranties that overloaded is a
755 // PRMReferenceSlot<GUM_SCALAR>
759 break;
760 }
761
763 GUM_ERROR(OperationNotAllowed, "SlotChain<GUM_SCALAR> can not be overloaded")
764 break;
765 }
766
771 break;
772 }
773 default : {
774 GUM_ERROR(OperationNotAllowed, "unknown ClassElement<GUM_SCALAR> type")
775 }
776 }
777
778 return overloader->id();
779 }
void _overloadReference_(PRMReferenceSlot< GUM_SCALAR > *overloader, PRMReferenceSlot< GUM_SCALAR > *overloaded)
Overloads a reference slot.
bool _checkOverloadLegality_(const PRMClassElement< GUM_SCALAR > *overloaded, const PRMClassElement< GUM_SCALAR > *overloader)
Return true of overloaded can be overload by overloader.
void _overloadAggregate_(PRMAggregate< GUM_SCALAR > *overloader, PRMClassElement< GUM_SCALAR > *overloaded)
Overloads an aggregate.
void _overloadParameter_(PRMParameter< GUM_SCALAR > *overloader, PRMParameter< GUM_SCALAR > *overloaded)
Overloads a parameter.
void _overloadAttribute_(PRMAttribute< GUM_SCALAR > *overloader, PRMAttribute< GUM_SCALAR > *overloaded)
Overloads an attribute.

References _addIOInterfaceFlags_(), _checkOverloadLegality_(), _nameMap_, _overloadAggregate_(), _overloadAttribute_(), _overloadParameter_(), _overloadReference_(), gum::prm::PRMClassElement< GUM_SCALAR >::elt_type(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::exists(), GUM_ERROR, gum::prm::PRMClassElement< GUM_SCALAR >::id(), gum::prm::PRMObject::name(), gum::prm::PRMClassElement< GUM_SCALAR >::prm_aggregate, gum::prm::PRMClassElement< GUM_SCALAR >::prm_attribute, gum::prm::PRMClassElement< GUM_SCALAR >::prm_parameter, gum::prm::PRMClassElement< GUM_SCALAR >::prm_refslot, gum::prm::PRMClassElement< GUM_SCALAR >::prm_slotchain, and super().

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::addAggregator(), and gum::prm::PRMFactory< GUM_SCALAR >::startAggregator().

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

◆ parameters()

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

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

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

Definition at line 1038 of file PRMClass_tpl.h.

1038 {
1039 return _parameters_;
1040 }

References _parameters_.

Referenced by scope().

Here is the caller graph for this function:

◆ referenceSlots()

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

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

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

Definition at line 1101 of file PRMClass_tpl.h.

1101 {
1102 return _referenceSlots_;
1103 }

References _referenceSlots_.

Referenced by scope().

Here is the caller graph for this function:

◆ 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:

◆ scope()

template<typename GUM_SCALAR>
INLINE HashTable< std::string, const PRMParameter< GUM_SCALAR > * > gum::prm::PRMClass< GUM_SCALAR >::scope ( ) const

Returns all the parameters in the scope of this class.

&return all the parameters in the scope of this class.

Definition at line 1056 of file PRMClass_tpl.h.

1056 {
1058
1059 for (const auto p: parameters()) {
1060 params.insert(p->name(), p);
1061 }
1062
1064
1065 for (const auto ref: referenceSlots()) {
1066 if (PRMObject::isClass(ref->slotType())) {
1067 queue.push(ParamScopeData< GUM_SCALAR >("", *ref, 1));
1068 }
1069 }
1070
1071 while (!queue.empty()) {
1072 auto data = queue.front();
1073 queue.pop();
1074
1075 if (data.depth < 5) {
1076 for (const auto p: data.c->parameters()) {
1077 params.insert(data.prefix + p->name(), p);
1078 }
1079
1080 for (const auto ref: data.c->referenceSlots()) {
1081 if (PRMObject::isClass(ref->slotType())) {
1082 queue.push(ParamScopeData< GUM_SCALAR >(data.prefix, *ref, data.depth + 1));
1083 }
1084 }
1085 } else {
1086 // @todo depth>5 is a workaround. Cycle detection is needed here !
1087 GUM_ERROR(FatalError, "Depth limit reached when looking up parameters")
1088 }
1089 }
1090
1091 return params;
1092 }
const Set< PRMParameter< GUM_SCALAR > * > & parameters() const
Returns the set of parameters of this Class<GUM_SCALAR>.

References GUM_ERROR, gum::HashTable< Key, Val >::insert(), gum::prm::PRMObject::isClass(), parameters(), and referenceSlots().

Referenced by gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkRawCPT_(), and gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkRuleCPT_().

Here is the call graph for this function:
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:

◆ slotChains()

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

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

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

Definition at line 1106 of file PRMClass_tpl.h.

1106 {
1107 return _slotChains_;
1108 }

References _slotChains_.

◆ super()

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

Returns the super Class<GUM_SCALAR> of this Class<GUM_SCALAR>.

Returns
Returns the super Class<GUM_SCALAR> of this Class<GUM_SCALAR>.
Exceptions
NotFoundRaised if this has no super Class<GUM_SCALAR>.

Definition at line 1111 of file PRMClass_tpl.h.

1111 {
1112 if (_superClass_) {
1113 return *_superClass_;
1114 } else {
1115 GUM_ERROR(NotFound, "this Class is not a subclass")
1116 }
1117 }

References PRMClass(), _superClass_, and GUM_ERROR.

Referenced by PRMClass(), PRMClass(), _addIOInterfaceFlags_(), _implementInterfaces_(), completeInheritance(), and overload().

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

◆ updateDescendants_()

template<typename GUM_SCALAR>
void gum::prm::PRMClass< 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 971 of file PRMClass_tpl.h.

971 {
972 // for ( const auto ext : _extensions_ ) {
973 // // We test to prevent unnecessary recursive call from iter
974 // if ( !ext->isOutputNode( elt ) ) {
975 // ext->setOutputNode( elt, true );
976 // }
977 //}
978 }

◆ PRMInterface< GUM_SCALAR >

template<typename GUM_SCALAR>
friend class PRMInterface< GUM_SCALAR >
friend

Member Data Documentation

◆ _aggregates_

template<typename GUM_SCALAR>
Set< PRMAggregate< GUM_SCALAR >* > gum::prm::PRMClass< GUM_SCALAR >::_aggregates_
private

The sequence of aggregate.

Definition at line 370 of file PRMClass.h.

Referenced by _overloadAggregate_(), add(), aggregates(), and inheritAggregates().

◆ _attributes_

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

◆ _bijection_

template<typename GUM_SCALAR>
Bijection< const DiscreteVariable*, const DiscreteVariable* >* gum::prm::PRMClass< GUM_SCALAR >::_bijection_
private

The bijection between variables in super and variables in this The bijection's firsts are attributes in this and its seconds are attributes in c.

Definition at line 407 of file PRMClass.h.

Referenced by PRMClass(), PRMClass(), PRMClass(), PRMClass(), completeInheritance(), and inheritAggregates().

◆ _dag_

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

◆ _dummy_hashfunc_

template<typename GUM_SCALAR>
HashFunc< PRMClassElementContainer< GUM_SCALAR >* > gum::prm::PRMClass< GUM_SCALAR >::_dummy_hashfunc_
private

a dummy member used to fix a compilation issue in clang4

Definition at line 410 of file PRMClass.h.

◆ _extensions_

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

The set of Class<GUM_SCALAR> which are extension of this Class<GUM_SCALAR> (i.e. direct subtypes).

Definition at line 402 of file PRMClass.h.

Referenced by _addExtension_(), extensions(), and findAllSubtypes_().

◆ _implements_

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

◆ _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::PRMClass< 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 361 of file PRMClass.h.

Referenced by _addCastDescendants_(), _addCastDescendants_(), _overloadAggregate_(), _overloadAttribute_(), _overloadParameter_(), _overloadReference_(), add(), addArc(), get(), get(), inheritAggregates(), and overload().

◆ _nodeIdMap_

template<typename GUM_SCALAR>
NodeProperty< PRMClassElement< GUM_SCALAR >* > gum::prm::PRMClass< 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 351 of file PRMClass.h.

Referenced by ~PRMClass(), _addCastDescendants_(), _addCastDescendants_(), _checkInterface_(), _checkRefInterface_(), _overloadAttribute_(), _overloadParameter_(), _overloadReference_(), add(), get(), get(), inheritAggregates(), and inheritReferenceSlots().

◆ _parameters_

template<typename GUM_SCALAR>
Set< PRMParameter< GUM_SCALAR >* > gum::prm::PRMClass< GUM_SCALAR >::_parameters_
private

The Set of parameters in this Class<GUM_SCALAR>.

Definition at line 376 of file PRMClass.h.

Referenced by _overloadParameter_(), add(), and parameters().

◆ _referenceSlots_

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

The sequence of PRMReferenceSlot<GUM_SCALAR>.

Definition at line 367 of file PRMClass.h.

Referenced by _overloadReference_(), add(), inheritReferenceSlots(), and referenceSlots().

◆ _slotChains_

template<typename GUM_SCALAR>
Set< PRMSlotChain< GUM_SCALAR >* > gum::prm::PRMClass< GUM_SCALAR >::_slotChains_
private

The set of gum::PRMSlotChain<GUM_SCALAR>s.

Definition at line 373 of file PRMClass.h.

Referenced by _overloadReference_(), add(), and slotChains().

◆ _superClass_

template<typename GUM_SCALAR>
PRMClass< GUM_SCALAR >* gum::prm::PRMClass< GUM_SCALAR >::_superClass_
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 395 of file PRMClass.h.

Referenced by PRMClass(), PRMClass(), PRMClass(), PRMClass(), _implementInterfaces_(), completeInheritance(), inheritAggregates(), inheritAttributes(), inheritParameters(), inheritReferenceSlots(), inheritSlotChains(), initializeInheritance(), isOutputNode(), and super().


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