aGrUM
0.21.0
a C++ library for (probabilistic) graphical models
nameGenerator_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
/**
23
* @file
24
* @brief Inline implementation of PRMGenerator.
25
*
26
* @author Lionel TORTI and Pierre-Henri WUILLEMIN(@LIP6)
27
*/
28
#
include
<
agrum
/
PRM
/
generator
/
nameGenerator
.
h
>
29
30
namespace
gum
{
31
namespace
prm
{
32
INLINE
33
NameGenerator
::
NameGenerator
() :
_counters_
(3, 1) {
GUM_CONSTRUCTOR
(
NameGenerator
); }
34
35
INLINE
NameGenerator
::
NameGenerator
(
const
NameGenerator
&
source
) :
36
_counters_
(
source
.
_counters_
) {
37
GUM_CONS_CPY
(
NameGenerator
);
38
}
39
40
INLINE
NameGenerator
::~
NameGenerator
() {
41
GUM_DESTRUCTOR
(
NameGenerator
);
42
;
43
}
44
45
INLINE
46
NameGenerator&
NameGenerator
::
operator
=(
const
NameGenerator
&
source
) {
47
_counters_
=
source
.
_counters_
;
48
return
*
this
;
49
}
50
51
INLINE
52
std
::
string
NameGenerator
::
nextName
(
PRMObject
::
prm_type
type
) {
53
std
::
stringstream
s
;
54
55
switch
(
type
) {
56
case
PRMObject
::
prm_type
::
ALL
:
57
case
PRMObject
::
prm_type
::
CLASS
: {
58
s
<<
"class_"
<< ++(
_counters_
[0]);
59
break
;
60
}
61
62
case
PRMObject
::
prm_type
::
PRM_INTERFACE
: {
63
s
<<
"iface_"
<< ++(
_counters_
[0]);
64
break
;
65
}
66
67
case
PRMObject
::
prm_type
::
SYSTEM
: {
68
s
<<
"sys_"
<< ++(
_counters_
[0]);
69
break
;
70
}
71
72
case
PRMObject
::
prm_type
::
TYPE
: {
73
s
<<
"type_"
<< ++(
_counters_
[0]);
74
break
;
75
}
76
77
case
PRMObject
::
prm_type
::
CLASS_ELT
: {
78
s
<<
"elt_"
<< ++(
_counters_
[1]);
79
break
;
80
}
81
82
case
PRMObject
::
prm_type
::
INSTANCE
: {
83
s
<<
"inst_"
<< ++(
_counters_
[2]);
84
break
;
85
}
86
87
default
: {
88
GUM_ERROR
(
FatalError
,
"unknown PRMObject type"
)
89
}
90
}
91
92
return
s
.
str
();
93
}
94
95
}
/* namespace prm */
96
}
/* namespace gum */
gum::Set::emplace
INLINE void emplace(Args &&... args)
Definition:
set_tpl.h:643
gum::prm::ParamScopeData::ParamScopeData
ParamScopeData(const std::string &s, const PRMReferenceSlot< GUM_SCALAR > &ref, Idx d)
Definition:
PRMClass_tpl.h:1032