aGrUM 3.0.0
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 (std::string_view name)
 Default constructor.
 PRMClass (std::string_view name, PRMClass< GUM_SCALAR > &super, bool delayInheritance=false)
 Constructor for building a subclass of super.
 PRMClass (std::string_view name, const Set< PRMInterface< GUM_SCALAR > * > &set, bool delayInheritance=false)
 Constructor for building a Class<GUM_SCALAR> implementing several each interface in set.
 PRMClass (std::string_view 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.
 ~PRMClass () override
 Destructor.
PRMObject::prm_type obj_type () const override
 Implementation of pure virtual method of PRMObject.
Graphical operator
PRMClassElement< GUM_SCALAR > & get (NodeId id) override
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
const PRMClassElement< GUM_SCALAR > & get (NodeId id) const override
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).
PRMClassElement<GUM_SCALAR> getters and setters
bool isOutputNode (const PRMClassElement< GUM_SCALAR > &elt) const override
 Returns true if elt is an output node.
bool isCastDescendant (std::string_view safe_name) const
 Return true if the attribute named safe_name is a cast descendant.
PRMClassElement< GUM_SCALAR > & get (std::string_view name) override
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
const PRMClassElement< GUM_SCALAR > & get (std::string_view name) const override
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(const std::string&).
NodeId add (PRMClassElement< GUM_SCALAR > *elt) override
 See gum::prm::add(PRMClassElement<GUM_SCALAR>*).
NodeId overload (PRMClassElement< GUM_SCALAR > *elt) override
 See gum::prm::overload(PRMClassElement<GUM_SCALAR>*).
void addArc (std::string_view tail, std::string_view head) override
 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
bool isSubTypeOf (const PRMClassElementContainer< GUM_SCALAR > &cec) const override
 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) override
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).
const PRMClassElement< GUM_SCALAR > & operator[] (NodeId id) const override
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](NodeId).
PRMClassElement< GUM_SCALAR > & operator[] (std::string_view name) override
 See gum::prm::PRMClassElementContainer<GUM_SCALAR>::operator[](const std::string&).
const PRMClassElement< GUM_SCALAR > & operator[] (std::string_view name) const override
 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 (std::string_view 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 (std::string_view 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 (std::string_view name)
 Change the name of the PRM Object.
Operators
bool operator== (const PRMObject &obj) const
 To PRMObject are equal if they have the same name (which is unique).
bool operator!= (const PRMObject &obj) const
 To PRMObject are equal if they have the same name (which is unique).

Protected Member Functions

const DAGdag_ () const override
 returns a constant reference over this interface's dag.
DAGdag_ () override
 Returns a non constant reference over this PRMInterface<GUM_SCALAR>'s DAG.
void findAllSubtypes_ (Set< PRMClassElementContainer< GUM_SCALAR > * > &set) override
 Fills set with all the subtypes of this Class<GUM_SCALAR>.
void updateDescendants_ (const PRMClassElement< GUM_SCALAR > &elt) override
 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<GUM_Numeric 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 77 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 90 of file PRMObject.h.

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

Constructor & Destructor Documentation

◆ PRMClass() [1/6]

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRMClass< GUM_SCALAR >::PRMClass ( std::string_view name)
explicit

Default constructor.

Parameters
nameThe class name.

Definition at line 60 of file PRMClass_tpl.h.

60 :
62 _bijection_(nullptr) {
64 }
PRMClassElementContainer(std::string_view 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:77
PRMClass< GUM_SCALAR > * _superClass_
The alternate PRMClassElementContainer<GUM_SCALAR> searched for elements defined in this....
Definition PRMClass.h:395
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
PRMClass(std::string_view name)
Default constructor.
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_(), isSubTypeOf(), operator=(), operator=(), PRMInterface< GUM_SCALAR >, and super().

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

◆ PRMClass() [2/6]

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRMClass< GUM_SCALAR >::PRMClass ( std::string_view 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 67 of file PRMClass_tpl.h.

69 :
73 if (!delayInheritance) {
74 _dag_ = super.containerDag();
76 }
77 }
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<GUM_Numeric GUM_SCALAR>
gum::prm::PRMClass< GUM_SCALAR >::PRMClass ( std::string_view 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 80 of file PRMClass_tpl.h.

82 :
86
88 }
void _implementInterfaces_(bool delayInheritance)
Proceed with the implementation of interfaces.
friend class PRMInterface< GUM_SCALAR >
Definition PRMClass.h:78

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

Here is the call graph for this function:

◆ PRMClass() [4/6]

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRMClass< GUM_SCALAR >::PRMClass ( std::string_view 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 91 of file PRMClass_tpl.h.

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

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<GUM_Numeric 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<GUM_Numeric 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<GUM_Numeric GUM_SCALAR>
gum::prm::PRMClass< GUM_SCALAR >::~PRMClass ( )
override

Destructor.

Definition at line 133 of file PRMClass_tpl.h.

133 {
135
136 for (const auto& elt: _nodeIdMap_) {
137 delete elt.second;
138 }
139
140 if (_implements_) { delete _implements_; }
141
142 if (_bijection_) { delete _bijection_; }
143 }
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(), _bijection_, _implements_, and _nodeIdMap_.

Here is the call graph for this function:

Member Function Documentation

◆ _addCastDescendants_() [1/2]

template<GUM_Numeric 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 907 of file PRMClass_tpl.h.

908 {
911
912 while (parent->type().superType() != end->type()) {
913 child = parent->getCastDescendant();
914 child->setId(nextNodeId());
915 _nodeIdMap_.insert(child->id(), child);
916 _dag_.addNodeWithId(child->id());
917 // Only use child's safe name when adding to the name map!
918 _nameMap_.insert(child->safeName(), child);
919 _attributes_.insert(child);
921 // Do not use Class<GUM_SCALAR>::insertArc(), child's CPF is already
922 // initialized properly
923 _dag_.addArc(parent->id(), child->id());
924 parent = child;
925 }
926
927 parent->setAsCastDescendant(end);
928 _dag_.addArc(parent->id(), end->id());
929 }
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<GUM_Numeric 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 678 of file PRMClass_tpl.h.

678 {
679 auto parent = attr;
681
682 while (parent->type().isSubType()) {
683 child = parent->getCastDescendant();
684
685 // Check if id was reserved by one of the class interfaces
686 bool found = false;
687 if (_implements_ != nullptr) {
688 for (auto i: implements()) {
689 if (i->exists(child->safeName())) {
690 child->setId(i->get(child->safeName()).id());
691 found = true;
692 break;
693 }
694 }
695 }
696 if (!found) {
697 child->setId(nextNodeId());
698 _dag_.addNodeWithId(child->id());
699 }
700 _nodeIdMap_.insert(child->id(), child);
701 // Only use child's safe name when adding to the name map!
702 _nameMap_.insert(child->safeName(), child);
703 _attributes_.insert(child);
704 // Do not use Class<GUM_SCALAR>::insertArc(), child's CPF is already
705 // initialized properly
706 _dag_.addArc(parent->id(), child->id());
707
708 parent = child;
709 }
710 }
virtual bool exists(std::string_view name) const
Returns true if a member with the given name exists in this PRMClassElementContainer or in the PRMCla...
const Set< PRMInterface< GUM_SCALAR > * > & implements() const
Returns the Set of PRMInterface<GUM_SCALAR> implemented by this Class<GUM_SCALAR>.
PRMClassElement< GUM_SCALAR > & get(NodeId id) override
See gum::prm::PRMClassElementContainer<GUM_SCALAR>::get(NodeId).

References _attributes_, _dag_, _implements_, _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<GUM_Numeric GUM_SCALAR>
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 1186 of file PRMClass_tpl.h.

1186 {
1187 _extensions_.insert(c);
1188 }
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<GUM_Numeric 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 941 of file PRMClass_tpl.h.

941 {
942 // We only add IO Flags if elt matches is required by and interface
943 if (_implements_ != nullptr) {
944 for (const auto impl: *_implements_) {
946 while (super) {
947 // If the attribute is defined in an interface, we set it as an
948 // OutputNode
949 if (impl->exists(elt->name())) {
950 try {
951 this->getIOFlag_(*elt).second = true;
952 } catch (NotFound const&) { this->setIOFlag_(*elt, std::make_pair(false, true)); }
953 }
954 super = super->_superInterface_ ? &(super->super()) : nullptr;
955 }
956 }
957 }
958 }
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<GUM_Numeric 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 532 of file PRMClass_tpl.h.

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

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<GUM_Numeric 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 523 of file PRMClass_tpl.h.

523 {
524 if (_implements_ != nullptr) {
525 for (auto i: implements()) {
526 if (i->exists(elt->name())) { _checkInterface_(elt, i); }
527 }
528 }
529 }
void _checkInterface_(PRMClassElement< GUM_SCALAR > *elt, PRMInterface< GUM_SCALAR > *i)
Check that a given element respects a specific interface.

References _checkInterface_(), _implements_, 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<GUM_Numeric GUM_SCALAR>
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 1143 of file PRMClass_tpl.h.

1145 {
1146 if (overloaded->elt_type() != overloader->elt_type()) { return false; }
1147
1148 switch (overloaded->elt_type()) {
1150 if (!overloader->type().isSubTypeOf(overloaded->type())) { return false; }
1151 break;
1152 }
1153
1155 const auto& new_slot_type
1156 = static_cast< const PRMReferenceSlot< GUM_SCALAR >* >(overloader)->slotType();
1157 const auto& old_slot_type
1158 = static_cast< const PRMReferenceSlot< GUM_SCALAR >* >(overloaded)->slotType();
1159
1160 if (!new_slot_type.isSubTypeOf(old_slot_type)) { return false; }
1161
1162 break;
1163 }
1164
1166 auto overloaded_param = static_cast< const PRMParameter< GUM_SCALAR >* >(overloaded);
1167 auto overloader_param = static_cast< const PRMParameter< GUM_SCALAR >* >(overloader);
1168
1169 return overloaded_param->valueType() == overloader_param->valueType();
1170 break;
1171 }
1172
1173 default : {
1174 return false;
1175 }
1176 }
1177 return true;
1178 }

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<GUM_Numeric 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 581 of file PRMClass_tpl.h.

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

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<GUM_Numeric 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 572 of file PRMClass_tpl.h.

572 {
573 if (_implements_ != nullptr) {
574 for (auto i: implements()) {
575 if (i->exists(ref->name())) { _checkRefInterface_(ref, i); }
576 }
577 }
578 }
void _checkRefInterface_(PRMReferenceSlot< GUM_SCALAR > *elt, PRMInterface< GUM_SCALAR > *i)
Check that a given element respects a specific interface.

References _checkRefInterface_(), _implements_, 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<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::_implementInterfaces_ ( bool delayInheritance)
private

Proceed with the implementation of interfaces.

Definition at line 116 of file PRMClass_tpl.h.

116 {
117 for (const auto impl: *_implements_) {
118 impl->_addImplementation_(this);
120 // Reserve reference id in DAG
121 for (auto ref: impl->referenceSlots()) {
122 _dag_.addNodeWithId(ref->id());
123 }
124 // Reserve attribute id in DAG
125 for (auto attr: impl->attributes()) {
126 _dag_.addNodeWithId(attr->id());
127 }
128 }
129 }
130 }
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(), PRMClass(), and initializeInheritance().

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

◆ _inheritClass_()

template<GUM_Numeric 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 317 of file PRMClass_tpl.h.

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

Referenced by PRMClass(), and PRMClass().

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

◆ _overloadAggregate_()

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

Overloads an aggregate.

Definition at line 1136 of file PRMClass_tpl.h.

1137 {
1138 _nameMap_.insert(overloader->safeName(), overloader);
1139 _aggregates_.insert(overloader);
1140 }

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<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::_overloadAttribute_ ( PRMAttribute< GUM_SCALAR > * overloader,
PRMAttribute< GUM_SCALAR > * overloaded )
private

Overloads an attribute.

Definition at line 774 of file PRMClass_tpl.h.

775 {
776 _dag_.eraseParents(overloaded->id());
777
778 // Checking if we have to add cast descendant
779 if (overloader->type() != overloaded->type()) {
780 overloader->setId(nextNodeId());
781 _dag_.addNodeWithId(overloader->id());
782 _nodeIdMap_.insert(overloader->id(), overloader);
784 _nameMap_.insert(overloader->safeName(), overloader);
785 _attributes_.insert(overloader);
787 } else {
788 overloader->setId(overloaded->id());
791 _nameMap_[overloader->safeName()] = overloader;
793 _attributes_.insert(overloader);
795 delete overloaded;
796 }
797 }
void _addCastDescendants_(PRMClassElement< GUM_SCALAR > *attr)
Recursively adds cast descendant of attr in this Class<GUM_SCALAR>.
NodeId overload(PRMClassElement< GUM_SCALAR > *elt) override
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<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::_overloadParameter_ ( PRMParameter< GUM_SCALAR > * overloader,
PRMParameter< GUM_SCALAR > * overloaded )
private

Overloads a parameter.

Definition at line 895 of file PRMClass_tpl.h.

896 {
897 overloader->setId(overloaded->id());
900 _nameMap_[overloader->safeName()] = overloader;
902 _parameters_.insert(overloader);
903 delete overloaded;
904 }

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<GUM_Numeric 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 800 of file PRMClass_tpl.h.

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

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<GUM_Numeric GUM_SCALAR>
NodeId gum::prm::PRMClass< GUM_SCALAR >::add ( PRMClassElement< GUM_SCALAR > * elt)
overridevirtual

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

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

Definition at line 605 of file PRMClass_tpl.h.

605 {
606 if (_nameMap_.exists(elt->name())) {
608 "name " << elt->name() << " already used by another ClassElement");
609 }
610
611 elt->setId(nextNodeId());
612 _dag_.addNodeWithId(elt->id());
613 _nodeIdMap_.insert(elt->id(), elt);
614 _nameMap_.insert(elt->name(), elt);
615
616 try {
617 _nameMap_.insert(elt->safeName(), elt);
618 } catch (DuplicateElement& e) {
621 throw DuplicateElement(e);
622 }
623 }
624
625 switch (elt->elt_type()) {
627 _attributes_.insert(static_cast< PRMAttribute< GUM_SCALAR >* >(elt));
629
630 // Update attribute or cast descendant id to respect implemented
631 // interface
633
635 break;
636 }
637
639 _aggregates_.insert(static_cast< PRMAggregate< GUM_SCALAR >* >(elt));
641
642 // Update attribute or cast descendant id to respect implemented
643 // interface
645
647 break;
648 }
649
651 auto ref = static_cast< PRMReferenceSlot< GUM_SCALAR >* >(elt);
652 _referenceSlots_.insert(ref);
653
654 // Updating ref's id if ref implements an interface
656 break;
657 }
658
660 _slotChains_.insert(static_cast< PRMSlotChain< GUM_SCALAR >* >(elt));
661 break;
662 }
663
665 _parameters_.insert(static_cast< PRMParameter< GUM_SCALAR >* >(elt));
666 break;
667 }
668
669 default : {
670 GUM_ERROR(FatalError, "unknown ClassElement<GUM_SCALAR> type")
671 }
672 }
673
674 return elt->id();
675 }
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<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::addArc ( std::string_view tail,
std::string_view head )
overridevirtual

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

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

Definition at line 482 of file PRMClass_tpl.h.

482 {
483 auto p_tail = _nameMap_.tryGet(tail_name);
484 auto p_head = _nameMap_.tryGet(head_name);
485
486 if (!p_tail || !p_head) {
487 GUM_ERROR(NotFound, "tail and/or head of arc does not exists in this Class")
488 }
491
495 "a PRMReferenceSlot<GUM_SCALAR> can "
496 "not on neither side of an arc");
497 }
498
502 "illegal insertion of an arc between two SlotChain<GUM_SCALAR>")
503 }
504
505 if (!_dag_.existsArc(Arc(tail->id(), head->id()))) {
506 _dag_.addArc(tail->id(), head->id());
507 } else {
508 GUM_ERROR(DuplicateElement, "duplicate arc " << tail_name << "->" << head_name)
509 }
510
511 get(tail->id()).addChild(get(head->id()));
512 get(head->id()).addParent(get(tail->id()));
513
514 // Defining input / output nodes
517 this->setInputNode(*head, true);
518 sc->end().setOutputNode(sc->end().get(sc->lastElt().safeName()), true);
519 }
520 }
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<GUM_Numeric GUM_SCALAR>
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 1082 of file PRMClass_tpl.h.

1082 {
1083 return _aggregates_;
1084 }

References _aggregates_.

◆ attributes()

template<GUM_Numeric GUM_SCALAR>
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 1020 of file PRMClass_tpl.h.

1020 {
1021 return _attributes_;
1022 }

References _attributes_.

◆ belongsTo()

template<GUM_Numeric GUM_SCALAR>
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 191 of file PRMClassElementContainer_tpl.h.

192 {
193 try {
194 return &elt == &(get(elt.safeName()));
195 } catch (NotFound const&) { return false; }
196 }
<agrum/PRM/classElementContainer.h>
virtual PRMClassElement< GUM_SCALAR > & get(std::string_view 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<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::completeInheritance ( std::string_view attr)

Definition at line 296 of file PRMClass_tpl.h.

296 {
297 if (_superClass_) {
298 auto& elt = this->get(name);
301 GUM_ERROR(OperationNotAllowed, "you can only complete inheritance for attributes")
302 }
303
304 for (const auto& prnt: super().containerDag().parents(elt.id())) {
305 this->addArc(super().get(prnt).safeName(), elt.safeName());
306 }
307
309 auto& attr = static_cast< PRMAttribute< GUM_SCALAR >& >(elt);
310 auto& super_attr = static_cast< const PRMAttribute< GUM_SCALAR >& >(super().get(name));
311 attr.copyCpf(*_bijection_, super_attr);
312 }
313 }
314 }
void addArc(std::string_view tail, std::string_view head) override
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<GUM_Numeric GUM_SCALAR>
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 199 of file PRMClassElementContainer_tpl.h.

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

References dag_().

Referenced by gum::prm::ClassDependencyGraph< GUM_SCALAR >::_addArcs_(), gum::prm::PRMClass< GUM_SCALAR >::_inheritClass_(), 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 operator<<().

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

◆ copyIOFlags_()

template<GUM_Numeric 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 58 of file PRMClassElementContainer_tpl.h.

59 {
60 for (const auto& flag: c._IOFlags_)
61 setIOFlag_(get(flag.first), flag.second);
62 }
HashTable< std::string, std::pair< bool, bool > > _IOFlags_
input / output flags, useful when inheriting or copying.

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

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

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

◆ dag_() [1/2]

template<GUM_Numeric GUM_SCALAR>
const DAG & gum::prm::PRMClass< GUM_SCALAR >::dag_ ( ) const
overrideprotectedvirtual

returns a constant reference over this interface's dag.

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

Definition at line 976 of file PRMClass_tpl.h.

976 {
977 return _dag_;
978 }

References _dag_.

◆ dag_() [2/2]

template<GUM_Numeric GUM_SCALAR>
DAG & gum::prm::PRMClass< GUM_SCALAR >::dag_ ( )
overrideprotectedvirtual

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

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

Definition at line 981 of file PRMClass_tpl.h.

981 {
982 return _dag_;
983 }

References _dag_.

◆ enum2str()

INLINE std::string gum::prm::PRMObject::enum2str ( prm_type type)
staticinherited

Returns the string representation of a PRMObject.

Definition at line 75 of file PRMObject_inl.h.

75 {
76 switch (type) {
77 case prm_type::CLASS : return "PRMType::CLASS";
78
79 case prm_type::CLASS_ELT : return "PRMType::CLASS_ELT";
80
81 case prm_type::TYPE : return "PRMType::TYPE";
82
83 case prm_type::SYSTEM : return "PRMType::SYSTEM";
84
85 case prm_type::INSTANCE : return "PRMType::INSTANCE";
86
87 case prm_type::PRM_INTERFACE : return "PRMType::PRM_INTERFACE";
88
89 default : return "unknown";
90 }
91 }

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<GUM_Numeric GUM_SCALAR>
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 178 of file PRMClassElementContainer_tpl.h.

178 {
179 return containerDag().exists(id);
180 }
bool exists(const NodeId id) const
alias for existsNode

References containerDag().

Here is the call graph for this function:

◆ exists() [2/2]

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMClassElementContainer< GUM_SCALAR >::exists ( std::string_view name) const
virtualinherited

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

Definition at line 183 of file PRMClassElementContainer_tpl.h.

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

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

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::_addParent_(), gum::prm::PRMFactory< GUM_SCALAR >::_buildSlotChain_(), gum::prm::PRMClass< GUM_SCALAR >::_checkInterface_(), gum::prm::PRMFactory< GUM_SCALAR >::_checkInterfaceImplementation_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkLocalParent_(), gum::prm::o3prm::O3SystemFactory< GUM_SCALAR >::_checkParameters_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkRawCPT_(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::_checkSlotChainLink_(), gum::prm::ClassBayesNet< GUM_SCALAR >::_init_(), gum::prm::PRMFactory< GUM_SCALAR >::_retrieveInputs_(), 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:

◆ extensions()

template<GUM_Numeric GUM_SCALAR>
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 1181 of file PRMClass_tpl.h.

1181 {
1182 return _extensions_;
1183 }

References _extensions_.

◆ findAllSubtypes_()

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

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

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

Definition at line 932 of file PRMClass_tpl.h.

933 {
934 for (auto ext: _extensions_) {
935 set.insert(ext);
937 }
938 }
void findAllSubtypes_(Set< PRMClassElementContainer< GUM_SCALAR > * > &set) override
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<GUM_Numeric GUM_SCALAR>
const PRMClassElement< GUM_SCALAR > & gum::prm::PRMClass< GUM_SCALAR >::get ( NodeId id) const
overridevirtual

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

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

Definition at line 993 of file PRMClass_tpl.h.

993 {
994 auto p = _nodeIdMap_.tryGet(id);
995 if (!p) {
996 GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> with the given NodeId (" << id << ")");
997 }
998 return **p;
999 }

References _nodeIdMap_, and GUM_ERROR.

◆ get() [2/4]

◆ get() [3/4]

template<GUM_Numeric GUM_SCALAR>
const PRMClassElement< GUM_SCALAR > & gum::prm::PRMClass< GUM_SCALAR >::get ( std::string_view name) const
overridevirtual

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

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

Definition at line 1011 of file PRMClass_tpl.h.

1011 {
1012 auto p = _nameMap_.tryGet(name);
1013 if (!p) {
1014 GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> with the given name (" << name << ")");
1015 }
1016 return **p;
1017 }

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

Here is the call graph for this function:

◆ get() [4/4]

template<GUM_Numeric GUM_SCALAR>
PRMClassElement< GUM_SCALAR > & gum::prm::PRMClass< GUM_SCALAR >::get ( std::string_view name)
overridevirtual

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

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

Definition at line 1002 of file PRMClass_tpl.h.

1002 {
1003 auto p = _nameMap_.tryGet(name);
1004 if (!p) {
1005 GUM_ERROR(NotFound, "no ClassElement<GUM_SCALAR> with the given name (" << name << ")");
1006 }
1007 return **p;
1008 }

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

Here is the call graph for this function:

◆ getIOFlag_() [1/2]

template<GUM_Numeric GUM_SCALAR>
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 151 of file PRMClassElementContainer_tpl.h.

152 {
153 auto p = _IOFlags_.tryGet(elt.safeName());
154 if (!p) GUM_ERROR(NotFound, "this ClassElement<GUM_SCALAR> does not have any IO flags")
155 return *p;
156 }

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

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

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

◆ getIOFlag_() [2/2]

template<GUM_Numeric GUM_SCALAR>
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 159 of file PRMClassElementContainer_tpl.h.

160 {
161 auto p = _IOFlags_.tryGet(elt.safeName());
162 if (!p) GUM_ERROR(NotFound, "this ClassElement<GUM_SCALAR> does not have any IO flags")
163 return *p;
164 }

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

Here is the call graph for this function:

◆ implements()

template<GUM_Numeric GUM_SCALAR>
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 1106 of file PRMClass_tpl.h.

1106 {
1107 if (_implements_) {
1108 return *_implements_;
1109 } else {
1110 GUM_ERROR(NotFound, "this Class does not implement any Interface<GUM_SCALAR>")
1111 }
1112 }

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<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::inheritAggregates ( )

Definition at line 237 of file PRMClass_tpl.h.

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

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<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::inheritAttributes ( )

Definition at line 209 of file PRMClass_tpl.h.

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

References _attributes_, _bijection_, _dag_, _nameMap_, _nodeIdMap_, and _superClass_.

◆ inheritParameters()

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

Definition at line 190 of file PRMClass_tpl.h.

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

References _dag_, _nameMap_, _nodeIdMap_, _parameters_, and _superClass_.

◆ inheritReferenceSlots()

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

Definition at line 164 of file PRMClass_tpl.h.

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

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

Here is the call graph for this function:

◆ inheritSlotChains()

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

Definition at line 268 of file PRMClass_tpl.h.

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

References _bijection_, _dag_, _nameMap_, _nodeIdMap_, _slotChains_, and _superClass_.

◆ initializeInheritance()

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

Definition at line 146 of file PRMClass_tpl.h.

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

References _implementInterfaces_(), _implements_, and _superClass_.

Here is the call graph for this function:

◆ isCastDescendant()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMClass< GUM_SCALAR >::isCastDescendant ( std::string_view 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 1191 of file PRMClass_tpl.h.

1191 {
1193
1194 try {
1195 return elt.type().name() == get(elt.name()).type().name();
1196 } catch (OperationNotAllowed const&) {
1197 GUM_ERROR(NotFound, "no attribute with the given name")
1198 }
1199 }

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)
staticinherited

Returns true if obj_ptr is of type Class.

Definition at line 93 of file PRMObject_inl.h.

93 {
94 return obj.obj_type() == prm_type::CLASS;
95 }

References PRMObject().

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<GUM_Numeric GUM_SCALAR>
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 137 of file PRMClassElementContainer_tpl.h.

138 {
139 auto p = _IOFlags_.tryGet(elt.safeName());
140 if (!p) return true;
141 return !(p->first || p->second);
142 }

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

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<GUM_Numeric GUM_SCALAR>
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 89 of file PRMClassElementContainer_tpl.h.

90 {
91 auto p = _IOFlags_.tryGet(elt.safeName());
92 if (!p) return false;
93 return p->first;
94 }

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

Here is the call graph for this function:

◆ isInstance()

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

Returns true if obj_ptr is of type PRMInstance.

Definition at line 101 of file PRMObject_inl.h.

101 {
102 return obj.obj_type() == prm_type::INSTANCE;
103 }

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

Here is the call graph for this function:

◆ isInterface()

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

Returns true if obj_ptr is of type PRMInterface.

Definition at line 97 of file PRMObject_inl.h.

97 {
98 return obj.obj_type() == prm_type::PRM_INTERFACE;
99 }

◆ isOutputNode()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMClass< GUM_SCALAR >::isOutputNode ( const PRMClassElement< GUM_SCALAR > & elt) const
overridevirtual

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 1202 of file PRMClass_tpl.h.

1202 {
1203 try {
1204 if (!this->getIOFlag_(elt).second) {
1205 if (_implements_) {
1206 for (auto i: *_implements_) {
1207 if (i->isOutputNode(elt)) { return true; }
1208 }
1209 }
1210
1211 if (_superClass_ && (_superClass_->isOutputNode(elt))) { return true; }
1212
1213 } else {
1214 return true;
1215 }
1216 } catch (NotFound const&) {}
1217 return false;
1218 }
bool isOutputNode(const PRMClassElement< GUM_SCALAR > &elt) const override
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<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMClass< GUM_SCALAR >::isSubTypeOf ( const PRMClassElementContainer< GUM_SCALAR > & cec) const
overridevirtual

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 446 of file PRMClass_tpl.h.

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

References PRMClass(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer(), _implements_, _superClass_, gum::prm::PRMObject::CLASS, GUM_ERROR, gum::prm::PRMObject::obj_type(), gum::prm::PRMObject::PRM_INTERFACE, and PRMInterface< GUM_SCALAR >.

Referenced by _implementInterfaces_().

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

◆ isSuperTypeOf()

template<GUM_Numeric GUM_SCALAR>
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 145 of file PRMClassElementContainer_tpl.h.

146 {
147 return cec.isSubTypeOf(*this);
148 }
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()

INLINE std::string gum::prm::PRMObject::LEFT_CAST ( )
staticinherited

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 71 of file PRMObject_inl.h.

71{ 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 57 of file PRMObject_inl.h.

57{ return _name_; }
std::string _name_
Definition PRMObject.h:193

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::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::PRMSlotChain< GUM_SCALAR >::_copyLastElt_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundAgg_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundRef_(), gum::prm::PRMSystem< GUM_SCALAR >::_groundTensor_(), gum::prm::PRMSystem< double >::_groundTensor_(), gum::prm::PRMClass< GUM_SCALAR >::_inheritClass_(), gum::prm::PRMClass< GUM_SCALAR >::_overloadAttribute_(), gum::prm::PRMInterface< 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::PRMAggregate< GUM_SCALAR >::getCastDescendant(), 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< 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!=(), 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::PRMInterface< GUM_SCALAR >::operator[](), gum::prm::PRMClass< GUM_SCALAR >::overload(), gum::prm::PRMInterface< GUM_SCALAR >::overload(), gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainterConstIterator, gum::prm::PRMFormAttribute< GUM_SCALAR >::setAsCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::setAsCastDescendant(), 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 ( std::string_view name)
inherited

Change the name of the PRM Object.

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

Definition at line 61 of file PRMObject_inl.h.

61{ _name_ = name; }

References _name_, and name().

Here is the call graph for this function:

◆ obj_type()

template<GUM_Numeric GUM_SCALAR>
PRMObject::prm_type gum::prm::PRMClass< GUM_SCALAR >::obj_type ( ) const
overridevirtual

Implementation of pure virtual method of PRMObject.

Implements gum::prm::PRMObject.

Definition at line 971 of file PRMClass_tpl.h.

971 {
973 }

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 69 of file PRMObject_inl.h.

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

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

Here is the call graph for this function:

◆ operator=() [1/2]

template<GUM_Numeric 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<GUM_Numeric 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 65 of file PRMObject_inl.h.

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

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

Here is the call graph for this function:

◆ operator[]() [1/4]

template<GUM_Numeric GUM_SCALAR>
const PRMClassElement< GUM_SCALAR > & gum::prm::PRMClass< GUM_SCALAR >::operator[] ( NodeId id) const
overridevirtual

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

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

Definition at line 1120 of file PRMClass_tpl.h.

1120 {
1121 return get(id);
1122 }

References get().

Here is the call graph for this function:

◆ operator[]() [2/4]

template<GUM_Numeric GUM_SCALAR>
PRMClassElement< GUM_SCALAR > & gum::prm::PRMClass< GUM_SCALAR >::operator[] ( NodeId id)
overridevirtual

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

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

Definition at line 1115 of file PRMClass_tpl.h.

1115 {
1116 return get(id);
1117 }

References get().

Here is the call graph for this function:

◆ operator[]() [3/4]

template<GUM_Numeric GUM_SCALAR>
const PRMClassElement< GUM_SCALAR > & gum::prm::PRMClass< GUM_SCALAR >::operator[] ( std::string_view name) const
overridevirtual

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

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

Definition at line 1131 of file PRMClass_tpl.h.

1131 {
1132 return get(name);
1133 }

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

Here is the call graph for this function:

◆ operator[]() [4/4]

template<GUM_Numeric GUM_SCALAR>
PRMClassElement< GUM_SCALAR > & gum::prm::PRMClass< GUM_SCALAR >::operator[] ( std::string_view name)
overridevirtual

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

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

Definition at line 1125 of file PRMClass_tpl.h.

1125 {
1126 return get(name);
1127 }

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

Here is the call graph for this function:

◆ overload()

template<GUM_Numeric GUM_SCALAR>
NodeId gum::prm::PRMClass< GUM_SCALAR >::overload ( PRMClassElement< GUM_SCALAR > * elt)
overridevirtual

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

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

Definition at line 713 of file PRMClass_tpl.h.

713 {
714 if (!_superClass_) {
715 GUM_ERROR(OperationNotAllowed, "overload is possible only with subclasses")
716 }
717 if (!super().exists(overloader->name())) {
718 GUM_ERROR(OperationNotAllowed, "found no ClassElement<GUM_SCALAR> to overload")
719 }
720
722 if (overloaded == overloader) {
723 GUM_ERROR(DuplicateElement, "dupplicate ClassElement " << overloader->name())
724 }
725 // Checking overload legality
727 GUM_ERROR(OperationNotAllowed, "illegal overload")
728 }
729
730 switch (overloader->elt_type()) {
736 break;
737 }
738
742 break;
743 }
744
746 // _checkOverloadLegality_ guaranties that overloaded is a
747 // PRMReferenceSlot<GUM_SCALAR>
751 break;
752 }
753
755 GUM_ERROR(OperationNotAllowed, "SlotChain<GUM_SCALAR> can not be overloaded")
756 break;
757 }
758
763 break;
764 }
765 default : {
766 GUM_ERROR(OperationNotAllowed, "unknown ClassElement<GUM_SCALAR> type")
767 }
768 }
769
770 return overloader->id();
771 }
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_(), _superClass_, 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<GUM_Numeric GUM_SCALAR>
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 1025 of file PRMClass_tpl.h.

1025 {
1026 return _parameters_;
1027 }

References _parameters_.

Referenced by scope().

Here is the caller graph for this function:

◆ referenceSlots()

template<GUM_Numeric GUM_SCALAR>
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 1087 of file PRMClass_tpl.h.

1087 {
1088 return _referenceSlots_;
1089 }

References _referenceSlots_.

Referenced by scope().

Here is the caller graph for this function:

◆ RIGHT_CAST()

INLINE std::string gum::prm::PRMObject::RIGHT_CAST ( )
staticinherited

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 73 of file PRMObject_inl.h.

73{ 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<GUM_Numeric GUM_SCALAR>
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 1043 of file PRMClass_tpl.h.

1043 {
1045
1046 for (const auto p: parameters()) {
1047 params.insert(p->name(), p);
1048 }
1049
1051
1052 for (const auto ref: referenceSlots()) {
1053 if (PRMObject::isClass(ref->slotType())) {
1054 queue.push(ParamScopeData< GUM_SCALAR >("", *ref, 1));
1055 }
1056 }
1057
1058 while (!queue.empty()) {
1059 auto data = queue.front();
1060 queue.pop();
1061
1062 if (data.depth < 5) {
1063 for (const auto p: data.c->parameters()) {
1064 params.insert(data.prefix + p->name(), p);
1065 }
1066
1067 for (const auto ref: data.c->referenceSlots()) {
1068 if (PRMObject::isClass(ref->slotType())) {
1069 queue.push(ParamScopeData< GUM_SCALAR >(data.prefix, *ref, data.depth + 1));
1070 }
1071 }
1072 } else {
1073 // @todo depth>5 is a workaround. Cycle detection is needed here !
1074 GUM_ERROR(FatalError, "Depth limit reached when looking up parameters")
1075 }
1076 }
1077
1078 return params;
1079 }
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<GUM_Numeric GUM_SCALAR>
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 97 of file PRMClassElementContainer_tpl.h.

99 {
100 if (!exists(elt.safeName())) {
101 GUM_ERROR(NotFound, ": <" + elt.safeName() + "> is not in <" + name() + ">")
104 if (auto p = _IOFlags_.tryGet(elt.safeName())) {
105 p->first = b;
106 } else {
107 setIOFlag_(elt, std::make_pair(b, false));
108 }
109 } else {
110 GUM_ERROR(WrongClassElement, "given id is not an PRMAttribute or an PRMAggregate")
111 }
112 }

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

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<GUM_Numeric GUM_SCALAR>
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 168 of file PRMClassElementContainer_tpl.h.

169 {
170 if (auto p = _IOFlags_.tryGet(elt.safeName())) {
171 *p = flags;
172 } else {
173 _IOFlags_.insert(elt.safeName(), flags);
174 }
175 }

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

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

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

◆ setOutputNode()

template<GUM_Numeric GUM_SCALAR>
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 115 of file PRMClassElementContainer_tpl.h.

117 {
118 if (!exists(elt.safeName())) {
119 GUM_ERROR(NotFound, "<" + elt.safeName() + "> is not in <" + name() + ">")
122 if (auto p = _IOFlags_.tryGet(elt.safeName())) {
123 p->second = b;
124 } else {
125 setIOFlag_(elt, std::make_pair(false, b));
126 }
127
128 if (b) { updateDescendants_(elt); }
129 } else {
131 "given ClassElement<GUM_SCALAR> is not an "
132 "PRMAttribute or an PRMAggregate");
133 }
134 }
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 _IOFlags_, exists(), 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<GUM_Numeric GUM_SCALAR>
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 1092 of file PRMClass_tpl.h.

1092 {
1093 return _slotChains_;
1094 }

References _slotChains_.

◆ super()

template<GUM_Numeric GUM_SCALAR>
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 1097 of file PRMClass_tpl.h.

1097 {
1098 if (_superClass_) {
1099 return *_superClass_;
1100 } else {
1101 GUM_ERROR(NotFound, "this Class is not a subclass")
1102 }
1103 }

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<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMClass< GUM_SCALAR >::updateDescendants_ ( const PRMClassElement< GUM_SCALAR > & elt)
overrideprotectedvirtual

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

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

Definition at line 961 of file PRMClass_tpl.h.

961 {
962 // for ( const auto ext : _extensions_ ) {
963 // // We test to prevent unnecessary recursive call from iter
964 // if ( !ext->isOutputNode( elt ) ) {
965 // ext->setOutputNode( elt, true );
966 // }
967 //}
968 }

◆ PRMInterface< GUM_SCALAR >

template<GUM_Numeric GUM_SCALAR>
friend class PRMInterface< GUM_SCALAR >
friend

Member Data Documentation

◆ _aggregates_

template<GUM_Numeric 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 _inheritClass_(), _overloadAggregate_(), add(), aggregates(), and inheritAggregates().

◆ _attributes_

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

◆ _bijection_

template<GUM_Numeric 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(), ~PRMClass(), completeInheritance(), inheritAggregates(), inheritAttributes(), and inheritSlotChains().

◆ _dag_

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

◆ _dummy_hashfunc_

template<GUM_Numeric 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<GUM_Numeric 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<GUM_Numeric GUM_SCALAR>
Set< PRMInterface< GUM_SCALAR >* >* gum::prm::PRMClass< GUM_SCALAR >::_implements_
private

◆ _IOFlags_

template<GUM_Numeric 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_(), isInnerNode(), isInputNode(), setInputNode(), setIOFlag_(), and setOutputNode().

◆ _name_

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

Definition at line 193 of file PRMObject.h.

Referenced by PRMObject(), PRMObject(), PRMObject(), name(), name(), operator!=(), operator=(), and operator==().

◆ _nameMap_

template<GUM_Numeric GUM_SCALAR>
HashTable< std::string, PRMClassElement< GUM_SCALAR >* > gum::prm::PRMClass< GUM_SCALAR >::_nameMap_
private

◆ _nodeIdMap_

template<GUM_Numeric 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_(), _inheritClass_(), _overloadAttribute_(), _overloadParameter_(), _overloadReference_(), add(), get(), get(), inheritAggregates(), inheritAttributes(), inheritParameters(), inheritReferenceSlots(), and inheritSlotChains().

◆ _parameters_

template<GUM_Numeric 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 _inheritClass_(), _overloadParameter_(), add(), inheritParameters(), and parameters().

◆ _referenceSlots_

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

◆ _slotChains_

template<GUM_Numeric 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 _inheritClass_(), _overloadReference_(), add(), inheritSlotChains(), and slotChains().

◆ _superClass_

template<GUM_Numeric 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_(), _inheritClass_(), completeInheritance(), inheritAggregates(), inheritAttributes(), inheritParameters(), inheritReferenceSlots(), inheritSlotChains(), initializeInheritance(), isOutputNode(), isSubTypeOf(), overload(), and super().


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