![]() |
aGrUM
0.20.3
a C++ library for (probabilistic) graphical models
|
Abstract base class for any element defined in a PRM. More...
#include <PRMObject.h>
Public Member Functions | |
Constructor & destructor. | |
PRMObject (const std::string &name) | |
Constructor. More... | |
PRMObject (const PRMObject &source) | |
Copy constructor. More... | |
PRMObject (PRMObject &&source) | |
Move constructor. More... | |
virtual | ~PRMObject () |
Destructor. 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... | |
virtual prm_type | obj_type () const =0 |
Returns the type of this 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... | |
PRMObject & | operator= (const PRMObject &source) |
Copy operator. More... | |
PRMObject & | operator= (PRMObject &&source) |
Move operator. 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 | 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 std::string | enum2str (prm_type type) |
Returns the string representation of a PRMObject. 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... | |
Abstract base class for any element defined in a PRM.
This class is a base class for any element defined in a PRM. Since objects in a PRM are differentiated by their names, the only information we need about them is their name.
Furthermore we use an enumeration to know the concrete type of a given PRMObject preventing faster type checking.
Definition at line 55 of file PRMObject.h.
|
strong |
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.
|
explicit |
Constructor.
name | The name of this object. |
Definition at line 42 of file PRMObject.cpp.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
Referenced by isClass(), isInstance(), and isInterface().
gum::prm::PRMObject::PRMObject | ( | const PRMObject & | source | ) |
Copy constructor.
Definition at line 46 of file PRMObject.cpp.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
gum::prm::PRMObject::PRMObject | ( | PRMObject && | source | ) |
Move constructor.
Definition at line 52 of file PRMObject.cpp.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
virtual |
Destructor.
Definition at line 58 of file PRMObject.cpp.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
inlinestatic |
Returns true if obj_ptr is of type Class.
Definition at line 109 of file PRMObject.h.
References PRMObject().
Returns true if obj_ptr is of type PRMInstance.
Definition at line 117 of file PRMObject.h.
References PRMObject().
Returns true if obj_ptr is of type PRMInterface.
Definition at line 112 of file PRMObject.h.
References PRMObject().
|
inlinestatic |
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.
INLINE const std::string & gum::prm::PRMObject::name | ( | ) | const |
Returns the name of this object.
Definition at line 34 of file PRMObject_inl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
INLINE void gum::prm::PRMObject::name | ( | const std::string & | name | ) |
Change the name of the PRM Object.
Definition at line 38 of file PRMObject_inl.h.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
|
pure virtual |
Returns the type of this object.
Implemented in gum::prm::PRMClassElement< GUM_SCALAR >, gum::prm::PRMClassElement< double >, gum::prm::PRMType, gum::prm::PRMClass< GUM_SCALAR >, gum::prm::PRMClass< double >, gum::prm::PRMInterface< GUM_SCALAR >, gum::prm::PRMInterface< double >, gum::prm::PRMSystem< GUM_SCALAR >, gum::prm::PRMSystem< double >, and gum::prm::PRMInstance< GUM_SCALAR >.
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().
Copy operator.
Definition at line 64 of file PRMObject.cpp.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
Move operator.
Definition at line 70 of file PRMObject.cpp.
References gum::prm::ParamScopeData< GUM_SCALAR >::ParamScopeData().
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().
|
inlinestatic |
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.
|
private |
Definition at line 205 of file PRMObject.h.