aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
gum::prm::PRMClassElementContainer< GUM_SCALAR > Class Template Referenceabstract

<agrum/PRM/classElementContainer.h> More...

#include <PRMClassElementContainer.h>

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

Public Member Functions

Protected constructors & destructor.
 PRMClassElementContainer (std::string_view name)
 Default constructor.
 ~PRMClassElementContainer () override
 Destructor.
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 PRMClassElement< GUM_SCALAR > & get (std::string_view name)=0
 Getter on a member of this PRMClassElementContainer.
virtual const PRMClassElement< GUM_SCALAR > & get (std::string_view name) const =0
 Constant getter on a member of this PRMClassElementContainer.
virtual NodeId add (PRMClassElement< GUM_SCALAR > *elt)=0
 Add a PRMClassElement<GUM_SCALAR> to this PRMClassElementContainer.
virtual NodeId overload (PRMClassElement< GUM_SCALAR > *elt)=0
 Add a PRMClassElement<GUM_SCALAR> which overload an inherited PRMClassElement<GUM_SCALAR>.
virtual void addArc (std::string_view tail, std::string_view head)=0
 Add an arc between two PRMClassElement<GUM_SCALAR>.
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 bool isOutputNode (const PRMClassElement< GUM_SCALAR > &elt) const =0
 Returns true if the node is an output node.
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 const DAGcontainerDag () const
 Returns the gum::DAG of this PRMClassElementContainer.
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 PRMClassElement< GUM_SCALAR > & get (NodeId id)=0
 Getter on a member of this PRMClassElementContainer.
virtual const PRMClassElement< GUM_SCALAR > & get (NodeId id) const =0
 Constant getter on a member of this PRMClassElementContainer.
Getters & setters operators
virtual PRMClassElement< GUM_SCALAR > & operator[] (NodeId id)=0
 Getter on a member of this PRMClassElementContainer.
virtual const PRMClassElement< GUM_SCALAR > & operator[] (NodeId id) const =0
 Constant getter on a member of this PRMClassElementContainer.
virtual PRMClassElement< GUM_SCALAR > & operator[] (std::string_view name)=0
 Getter on a member of this PRMClassElementContainer.
virtual const PRMClassElement< GUM_SCALAR > & operator[] (std::string_view name) const =0
 Constant getter on a member of this PRMClassElementContainer.
Inheritance getters and setters
virtual bool isSubTypeOf (const PRMClassElementContainer< GUM_SCALAR > &cec) const =0
 Test if this PRMClassElementContainer is a subtype of cec.
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.
virtual prm_type obj_type () const =0
 Returns the type of this 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

PRMClassElementContainer< GUM_SCALAR > & operator= (const PRMClassElementContainer< GUM_SCALAR > &source)
 Copy operator. Don't use it.
 PRMClassElementContainer (const PRMClassElementContainer< GUM_SCALAR > &source)
 Copy constructor. Don't use it.
virtual const DAGdag_ () const =0
virtual DAGdag_ ()=0
 Returns a non constant reference over this PRMClassElementContainer's DAG.
virtual void findAllSubtypes_ (Set< PRMClassElementContainer< GUM_SCALAR > * > &set)=0
 Fills set with all the subtypes of this PRMInterface, this includes extensions and implementations.
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.
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 descendant of this PRMClassElementContainer. Note that after its declaration, input flags can not be changed and output flags can only become true.

Private Attributes

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

Friends

class PRMClassElementContainterIterator
class PRMClassElementContainterConstIterator

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::PRMClassElementContainer< GUM_SCALAR >

<agrum/PRM/classElementContainer.h>

Abstract class for classes containing gum::PRMClassElement<GUM_SCALAR>.

To print a PRMClassElementContainer you can use the following operator: gum::operator<<(std::ostream&, const PRMClassElementContainer&) which print the PRMClassElementContainer in the graphviz-dot format.

Definition at line 79 of file PRMClassElementContainer.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

◆ PRMClassElementContainer() [1/2]

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

Default constructor.

Definition at line 65 of file PRMClassElementContainer_tpl.h.

65 :
68 }
<agrum/PRM/classElementContainer.h>
PRMClassElementContainer(std::string_view name)
Default constructor.
PRMObject(std::string_view name)
Constructor.
Definition PRMObject.cpp:62
const std::string & name() const
Returns the name of this object.

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

Referenced by gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), gum::prm::PRMClass< GUM_SCALAR >::PRMClass(), PRMClassElementContainer(), PRMClassElementContainer(), gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface(), gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface(), gum::prm::PRMInterface< GUM_SCALAR >::PRMInterface(), ~PRMClassElementContainer(), gum::prm::PRMClass< GUM_SCALAR >::_inheritClass_(), gum::prm::PRMInterface< GUM_SCALAR >::_inheritInterface_(), copyIOFlags_(), gum::prm::PRMClass< GUM_SCALAR >::findAllSubtypes_(), findAllSubtypes_(), gum::prm::PRMInterface< GUM_SCALAR >::findAllSubtypes_(), gum::prm::PRMClass< GUM_SCALAR >::inheritReferenceSlots(), gum::prm::PRMClass< GUM_SCALAR >::isSubTypeOf(), isSubTypeOf(), gum::prm::PRMInterface< GUM_SCALAR >::isSubTypeOf(), isSuperTypeOf(), gum::prm::PRMClass< GUM_SCALAR >::operator=(), and operator=().

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

◆ ~PRMClassElementContainer()

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRMClassElementContainer< GUM_SCALAR >::~PRMClassElementContainer ( )
override

Destructor.

Definition at line 71 of file PRMClassElementContainer_tpl.h.

References PRMClassElementContainer().

Here is the call graph for this function:

◆ PRMClassElementContainer() [2/2]

template<GUM_Numeric GUM_SCALAR>
gum::prm::PRMClassElementContainer< GUM_SCALAR >::PRMClassElementContainer ( const PRMClassElementContainer< GUM_SCALAR > & source)
protected

Copy constructor. Don't use it.

Definition at line 82 of file PRMClassElementContainer_tpl.h.

83 : PRMObject(source) {
85 GUM_ERROR(FatalError, "illegal call to ClassElementContainer copy constructor")
86 }
#define GUM_ERROR(type, msg)
Definition exceptions.h:76

References PRMClassElementContainer(), gum::prm::PRMObject::PRMObject(), and GUM_ERROR.

Here is the call graph for this function:

Member Function Documentation

◆ add()

template<GUM_Numeric GUM_SCALAR>
virtual NodeId gum::prm::PRMClassElementContainer< GUM_SCALAR >::add ( PRMClassElement< GUM_SCALAR > * elt)
pure virtual

Add a PRMClassElement<GUM_SCALAR> to this PRMClassElementContainer.

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

The NodeId of elt is defined when it is added to this, discarding any previous value.

If you want to overload an inherited PRMClassElement<GUM_SCALAR> call Class::overload().

When adding an PRMAttribute or an PRMAggregate its type safe name is automatically added, the syntax is <type>name. So you can either use its type safe name or its real name. See the ref prm_typ_inh "type inheritance section" for further details.

Parameters
eltThe PRMClassElement<GUM_SCALAR> added to this Class.
Returns
Returns the NodeId assigned to elt.
Exceptions
DuplicateElementRaised if elt's name is already used in this class.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::_addParent_(), gum::prm::PRMFactory< GUM_SCALAR >::addReferenceSlot(), and gum::prm::PRMFactory< GUM_SCALAR >::startAttribute().

Here is the caller graph for this function:

◆ addArc()

template<GUM_Numeric GUM_SCALAR>
virtual void gum::prm::PRMClassElementContainer< GUM_SCALAR >::addArc ( std::string_view tail,
std::string_view head )
pure virtual

Add an arc between two PRMClassElement<GUM_SCALAR>.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

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

Here is the caller graph for this function:

◆ belongsTo()

template<GUM_Numeric GUM_SCALAR>
bool gum::prm::PRMClassElementContainer< GUM_SCALAR >::belongsTo ( const PRMClassElement< GUM_SCALAR > & elt) const
virtual

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

◆ containerDag()

template<GUM_Numeric GUM_SCALAR>
const DAG & gum::prm::PRMClassElementContainer< GUM_SCALAR >::containerDag ( ) const
virtual

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

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.
virtual void setIOFlag_(const PRMClassElement< GUM_SCALAR > &elt, const std::pair< bool, bool > &flags)
Defines the IO flags of a PRMClassElement<GUM_SCALAR>.

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

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>
virtual const DAG & gum::prm::PRMClassElementContainer< GUM_SCALAR >::dag_ ( ) const
protectedpure virtual

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

Referenced by containerDag().

Here is the caller graph for this function:

◆ dag_() [2/2]

template<GUM_Numeric GUM_SCALAR>
virtual DAG & gum::prm::PRMClassElementContainer< GUM_SCALAR >::dag_ ( )
protectedpure virtual

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

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

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

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
virtual const DAG & containerDag() const
Returns the gum::DAG of this PRMClassElementContainer.

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
virtual

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:

◆ findAllSubtypes_()

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

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

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

References PRMClassElementContainer().

Here is the call graph for this function:

◆ get() [1/4]

template<GUM_Numeric GUM_SCALAR>
virtual const PRMClassElement< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::get ( NodeId id) const
pure virtual

Constant getter on a member of this PRMClassElementContainer.

Parameters
idThe member's id.
Returns
Returns a constant reference on the member.
Exceptions
NotFoundRaised if no attribute matches name.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

◆ get() [2/4]

template<GUM_Numeric GUM_SCALAR>
virtual PRMClassElement< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::get ( NodeId id)
pure virtual

Getter on a member of this PRMClassElementContainer.

Parameters
idThe member's id.
Returns
Returns a constant reference on the member.
Exceptions
NotFoundRaised if no attribute matches name.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

◆ get() [3/4]

template<GUM_Numeric GUM_SCALAR>
virtual const PRMClassElement< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::get ( std::string_view name) const
pure virtual

Constant getter on a member of this PRMClassElementContainer.

Parameters
nameThe member's name.
Returns
Returns a constant reference on the member.
Exceptions
NotFoundRaised if no attribute matches name.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

References gum::prm::PRMObject::name().

Here is the call graph for this function:

◆ get() [4/4]

template<GUM_Numeric GUM_SCALAR>
virtual PRMClassElement< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::get ( std::string_view name)
pure virtual

Getter on a member of this PRMClassElementContainer.

Parameters
nameThe member's name.
Returns
Returns a constant reference on the member.
Exceptions
NotFoundRaised if no attribute matches name.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

References gum::prm::PRMObject::name().

Referenced by gum::prm::ClassDependencyGraph< GUM_SCALAR >::_addArcs_(), gum::prm::PRMFactory< GUM_SCALAR >::_addParent_(), gum::prm::PRMFactory< GUM_SCALAR >::_buildSlotChain_(), belongsTo(), gum::prm::PRMFactory< GUM_SCALAR >::continueAggregator(), gum::prm::PRMFactory< GUM_SCALAR >::continueAttribute(), copyIOFlags_(), exists(), and operator<<().

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

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
protectedvirtual

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:

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

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
virtual

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>
virtual bool gum::prm::PRMClassElementContainer< GUM_SCALAR >::isOutputNode ( const PRMClassElement< GUM_SCALAR > & elt) const
pure virtual

Returns true if the node is an output 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.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

◆ isSubTypeOf()

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

Test if this PRMClassElementContainer is a subtype of cec.

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

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

References PRMClassElementContainer().

Referenced by isSuperTypeOf().

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
virtual

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

virtual prm_type gum::prm::PRMObject::obj_type ( ) const
pure virtualinherited

Returns the type of this object.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, gum::prm::PRMClassElement< GUM_SCALAR >, gum::prm::PRMInstance< GUM_SCALAR >, gum::prm::PRMInterface< GUM_SCALAR >, gum::prm::PRMSystem< GUM_SCALAR >, gum::prm::PRMSystem< double >, and gum::prm::PRMType.

References PRMObject().

Referenced by gum::prm::PRMFactory< GUM_SCALAR >::_checkStack_(), gum::prm::PRMFactory< GUM_SCALAR >::_checkStackContainter_(), gum::prm::PRMSystem< double >::enum2str(), isInstance(), gum::prm::PRMClass< GUM_SCALAR >::isSubTypeOf(), and gum::prm::PRMInterface< GUM_SCALAR >::isSubTypeOf().

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

template<GUM_Numeric GUM_SCALAR>
PRMClassElementContainer< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator= ( const PRMClassElementContainer< GUM_SCALAR > & source)
protected

Copy operator. Don't use it.

Definition at line 76 of file PRMClassElementContainer_tpl.h.

77 {
78 GUM_ERROR(FatalError, "illegal call to ClassElementContainer copy operator")
79 }

References PRMClassElementContainer(), and GUM_ERROR.

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>
virtual const PRMClassElement< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator[] ( NodeId id) const
pure virtual

Constant getter on a member of this PRMClassElementContainer.

Parameters
idThe member's id.
Returns
Returns a constant reference on the member.
Exceptions
NotFoundRaised if no attribute matches name.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

◆ operator[]() [2/4]

template<GUM_Numeric GUM_SCALAR>
virtual PRMClassElement< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator[] ( NodeId id)
pure virtual

Getter on a member of this PRMClassElementContainer.

Parameters
idThe member's id.
Returns
Returns a constant reference on the member.
Exceptions
NotFoundRaised if no attribute matches name.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

◆ operator[]() [3/4]

template<GUM_Numeric GUM_SCALAR>
virtual const PRMClassElement< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator[] ( std::string_view name) const
pure virtual

Constant getter on a member of this PRMClassElementContainer.

Parameters
nameThe member's name.
Returns
Returns a constant reference on the member.
Exceptions
NotFoundRaised if no attribute matches name.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

References gum::prm::PRMObject::name().

Here is the call graph for this function:

◆ operator[]() [4/4]

template<GUM_Numeric GUM_SCALAR>
virtual PRMClassElement< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator[] ( std::string_view name)
pure virtual

Getter on a member of this PRMClassElementContainer.

Parameters
nameThe member's name.
Returns
Returns a constant reference on the member.
Exceptions
NotFoundRaised if no attribute matches name.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

References gum::prm::PRMObject::name().

Here is the call graph for this function:

◆ overload()

template<GUM_Numeric GUM_SCALAR>
virtual NodeId gum::prm::PRMClassElementContainer< GUM_SCALAR >::overload ( PRMClassElement< GUM_SCALAR > * elt)
pure virtual

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

The pointer is "given" to this class, which will delete it when ~PRMClassElementContainer() is called.

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

You can only overload inherited PRMClassElement<GUM_SCALAR> and only if elt is a subtype of the inherited PRMClassElement<GUM_SCALAR>. Thus you can only overload PRMReferenceSlot and PRMAttribute. In the case of PRMAttribute you can overload an inherited PRMAttribute even if they are of the same type: this is useful when you want to redefine the dependencies of an PRMAttribute or its CPF. You can also overload an PRMAttribute with an PRMAggregate, as long as their respective PRMType allow it.

Parameters
eltThe PRMClassElement<GUM_SCALAR> overloading an inherited PRMClassElement<GUM_SCALAR> in this PRMClassElementContainer.
Returns
the NodeId assigned to elt.
Exceptions
OperationNotAllowedRaised if overloading is illegal.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

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

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:

◆ setInputNode()

template<GUM_Numeric GUM_SCALAR>
void gum::prm::PRMClassElementContainer< GUM_SCALAR >::setInputNode ( const PRMClassElement< GUM_SCALAR > & elt,
bool b )
virtual

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 }
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...

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

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

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:

◆ updateDescendants_()

template<GUM_Numeric GUM_SCALAR>
virtual void gum::prm::PRMClassElementContainer< GUM_SCALAR >::updateDescendants_ ( const PRMClassElement< GUM_SCALAR > & elt)
protectedpure virtual

When a PRMClassElement<GUM_SCALAR> becomes an Output node we must update any the IO flags of every descendant of this PRMClassElementContainer. Note that after its declaration, input flags can not be changed and output flags can only become true.

Parameters
eltA PRMClassElement<GUM_SCALAR>.

Implemented in gum::prm::PRMClass< GUM_SCALAR >, and gum::prm::PRMInterface< GUM_SCALAR >.

Referenced by setOutputNode().

Here is the caller graph for this function:

◆ PRMClassElementContainterConstIterator

template<GUM_Numeric GUM_SCALAR>
friend class PRMClassElementContainterConstIterator
friend

◆ PRMClassElementContainterIterator

template<GUM_Numeric GUM_SCALAR>
friend class PRMClassElementContainterIterator
friend

Member Data Documentation

◆ _IOFlags_

template<GUM_Numeric GUM_SCALAR>
HashTable< std::string, std::pair< bool, bool > > gum::prm::PRMClassElementContainer< GUM_SCALAR >::_IOFlags_
private

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==().


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