![]() |
aGrUM
0.16.0
|
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 56 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 69 of file PRMObject.h.
|
explicit |
Constructor.
name | The name of this object. |
Definition at line 43 of file PRMObject.cpp.
Referenced by isInstance().
gum::prm::PRMObject::PRMObject | ( | const PRMObject & | source | ) |
Copy constructor.
Definition at line 49 of file PRMObject.cpp.
gum::prm::PRMObject::PRMObject | ( | PRMObject && | source | ) |
Move constructor.
Definition at line 55 of file PRMObject.cpp.
|
virtual |
Destructor.
Definition at line 61 of file PRMObject.cpp.
Referenced by isInstance().
|
inlinestatic |
Returns the string representation of a PRMObject.
Definition at line 83 of file PRMObject.h.
References CLASS, CLASS_ELT, INSTANCE, PRM_INTERFACE, SYSTEM, and TYPE.
Referenced by gum::prm::operator<<().
Returns true if obj_ptr is of type Class.
Definition at line 102 of file PRMObject.h.
References CLASS, and obj_type().
Referenced by gum::prm::PRMFactory< GUM_SCALAR >::startAttribute().
Returns true if obj_ptr is of type PRMInstance.
Definition at line 112 of file PRMObject.h.
References INSTANCE, name(), obj_type(), operator!=(), operator=(), operator==(), PRMObject(), and ~PRMObject().
Returns true if obj_ptr is of type PRMInterface.
Definition at line 107 of file PRMObject.h.
References obj_type(), and PRM_INTERFACE.
|
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.
Referenced by gum::prm::decomposePath(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), and gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute().
INLINE const std::string & gum::prm::PRMObject::name | ( | ) | const |
Returns the name of this object.
Definition at line 35 of file PRMObject_inl.h.
References __name.
Referenced by gum::prm::SVE< GUM_SCALAR >::__addDelayedVariable(), gum::prm::PRMClass< double >::__addIOInterfaceFlags(), gum::prm::PRMFactory< GUM_SCALAR >::__addParent(), gum::prm::PRMInstance< GUM_SCALAR >::__addReferingInstance(), gum::prm::PRMClass< double >::__checkInterface(), gum::prm::PRMFactory< GUM_SCALAR >::__checkInterfaceImplementation(), gum::prm::PRMClass< double >::__checkInterfaces(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::__checkRawCPT(), gum::prm::PRMClass< double >::__checkRefInterface(), gum::prm::PRMClass< double >::__checkRefInterfaces(), gum::prm::o3prm::O3ClassFactory< GUM_SCALAR >::__checkRuleCPTSumsTo1(), gum::prm::PRMInstance< GUM_SCALAR >::__copyAggregates(), gum::prm::PRMInstance< GUM_SCALAR >::__copyAttribute(), gum::prm::PRMSlotChain< double >::__copyLastElt(), gum::prm::PRMSystem< double >::__groundAttr(), gum::prm::PRMSystem< double >::__groundPotential(), gum::prm::PRMSystem< double >::__groundRef(), gum::prm::PRMClass< double >::__inheritClass(), gum::prm::PRMInterface< double >::__overloadAttribute(), gum::prm::PRMClass< double >::__overloadAttribute(), gum::prm::PRMClass< double >::__overloadParameter(), gum::prm::PRMClass< double >::__overloadReference(), gum::prm::PRMInterface< double >::__overloadReferenceSlot(), gum::prm::__print_attribute__(), gum::prm::__print_instance__(), gum::prm::gspan::StrictSearch< GUM_SCALAR >::__str(), gum::prm::StructuredInference< GUM_SCALAR >::__str(), gum::prm::PRMInterface< double >::add(), gum::prm::PRMSystem< double >::add(), gum::prm::PRMClass< double >::add(), gum::prm::PRMFactory< GUM_SCALAR >::addAggregator(), gum::prm::PRMFormAttribute< GUM_SCALAR >::addParent(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::addParent(), gum::prm::PRMFormAttribute< GUM_SCALAR >::copy(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::copy(), gum::prm::o3prmr::O3prmrInterpreter::findAttributeName(), gum::prm::o3prmr::O3prmrInterpreter::findInstanceName(), gum::prm::PRMFormAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::getCastDescendant(), gum::prm::PRMClass< double >::inheritAggregates(), gum::prm::PRMClass< double >::isCastDescendant(), isInstance(), name(), gum::prm::PRMType::name(), gum::prm::PRMFormAttribute< GUM_SCALAR >::newFactory(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::newFactory(), gum::prm::PRMType::operator!=(), operator!=(), operator<<(), gum::prm::PRMType::operator==(), operator==(), gum::prm::PRMClass< double >::overload(), gum::prm::PRMInterface< double >::overload(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), gum::prm::PRMReferenceSlot< double >::PRMReferenceSlot(), gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute(), gum::prm::PRMFactory< GUM_SCALAR >::startClass(), gum::prm::PRMFactory< GUM_SCALAR >::startInterface(), gum::prm::PRMFactory< GUM_SCALAR >::startSystem(), and gum::prm::PRMAggregate< double >::str2enum().
INLINE void gum::prm::PRMObject::name | ( | const std::string & | name | ) |
Change the name of the PRM Object.
Definition at line 39 of file PRMObject_inl.h.
References __name, and name().
|
pure virtual |
Returns the type of this object.
Implemented in gum::prm::PRMType, gum::prm::PRMClassElement< GUM_SCALAR >, gum::prm::PRMClassElement< double >, gum::prm::PRMClass< GUM_SCALAR >, gum::prm::PRMClass< double >, gum::prm::PRMSystem< GUM_SCALAR >, gum::prm::PRMSystem< double >, gum::prm::PRMInterface< GUM_SCALAR >, gum::prm::PRMInterface< double >, and gum::prm::PRMInstance< GUM_SCALAR >.
Referenced by gum::prm::PRMFactory< GUM_SCALAR >::__checkStack(), gum::prm::PRMFactory< GUM_SCALAR >::__checkStackContainter(), isClass(), isInstance(), isInterface(), gum::prm::PRMInterface< double >::isSubTypeOf(), and gum::prm::PRMClass< double >::isSubTypeOf().
To PRMObject are equal if they have the same name (which is unique).
Definition at line 49 of file PRMObject_inl.h.
References __name, and name().
Referenced by isInstance().
Copy operator.
Definition at line 64 of file PRMObject.cpp.
References __name.
Referenced by isInstance().
To PRMObject are equal if they have the same name (which is unique).
Definition at line 43 of file PRMObject_inl.h.
References __name, and name().
Referenced by isInstance().
|
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.
Referenced by gum::prm::decomposePath(), gum::prm::PRMFormAttribute< GUM_SCALAR >::PRMFormAttribute(), and gum::prm::PRMScalarAttribute< GUM_SCALAR >::PRMScalarAttribute().
|
private |
Definition at line 200 of file PRMObject.h.
Referenced by name(), operator!=(), operator=(), and operator==().