LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
ParameterMetadata.h
Go to the documentation of this file.
1
#ifndef fhiclcpp_types_detail_ParameterMetadata_h
2
#define fhiclcpp_types_detail_ParameterMetadata_h
3
4
#include "
fhiclcpp/types/Comment.h
"
5
#include "
fhiclcpp/types/Name.h
"
6
#include "
fhiclcpp/types/detail/NameStackRegistry.h
"
7
#include "
fhiclcpp/types/detail/ParameterArgumentTypes.h
"
8
#include "
fhiclcpp/types/detail/strip_containing_names.h
"
9
10
#include <string>
11
12
namespace
fhicl
{
13
namespace
detail {
14
15
class
ParameterBase;
16
17
class
ParameterMetadata
{
18
public
:
19
ParameterMetadata
() =
default
;
20
21
ParameterMetadata
(
Name
const
&
name
=
Name
(),
22
Comment
const
&
comment
=
Comment
(
""
),
23
par_style
const
parStyle =
par_style::NTYPES
,
24
par_type
const
parType =
par_type::NTYPES
)
25
:
key_
{
NameStackRegistry::instance
().
full_key
(
name
.value)}
26
,
name_
{
name
.value}
27
,
comment_
{
comment
.value}
28
,
parStyle_
{parStyle}
29
,
parType_
{parType}
30
{}
31
32
std::string
33
key
()
const
34
{
35
return
key_
;
36
}
37
std::string
38
name
()
const
39
{
40
return
name_
;
41
}
42
std::string
43
comment
()
const
44
{
45
return
comment_
;
46
}
47
48
bool
49
has_default
()
const
50
{
51
return
parStyle_
==
par_style::DEFAULT
||
52
parStyle_
==
par_style::DEFAULT_CONDITIONAL
;
53
}
54
55
bool
56
is_optional
()
const
57
{
58
return
parStyle_
==
par_style::OPTIONAL
||
59
parStyle_
==
par_style::OPTIONAL_CONDITIONAL
;
60
}
61
62
bool
63
is_conditional
()
const
64
{
65
return
parStyle_
==
par_style::REQUIRED_CONDITIONAL
||
66
parStyle_
==
par_style::OPTIONAL_CONDITIONAL
||
67
parStyle_
==
par_style::DEFAULT_CONDITIONAL
;
68
}
69
70
par_type
71
type
()
const
72
{
73
return
parType_
;
74
}
75
76
void
77
set_key
(std::string
const
&
key
)
78
{
79
key_
=
key
;
80
name_
=
detail::strip_all_containing_names
(key);
81
}
82
83
void
84
set_par_style
(
par_style
const
vt)
85
{
86
parStyle_
= vt;
87
}
88
89
private
:
90
std::string
key_
{};
91
std::string
name_
{};
92
std::string
comment_
{};
93
par_style
parStyle_
{
par_style::NTYPES
};
94
par_type
parType_
{
par_type::NTYPES
};
95
};
96
}
97
}
98
99
#endif
/* fhiclcpp_types_detail_ParameterMetadata_h */
100
101
// Local variables:
102
// mode: c++
103
// End:
fhicl::par_type
par_type
Definition:
ParameterArgumentTypes.h:8
fhicl::par_style::REQUIRED_CONDITIONAL
fhicl::detail::ParameterMetadata::name_
std::string name_
Definition:
ParameterMetadata.h:91
fhicl::detail::ParameterMetadata::key
std::string key() const
Definition:
ParameterMetadata.h:33
fhicl::NameStackRegistry::instance
static NameStackRegistry & instance()
Definition:
NameStackRegistry.h:77
fhicl::detail::ParameterMetadata::parStyle_
par_style parStyle_
Definition:
ParameterMetadata.h:93
fhicl::detail::ParameterMetadata::type
par_type type() const
Definition:
ParameterMetadata.h:71
strip_containing_names.h
fhicl::par_type::NTYPES
fhicl::detail::ParameterMetadata
Definition:
ParameterMetadata.h:17
fhicl::detail::ParameterMetadata::ParameterMetadata
ParameterMetadata(Name const &name=Name(), Comment const &comment=Comment(""), par_style const parStyle=par_style::NTYPES, par_type const parType=par_type::NTYPES)
Definition:
ParameterMetadata.h:21
Comment.h
fhicl::par_style
par_style
Definition:
ParameterArgumentTypes.h:37
fhicl::par_style::OPTIONAL
fhicl::par_style::DEFAULT
fhicl::detail::ParameterMetadata::has_default
bool has_default() const
Definition:
ParameterMetadata.h:49
NameStackRegistry.h
fhicl::detail::ParameterMetadata::is_optional
bool is_optional() const
Definition:
ParameterMetadata.h:56
fhicl
parameter set interface
Definition:
ServiceProviderWrappers.h:37
fhicl::par_style::OPTIONAL_CONDITIONAL
fhicl::detail::ParameterMetadata::comment
std::string comment() const
Definition:
ParameterMetadata.h:43
fhicl::detail::ParameterMetadata::parType_
par_type parType_
Definition:
ParameterMetadata.h:94
fhicl::detail::ParameterMetadata::comment_
std::string comment_
Definition:
ParameterMetadata.h:92
fhicl::detail::ParameterMetadata::name
std::string name() const
Definition:
ParameterMetadata.h:38
fhicl::detail::ParameterMetadata::set_key
void set_key(std::string const &key)
Definition:
ParameterMetadata.h:77
ParameterArgumentTypes.h
fhicl::NameStackRegistry::full_key
std::string full_key(std::string const &key)
Definition:
NameStackRegistry.cc:11
fhicl::detail::strip_all_containing_names
std::string strip_all_containing_names(std::string const &key)
Definition:
strip_containing_names.cc:14
fhicl::detail::ParameterMetadata::key_
std::string key_
Definition:
ParameterMetadata.h:90
fhicl::par_style::DEFAULT_CONDITIONAL
fhicl::detail::ParameterMetadata::is_conditional
bool is_conditional() const
Definition:
ParameterMetadata.h:63
fhicl::detail::ParameterMetadata::set_par_style
void set_par_style(par_style const vt)
Definition:
ParameterMetadata.h:84
fhicl::Comment
Definition:
Comment.h:33
fhicl::Name
Definition:
Name.h:11
Name.h
fhicl::detail::ParameterMetadata::ParameterMetadata
ParameterMetadata()=default
fhiclcpp
types
detail
ParameterMetadata.h
Generated on Thu Jul 26 2018 13:09:45 for LArSoft by
1.8.11