aGrUM  0.20.3
a C++ library for (probabilistic) graphical models
variable_inl.h
Go to the documentation of this file.
1 /**
2  *
3  * Copyright (c) 2005-2021 by Pierre-Henri WUILLEMIN(@LIP6) & Christophe GONZALES(@AMU)
4  * info_at_agrum_dot_org
5  *
6  * This library is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with this library. If not, see <http://www.gnu.org/licenses/>.
18  *
19  */
20 
21 
22 #ifndef DOXYGEN_SHOULD_SKIP_THIS
23 
24 namespace gum {
25 
26  /// protected copy
27 
28  INLINE void Variable::copy_(const Variable& aRV) {
29  _name_ = aRV._name_;
31  }
32 
33  /// constructor
34 
35  INLINE Variable::Variable(const std::string& aName, const std::string& aDesc) :
36  _name_(aName), _description_(aDesc) { // for debugging purposes
38  }
39 
40  /// copy constructor
41 
43  _name_(aRV._name_), _description_(aRV._description_) { // for debugging purposes
45  }
46 
47  /// destructor
48 
49  INLINE Variable::~Variable() { // for debugging purposes
51  }
52 
53  /// Copy operator
54 
55  INLINE Variable& Variable::operator=(const Variable& aRV) {
56  // avoid self assignment
57  if (this != &aRV) copy_(aRV);
58 
59  return *this;
60  }
61 
62  /// sets the _name_ of the variable
63 
64  INLINE void Variable::setName(const std::string& theValue) { _name_ = theValue; }
65 
66  /// returns the _name_ of the variable
67 
68  INLINE const std::string& Variable::name() const { return _name_; }
69 
70  /// sets the _description_ of the variable
71 
72  INLINE void Variable::setDescription(const std::string& theValue) const {
74  }
75 
76  /// returns the _description_ of the variable
77 
78  INLINE const std::string& Variable::description() const { return _description_; }
79 
80  /// equality operator
81 
82  INLINE bool Variable::operator==(const Variable& aRV) const { return (_name_ == aRV._name_); }
83 
84  /// inequality operator
85 
86  INLINE bool Variable::operator!=(const Variable& aRV) const { return (!operator==(aRV)); }
87 
88 } /* namespace gum */
89 
90 #endif // DOXYGEN_SHOULD_SKIP_THIS
INLINE void emplace(Args &&... args)
Definition: set_tpl.h:643