aGrUM  0.14.2
PRMObject.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005 by Christophe GONZALES and Pierre-Henri WUILLEMIN *
3  * {prenom.nom}_at_lip6.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
29 
30 #ifdef GUM_NO_INLINE
32 #endif // GUM_NO_INLINE
33 
34 namespace gum {
35  namespace prm {
36  // ==========================================================================
37  // Constructor.
38  // @param type The type of this object.
39  // ==========================================================================
40  PRMObject::PRMObject(const std::string& name) : __name(name) {
41  GUM_CONSTRUCTOR(PRMObject);
42  }
43  // ==========================================================================
44  // Copy constructor.
45  // ==========================================================================
46  PRMObject::PRMObject(const PRMObject& source) : __name(source.__name) {
47  GUM_CONS_CPY(PRMObject);
48  }
49  // ==========================================================================
50  // Move constructor.
51  // ==========================================================================
52  PRMObject::PRMObject(PRMObject&& source) : __name(std::move(source.__name)) {
53  GUM_CONS_CPY(PRMObject);
54  }
55  // ==========================================================================
56  // Destructor.
57  // ==========================================================================
58  PRMObject::~PRMObject() { GUM_DESTRUCTOR(PRMObject); }
59 
60  // Copy operator.
62  __name = source.__name;
63  return *this;
64  }
65 
66  // Move operator.
68  __name = std::move(source.__name);
69  return *this;
70  }
71 
72  // ==========================================================================
73  // For printing PRMType easily.
74  // ==========================================================================
75  std::ostream& operator<<(std::ostream& out, PRMObject::prm_type obj_type) {
76  return (out << PRMObject::enum2str(obj_type));
77  }
78  // ==========================================================================
79  } /* namespace prm */
80 } /* namespace gum */
PRMObject & operator=(const PRMObject &source)
Copy operator.
Definition: PRMObject.cpp:61
std::ostream & operator<<(std::ostream &out, PRMObject::prm_type obj_type)
For printing PRMType easily.
Definition: PRMObject.cpp:75
static std::string enum2str(prm_type type)
Returns the string representation of a PRMObject.
Definition: PRMObject.h:80
virtual prm_type obj_type() const =0
Returns the type of this object.
STL namespace.
virtual ~PRMObject()
Destructor.
Definition: PRMObject.cpp:58
gum is the global namespace for all aGrUM entities
Definition: agrum.h:25
prm_type
Enumeration of the different types of objects handled by a PRM.
Definition: PRMObject.h:66
Abstract base class for any element defined in a PRM.
Definition: PRMObject.h:53
Inline implementation of PRMObject.
std::string __name
Definition: PRMObject.h:197
PRMObject(const std::string &name)
Constructor.
Definition: PRMObject.cpp:40
Headers of PRMObject.