![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
A PRMReferenceSlot represent a relation between two PRMClassElementContainer. More...
#include <PRMObject.h>
Public Member Functions | |
Protected constructors & destructor. | |
PRMReferenceSlot (const std::string &name, PRMClassElementContainer< GUM_SCALAR > &type, bool isArray=false) | |
Default constructor. More... | |
virtual | ~PRMReferenceSlot () |
Destructor. More... | |
Getters & setters | |
virtual PRMClassElement< GUM_SCALAR >::ClassElementType | elt_type () const |
Implementation of the pure virtual method of PRMObject. More... | |
PRMClassElementContainer< GUM_SCALAR > & | slotType () |
Returns the type of this slot, which is a PRMClassElementContainer (it is not the type of PRMObject). More... | |
const PRMClassElementContainer< GUM_SCALAR > & | slotType () const |
Returns the type of this slot, which is a PRMClassElementContainer (it is not the type of PRMObject). More... | |
bool | isArray () const |
Returns true if this reference slot is an array. More... | |
virtual void | addParent (const PRMClassElement< GUM_SCALAR > &elt) |
See gum::PRMClassElement::addParent(). More... | |
virtual void | addChild (const PRMClassElement< GUM_SCALAR > &elt) |
See gum::PRMClassElement::addChild(). More... | |
Not allowed operations on a PRMReferenceSlot. | |
virtual PRMType & | type () |
Raise an OperationNotAllowed. See gum::PRMClassElement::type(). More... | |
virtual const PRMType & | type () const |
Raise an OperationNotAllowed. See gum::PRMClassElement::type(). More... | |
virtual Potential< GUM_SCALAR > & | cpf () |
Raise an OperationNotAllowed. See gum::PRMClassElement::cpf(). More... | |
virtual const Potential< GUM_SCALAR > & | cpf () const |
Raise an OperationNotAllowed. See gum::PRMClassElement::cpf(). More... | |
virtual PRMAttribute< GUM_SCALAR > * | getCastDescendant () const |
Raise an OperationNotAllowed. See gum::PRMClassElement::getCastDescendant(). More... | |
Getters & setters | |
NodeId | id () const |
Returns the NodeId of this element in it's class DAG. More... | |
virtual void | setId (NodeId id) |
Used to assign the id of this element. More... | |
virtual PRMObject::prm_type | obj_type () const |
Fast access to random variable's properties | |
const std::string & | safeName () const |
Returns the safe name of this PRMClassElement, if any. More... | |
virtual std::string | cast (const PRMType &t) const |
Returns the name of the cast descendant with PRMType t of this PRMClassElement. More... | |
Getters & setters. | |
const std::string & | name () const |
Returns the name of this object. More... | |
void | name (const std::string &name) |
Change the name of the PRM Object. More... | |
Operators | |
bool | operator== (const PRMObject &obj) const |
To PRMObject are equal if they have the same name (which is unique). More... | |
bool | operator!= (const PRMObject &obj) const |
To PRMObject are equal if they have the same name (which is unique). More... | |
Protected Attributes | |
std::string | safeName_ |
The safe name of this PRMClassElement. More... | |
Built-in type | |
enum | ClassElementType { prm_attribute, prm_aggregate, prm_refslot, prm_slotchain, prm_parameter } |
Returns true if obj_ptr is of type PRMReferenceSlot. More... | |
static std::string | enum2str (ClassElementType type) |
Returns true if obj_ptr is of type PRMReferenceSlot. More... | |
static INLINE bool | isReferenceSlot (const PRMClassElement< GUM_SCALAR > &elt) |
Returns true if obj_ptr is of type PRMReferenceSlot. More... | |
static INLINE bool | isAttribute (const PRMClassElement< GUM_SCALAR > &elt) |
Returns true if obj_ptr is of type PRMAttribute. More... | |
static INLINE bool | isAggregate (const PRMClassElement< GUM_SCALAR > &elt) |
Return true if obj is of type PRMAggregate. More... | |
static INLINE bool | isSlotChain (const PRMClassElement< GUM_SCALAR > &elt) |
Return true if obj is of type PRMSlotChain. More... | |
static INLINE bool | isParameter (const PRMClassElement< GUM_SCALAR > &elt) |
Return true if obj is of type PRMParameter. More... | |
Built-in types. | |
enum | prm_type : char { prm_type::ALL, prm_type::CLASS, prm_type::PRM_INTERFACE, prm_type::CLASS_ELT, prm_type::TYPE, prm_type::SYSTEM, prm_type::INSTANCE } |
Enumeration of the different types of objects handled by a PRM. More... | |
static std::string | enum2str (prm_type type) |
Returns the string representation of a PRMObject. More... | |
static std::string | LEFT_CAST () |
Enumeration of the different types of objects handled by a PRM. More... | |
static std::string | RIGHT_CAST () |
Enumeration of the different types of objects handled by a PRM. More... | |
static INLINE bool | isClass (const PRMObject &obj) |
Returns true if obj_ptr is of type Class. More... | |
static INLINE bool | isInterface (const PRMObject &obj) |
Returns true if obj_ptr is of type PRMInterface. More... | |
static INLINE bool | isInstance (const PRMObject &obj) |
Returns true if obj_ptr is of type PRMInstance. More... | |
A PRMReferenceSlot represent a relation between two PRMClassElementContainer.
A reference slot is a relation between two PRMClassElementContainer in a PRM. A PRMReferenceSlot is considered as an element of a PRMClassElementContainer which slot type is a PRMClassElementContainer.
A PRMReferenceSlot is defined by it's slot type (i.e. it's range), it's PRMClassElementContainer (it's domain), it's name and if it is a multiple reference (the isArray() flag).
Definition at line 228 of file PRMObject.h.
|
inherited |
Returns true if obj_ptr is of type PRMReferenceSlot.
Enumerator | |
---|---|
prm_attribute | |
prm_aggregate | |
prm_refslot | |
prm_slotchain | |
prm_parameter |
Definition at line 94 of file PRMClassElement.h.
|
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 68 of file PRMObject.h.
gum::prm::PRMReferenceSlot< GUM_SCALAR >::PRMReferenceSlot | ( | const std::string & | name, |
PRMClassElementContainer< GUM_SCALAR > & | type, | ||
bool | isArray = false |
||
) |
Default constructor.
name | The name of this element. |
type | The type of this reference slot. |
isArray | Determine if this reference slot is multiple or not. |
Definition at line 34 of file PRMReferenceSlot_tpl.h.
|
virtual |
Destructor.
Definition at line 45 of file PRMReferenceSlot_tpl.h.
|
private |
Copy constructor. Don't use it.
Definition at line 50 of file PRMReferenceSlot_tpl.h.
|
virtual |
See gum::PRMClassElement::addChild().
Implements gum::prm::PRMClassElement< GUM_SCALAR >.
Definition at line 117 of file PRMReferenceSlot_tpl.h.
|
virtual |
See gum::PRMClassElement::addParent().
Implements gum::prm::PRMClassElement< GUM_SCALAR >.
Definition at line 114 of file PRMReferenceSlot_tpl.h.
|
virtualinherited |
Returns the name of the cast descendant with PRMType t of this PRMClassElement.
t | The type in which we want to cast this PRMClassElement. |
OperationNotAllowed | If the cast is impossible. |
Definition at line 71 of file PRMClassElement_tpl.h.
|
virtual |
Raise an OperationNotAllowed. See gum::PRMClassElement::cpf().
Definition at line 97 of file PRMReferenceSlot_tpl.h.
|
virtual |
Raise an OperationNotAllowed. See gum::PRMClassElement::cpf().
Implements gum::prm::PRMClassElement< GUM_SCALAR >.
Definition at line 102 of file PRMReferenceSlot_tpl.h.
|
virtual |
Implementation of the pure virtual method of PRMObject.
Implements gum::prm::PRMClassElement< GUM_SCALAR >.
Definition at line 66 of file PRMReferenceSlot_tpl.h.
|
inlinestaticinherited |
|
inlinestaticinherited |
Returns true if obj_ptr is of type PRMReferenceSlot.
Definition at line 103 of file PRMClassElement.h.
|
virtual |
Raise an OperationNotAllowed. See gum::PRMClassElement::getCastDescendant().
Implements gum::prm::PRMClassElement< GUM_SCALAR >.
Definition at line 107 of file PRMReferenceSlot_tpl.h.
|
inherited |
Returns the NodeId of this element in it's class DAG.
Definition at line 51 of file PRMClassElement_tpl.h.
|
inlinestaticinherited |
INLINE bool gum::prm::PRMReferenceSlot< GUM_SCALAR >::isArray | ( | ) | const |
Returns true if this reference slot is an array.
Definition at line 82 of file PRMReferenceSlot_tpl.h.
|
inlinestaticinherited |
Returns true if obj_ptr is of type Class.
Definition at line 109 of file PRMObject.h.
References gum::prm::PRMObject::PRMObject().
Returns true if obj_ptr is of type PRMInstance.
Definition at line 117 of file PRMObject.h.
References gum::prm::PRMObject::PRMObject().
Returns true if obj_ptr is of type PRMInterface.
Definition at line 112 of file PRMObject.h.
References gum::prm::PRMObject::PRMObject().
|
inlinestaticinherited |
|
inlinestaticinherited |
Returns true if obj_ptr is of type PRMReferenceSlot.
Definition at line 126 of file PRMClassElement.h.
|
inlinestaticinherited |
|
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 79 of file PRMObject.h.
|
inherited |
Returns the name of this object.
Definition at line 34 of file PRMObject_inl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
inherited |
Change the name of the PRM Object.
Definition at line 38 of file PRMObject_inl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
virtualinherited |
Implements gum::prm::PRMObject.
Definition at line 56 of file PRMClassElement_tpl.h.
To PRMObject are equal if they have the same name (which is unique).
Definition at line 46 of file PRMObject_inl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
private |
To PRMObject are equal if they have the same name (which is unique).
Definition at line 42 of file PRMObject_inl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
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 80 of file PRMObject.h.
|
inherited |
Returns the safe name of this PRMClassElement, if any.
This will only work if this PRMClassElement is an PRMAttribute or an PRMAggregate.
NotFound& | Raised if this PRMClassElement does not have any safe name. |
Definition at line 66 of file PRMClassElement_tpl.h.
|
virtualinherited |
Used to assign the id of this element.
Definition at line 61 of file PRMClassElement_tpl.h.
INLINE PRMClassElementContainer< GUM_SCALAR > & gum::prm::PRMReferenceSlot< GUM_SCALAR >::slotType | ( | ) |
Returns the type of this slot, which is a PRMClassElementContainer (it is not the type of PRMObject).
Definition at line 71 of file PRMReferenceSlot_tpl.h.
INLINE const PRMClassElementContainer< GUM_SCALAR > & gum::prm::PRMReferenceSlot< GUM_SCALAR >::slotType | ( | ) | const |
Returns the type of this slot, which is a PRMClassElementContainer (it is not the type of PRMObject).
Definition at line 77 of file PRMReferenceSlot_tpl.h.
|
virtual |
Raise an OperationNotAllowed. See gum::PRMClassElement::type().
Implements gum::prm::PRMClassElement< GUM_SCALAR >.
Definition at line 87 of file PRMReferenceSlot_tpl.h.
|
virtual |
Raise an OperationNotAllowed. See gum::PRMClassElement::type().
Implements gum::prm::PRMClassElement< GUM_SCALAR >.
Definition at line 92 of file PRMReferenceSlot_tpl.h.
|
private |
Flag indicating if this slot is an array.
Definition at line 166 of file PRMReferenceSlot.h.
|
private |
The type of this PRMReferenceSlot.
Definition at line 163 of file PRMReferenceSlot.h.
|
protectedinherited |
The safe name of this PRMClassElement.
Definition at line 265 of file PRMClassElement.h.