aGrUM 2.3.2
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 (const std::string &name)
 Default constructor.
virtual ~PRMClassElementContainer ()
 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 (const std::string &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 (const std::string &name)=0
 Getter on a member of this PRMClassElementContainer.
virtual const PRMClassElement< GUM_SCALAR > & get (const std::string &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 (const std::string &tail, const std::string &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[] (const std::string &name)=0
 Getter on a member of this PRMClassElementContainer.
virtual const PRMClassElement< GUM_SCALAR > & operator[] (const std::string &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 (const std::string &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<typename 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 88 of file PRMObject.h.

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

Constructor & Destructor Documentation

◆ PRMClassElementContainer() [1/2]

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

Default constructor.

Definition at line 65 of file PRMClassElementContainer_tpl.h.

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

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(), copyIOFlags_(), gum::prm::PRMClass< GUM_SCALAR >::findAllSubtypes_(), findAllSubtypes_(), gum::prm::PRMInterface< GUM_SCALAR >::findAllSubtypes_(), gum::prm::PRMClass< GUM_SCALAR >::inheritReferenceSlots(), 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<typename GUM_SCALAR>
INLINE gum::prm::PRMClassElementContainer< GUM_SCALAR >::~PRMClassElementContainer ( )
virtual

Destructor.

Definition at line 71 of file PRMClassElementContainer_tpl.h.

References PRMClassElementContainer().

Here is the call graph for this function:

◆ PRMClassElementContainer() [2/2]

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

Copy constructor. Don't use it.

Definition at line 83 of file PRMClassElementContainer_tpl.h.

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

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

Here is the call graph for this function:

Member Function Documentation

◆ add()

template<typename 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 >, gum::prm::PRMClass< double >, 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<typename GUM_SCALAR>
virtual void gum::prm::PRMClassElementContainer< GUM_SCALAR >::addArc ( const std::string & tail,
const std::string & head )
pure virtual

Add an arc between two PRMClassElement<GUM_SCALAR>.

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

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

Here is the caller graph for this function:

◆ belongsTo()

template<typename GUM_SCALAR>
INLINE 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 190 of file PRMClassElementContainer_tpl.h.

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

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

Here is the call graph for this function:

◆ containerDag()

template<typename GUM_SCALAR>
INLINE const DAG & gum::prm::PRMClassElementContainer< GUM_SCALAR >::containerDag ( ) const
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 198 of file PRMClassElementContainer_tpl.h.

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

References dag_().

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

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

◆ copyIOFlags_()

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

Copy the IO Flags of c in this PRMClassElementContainer.

Parameters
cA PRMClassElementContainer.

Definition at line 57 of file PRMClassElementContainer_tpl.h.

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

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

Here is the call graph for this function:

◆ dag_() [1/2]

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

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

Referenced by containerDag().

Here is the caller graph for this function:

◆ dag_() [2/2]

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

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

Returns the string representation of a PRMObject.

Definition at line 95 of file PRMObject.h.

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

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

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

Here is the caller graph for this function:

◆ exists() [1/2]

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

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

Definition at line 182 of file PRMClassElementContainer_tpl.h.

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

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

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

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

◆ exists() [2/2]

template<typename GUM_SCALAR>
INLINE bool gum::prm::PRMClassElementContainer< GUM_SCALAR >::exists ( NodeId id) const
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 177 of file PRMClassElementContainer_tpl.h.

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

References containerDag().

Here is the call graph for this function:

◆ findAllSubtypes_()

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

References PRMClassElementContainer().

Here is the call graph for this function:

◆ get() [1/4]

template<typename GUM_SCALAR>
virtual const PRMClassElement< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::get ( const std::string & 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() [2/4]

template<typename GUM_SCALAR>
virtual PRMClassElement< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::get ( const std::string & 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 gum::prm::PRMClassElementContainer< double >::isInputNode().

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

◆ get() [3/4]

template<typename 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() [4/4]

template<typename 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 >.

◆ getIOFlag_() [1/2]

template<typename GUM_SCALAR>
INLINE 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 148 of file PRMClassElementContainer_tpl.h.

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

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

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

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

◆ getIOFlag_() [2/2]

template<typename GUM_SCALAR>
INLINE const std::pair< bool, bool > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::getIOFlag_ ( const PRMClassElement< GUM_SCALAR > & elt) const
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 158 of file PRMClassElementContainer_tpl.h.

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

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

Here is the call graph for this function:

◆ isClass()

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

Returns true if obj_ptr is of type Class.

Definition at line 114 of file PRMObject.h.

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

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

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

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

◆ isInnerNode()

template<typename GUM_SCALAR>
INLINE bool gum::prm::PRMClassElementContainer< GUM_SCALAR >::isInnerNode ( const PRMClassElement< GUM_SCALAR > & elt) const
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 134 of file PRMClassElementContainer_tpl.h.

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

References getIOFlag_().

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

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

◆ isInputNode()

template<typename GUM_SCALAR>
INLINE bool gum::prm::PRMClassElementContainer< GUM_SCALAR >::isInputNode ( const PRMClassElement< GUM_SCALAR > & elt) const
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 90 of file PRMClassElementContainer_tpl.h.

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

◆ isInstance()

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

Returns true if obj_ptr is of type PRMInstance.

Definition at line 122 of file PRMObject.h.

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

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

Here is the call graph for this function:

◆ isInterface()

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

Returns true if obj_ptr is of type PRMInterface.

Definition at line 117 of file PRMObject.h.

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

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

Here is the call graph for this function:

◆ isOutputNode()

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

◆ isSubTypeOf()

template<typename 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 >, gum::prm::PRMClass< double >, 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<typename GUM_SCALAR>
INLINE 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 142 of file PRMClassElementContainer_tpl.h.

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

References PRMClassElementContainer(), and isSubTypeOf().

Here is the call graph for this function:

◆ LEFT_CAST()

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

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

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

Definition at line 90 of file PRMObject.h.

90{ return "("; }

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

Here is the caller graph for this function:

◆ name() [1/2]

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

Returns the name of this object.

Definition at line 54 of file PRMObject_inl.h.

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

References _name_.

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

◆ name() [2/2]

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

Change the name of the PRM Object.

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

Definition at line 58 of file PRMObject_inl.h.

58{ _name_ = name; }

References _name_, and name().

Here is the call graph for this function:

◆ obj_type()

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

◆ operator!=()

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

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

Definition at line 66 of file PRMObject_inl.h.

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

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

Here is the call graph for this function:

◆ operator=()

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

Copy operator. Don't use it.

Definition at line 77 of file PRMClassElementContainer_tpl.h.

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

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

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

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

Here is the call graph for this function:

◆ operator[]() [1/4]

template<typename GUM_SCALAR>
virtual const PRMClassElement< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator[] ( const std::string & 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[]() [2/4]

template<typename GUM_SCALAR>
virtual PRMClassElement< GUM_SCALAR > & gum::prm::PRMClassElementContainer< GUM_SCALAR >::operator[] ( const std::string & 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:

◆ operator[]() [3/4]

template<typename 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[]() [4/4]

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

◆ overload()

template<typename 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 >, gum::prm::PRMClass< double >, 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()

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

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

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

Definition at line 92 of file PRMObject.h.

92{ return ")"; }

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

Here is the caller graph for this function:

◆ setInputNode()

template<typename GUM_SCALAR>
INLINE void gum::prm::PRMClassElementContainer< GUM_SCALAR >::setInputNode ( const PRMClassElement< GUM_SCALAR > & elt,
bool b )
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 98 of file PRMClassElementContainer_tpl.h.

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

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

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

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

◆ setIOFlag_()

template<typename GUM_SCALAR>
INLINE void gum::prm::PRMClassElementContainer< GUM_SCALAR >::setIOFlag_ ( const PRMClassElement< GUM_SCALAR > & elt,
const std::pair< bool, bool > & flags )
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 169 of file PRMClassElementContainer_tpl.h.

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

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

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

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

◆ setOutputNode()

template<typename GUM_SCALAR>
INLINE void gum::prm::PRMClassElementContainer< GUM_SCALAR >::setOutputNode ( const PRMClassElement< GUM_SCALAR > & elt,
bool b )
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 114 of file PRMClassElementContainer_tpl.h.

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

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

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

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

◆ updateDescendants_()

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

Referenced by setOutputNode().

Here is the caller graph for this function:

◆ PRMClassElementContainterConstIterator

template<typename GUM_SCALAR>
friend class PRMClassElementContainterConstIterator
friend

◆ PRMClassElementContainterIterator

template<typename GUM_SCALAR>
friend class PRMClassElementContainterIterator
friend

Member Data Documentation

◆ _IOFlags_

template<typename 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_(), and setIOFlag_().

◆ _name_

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

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