aGrUM  0.16.0
PRMClassElement_tpl.h
Go to the documentation of this file.
1 
31 
32 namespace gum {
33  namespace prm {
34 
35  template < typename GUM_SCALAR >
37  PRMObject(name) {
38  GUM_CONSTRUCTOR(PRMClassElement);
39  }
40 
41  template < typename GUM_SCALAR >
43  const PRMClassElement< GUM_SCALAR >& source) :
44  PRMObject(source.name()),
45  __id(source.id()) {
46  GUM_CONS_CPY(PRMClassElement);
47  }
48 
49  template < typename GUM_SCALAR >
51  GUM_DESTRUCTOR(PRMClassElement);
52  }
53 
54  template < typename GUM_SCALAR >
56  return __id;
57  }
58 
59  template < typename GUM_SCALAR >
61  return prm_type::CLASS_ELT;
62  }
63 
64  template < typename GUM_SCALAR >
66  __id = id;
67  }
68 
69  template < typename GUM_SCALAR >
70  INLINE const std::string& PRMClassElement< GUM_SCALAR >::safeName() const {
71  return _safeName;
72  }
73 
74  template < typename GUM_SCALAR >
75  INLINE std::string
77  if (type().isSubTypeOf(t)) {
78  return PRMObject::LEFT_CAST() + t.name() + PRMObject::RIGHT_CAST()
79  + name();
80  } else {
81  GUM_ERROR(OperationNotAllowed, "illegal cast");
82  }
83  }
84 
85  } /* namespace prm */
86 } /* namespace gum */
const std::string & name() const
Returns the name of this object.
Definition: PRMType_inl.h:68
Abstract class representing an element of PRM class.
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Definition: agrum.h:25
prm_type
Enumeration of the different types of objects handled by a PRM.
Definition: PRMObject.h:69
This is a decoration of the DiscreteVariable class.
Definition: PRMType.h:63
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
Abstract base class for any element defined in a PRM.
Definition: PRMObject.h:56
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.
PRMClassElement(const std::string &name)
Default constructor of a PRMClassElement.
Size NodeId
Type for node ids.
Definition: graphElements.h:98
#define GUM_ERROR(type, msg)
Definition: exceptions.h:55