Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
fhiclcpp
fhiclcpp
types
detail
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::detail
{
13
14
class
ParameterBase;
15
16
class
ParameterMetadata
{
17
public
:
18
ParameterMetadata
() =
default
;
19
20
ParameterMetadata
(
Name
const
&
name
=
Name
(),
21
Comment
const
&
comment
=
Comment
(
""
),
22
par_style
const
parStyle =
par_style::NTYPES
,
23
par_type
const
parType =
par_type::NTYPES
)
24
:
key_
{
NameStackRegistry::full_key
(
name
.value)}
25
,
name_
{
name
.value}
26
,
comment_
{
comment
.value}
27
,
parStyle_
{parStyle}
28
,
parType_
{parType}
29
{}
30
31
std::string
const
&
32
key
()
const
33
{
34
return
key_
;
35
}
36
std::string
const
&
37
name
()
const
38
{
39
return
name_
;
40
}
41
std::string
const
&
42
comment
()
const
43
{
44
return
comment_
;
45
}
46
47
bool
48
has_default
()
const
49
{
50
return
parStyle_
==
par_style::DEFAULT
||
51
parStyle_
==
par_style::DEFAULT_CONDITIONAL
;
52
}
53
54
bool
55
is_optional
()
const
56
{
57
return
parStyle_
==
par_style::OPTIONAL
||
58
parStyle_
==
par_style::OPTIONAL_CONDITIONAL
;
59
}
60
61
bool
62
is_conditional
()
const
63
{
64
return
parStyle_
==
par_style::REQUIRED_CONDITIONAL
||
65
parStyle_
==
par_style::OPTIONAL_CONDITIONAL
||
66
parStyle_
==
par_style::DEFAULT_CONDITIONAL
;
67
}
68
69
par_type
70
type
()
const
71
{
72
return
parType_
;
73
}
74
75
void
76
set_par_style
(
par_style
const
vt)
77
{
78
parStyle_
= vt;
79
}
80
81
private
:
82
std::string
key_
{};
83
std::string
name_
{};
84
std::string
comment_
{};
85
par_style
parStyle_
{
par_style::NTYPES
};
86
par_type
parType_
{
par_type::NTYPES
};
87
};
88
}
89
90
#endif
/* fhiclcpp_types_detail_ParameterMetadata_h */
91
92
// Local variables:
93
// mode: c++
94
// 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:83
fhicl::detail::ParameterMetadata::parStyle_
par_style parStyle_
Definition:
ParameterMetadata.h:85
string
std::string string
Definition:
nybbler.cc:12
fhicl::detail::ParameterMetadata::type
par_type type() const
Definition:
ParameterMetadata.h:70
strip_containing_names.h
fhicl::par_type::NTYPES
Name
ChannelGroupService::Name Name
Definition:
FixedChannelGroupService_service.cc:19
fhicl::detail::ParameterMetadata
Definition:
ParameterMetadata.h:16
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:20
fhicl::detail::ParameterMetadata::name
std::string const & name() const
Definition:
ParameterMetadata.h:37
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:48
NameStackRegistry.h
fhicl::detail::ParameterMetadata::is_optional
bool is_optional() const
Definition:
ParameterMetadata.h:55
fhicl::par_style::OPTIONAL_CONDITIONAL
fhicl::detail::ParameterMetadata::parType_
par_type parType_
Definition:
ParameterMetadata.h:86
fhicl::detail::ParameterMetadata::comment_
std::string comment_
Definition:
ParameterMetadata.h:84
fhicl::detail::ParameterMetadata::comment
std::string const & comment() const
Definition:
ParameterMetadata.h:42
Comment
#define Comment
Definition:
commentscan.cpp:4062
ParameterArgumentTypes.h
fhicl::NameStackRegistry::full_key
static std::string full_key(std::string const &key)
Definition:
NameStackRegistry.cc:13
fhicl::detail::ParameterMetadata::key
std::string const & key() const
Definition:
ParameterMetadata.h:32
fhicl::detail::ParameterMetadata::key_
std::string key_
Definition:
ParameterMetadata.h:82
fhicl::detail
Definition:
coding.h:43
fhicl::par_style::DEFAULT_CONDITIONAL
fhicl::detail::ParameterMetadata::is_conditional
bool is_conditional() const
Definition:
ParameterMetadata.h:62
fhicl::detail::ParameterMetadata::set_par_style
void set_par_style(par_style const vt)
Definition:
ParameterMetadata.h:76
fhicl::Comment
Definition:
Comment.h:33
fhicl::Name
Definition:
Name.h:10
Name.h
fhicl::detail::ParameterMetadata::ParameterMetadata
ParameterMetadata()=default
Generated by
1.8.11