aGrUM
0.20.2
a C++ library for (probabilistic) graphical models
variable_inl.h
Go to the documentation of this file.
1
/**
2
*
3
* Copyright 2005-2020 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__
;
30
description__
=
aRV
.
description__
;
31
}
32
33
/// constructor
34
35
INLINE
Variable
::
Variable
(
const
std
::
string
&
aName
,
const
std
::
string
&
aDesc
) :
36
name__
(
aName
),
description__
(
aDesc
) {
37
// for debugging purposes
38
GUM_CONSTRUCTOR
(
Variable
);
39
}
40
41
/// copy constructor
42
43
INLINE
Variable
::
Variable
(
const
Variable
&
aRV
) :
44
name__
(
aRV
.
name__
),
description__
(
aRV
.
description__
) {
45
// for debugging purposes
46
GUM_CONS_CPY
(
Variable
);
47
}
48
49
/// destructor
50
51
INLINE
Variable
::~
Variable
() {
52
// for debugging purposes
53
GUM_DESTRUCTOR
(
Variable
);
54
}
55
56
/// Copy operator
57
58
INLINE Variable&
Variable
::
operator
=(
const
Variable
&
aRV
) {
59
// avoid self assignment
60
if
(
this
!= &
aRV
)
copy_
(
aRV
);
61
62
return
*
this
;
63
}
64
65
/// sets the name__ of the variable
66
67
INLINE
void
Variable
::
setName
(
const
std
::
string
&
theValue
) {
name__
=
theValue
; }
68
69
/// returns the name__ of the variable
70
71
INLINE
const
std
::
string
&
Variable
::
name
()
const
{
return
name__
; }
72
73
/// sets the description__ of the variable
74
75
INLINE
void
Variable
::
setDescription
(
const
std
::
string
&
theValue
)
const
{
76
description__
=
theValue
;
77
}
78
79
/// returns the description__ of the variable
80
81
INLINE
const
std
::
string
&
Variable
::
description
()
const
{
return
description__
; }
82
83
/// equality operator
84
85
INLINE
bool
Variable
::
operator
==(
const
Variable
&
aRV
)
const
{
86
return
(
name__
==
aRV
.
name__
);
87
}
88
89
/// inequality operator
90
91
INLINE
bool
Variable
::
operator
!=(
const
Variable
&
aRV
)
const
{
92
return
(!
operator
==(
aRV
));
93
}
94
95
}
/* namespace gum */
96
97
#
endif
// DOXYGEN_SHOULD_SKIP_THIS
gum::Set::emplace
INLINE void emplace(Args &&... args)
Definition:
set_tpl.h:669