aGrUM  0.16.0
PRMObject.cpp
Go to the documentation of this file.
1 
32 
33 #ifdef GUM_NO_INLINE
35 #endif // GUM_NO_INLINE
36 
37 namespace gum {
38  namespace prm {
39  // ==========================================================================
40  // Constructor.
41  // @param type The type of this object.
42  // ==========================================================================
43  PRMObject::PRMObject(const std::string& name) : __name(name) {
44  GUM_CONSTRUCTOR(PRMObject);
45  }
46  // ==========================================================================
47  // Copy constructor.
48  // ==========================================================================
49  PRMObject::PRMObject(const PRMObject& source) : __name(source.__name) {
50  GUM_CONS_CPY(PRMObject);
51  }
52  // ==========================================================================
53  // Move constructor.
54  // ==========================================================================
55  PRMObject::PRMObject(PRMObject&& source) : __name(std::move(source.__name)) {
56  GUM_CONS_CPY(PRMObject);
57  }
58  // ==========================================================================
59  // Destructor.
60  // ==========================================================================
61  PRMObject::~PRMObject() { GUM_DESTRUCTOR(PRMObject); }
62 
63  // Copy operator.
65  __name = source.__name;
66  return *this;
67  }
68 
69  // Move operator.
71  __name = std::move(source.__name);
72  return *this;
73  }
74 
75  // ==========================================================================
76  // For printing PRMType easily.
77  // ==========================================================================
78  std::ostream& operator<<(std::ostream& out, PRMObject::prm_type obj_type) {
79  return (out << PRMObject::enum2str(obj_type));
80  }
81  // ==========================================================================
82  } /* namespace prm */
83 } /* namespace gum */
PRMObject & operator=(const PRMObject &source)
Copy operator.
Definition: PRMObject.cpp:64
std::ostream & operator<<(std::ostream &out, PRMObject::prm_type obj_type)
For printing PRMType easily.
Definition: PRMObject.cpp:78
static std::string enum2str(prm_type type)
Returns the string representation of a PRMObject.
Definition: PRMObject.h:83
virtual prm_type obj_type() const =0
Returns the type of this object.
STL namespace.
virtual ~PRMObject()
Destructor.
Definition: PRMObject.cpp:61
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
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.
std::string __name
Definition: PRMObject.h:200
PRMObject(const std::string &name)
Constructor.
Definition: PRMObject.cpp:43
Copyright 2005-2019 Pierre-Henri WUILLEMIN et Christophe GONZALES (LIP6) {prenom.nom}_at_lip6.fr.