Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
fhiclcpp
fhiclcpp
types
DelegatedParameter.h
Go to the documentation of this file.
1
#ifndef fhiclcpp_types_DelegatedParameter_h
2
#define fhiclcpp_types_DelegatedParameter_h
3
4
#include "
fhiclcpp/ParameterSet.h
"
5
#include "
fhiclcpp/types/Comment.h
"
6
#include "
fhiclcpp/types/Name.h
"
7
#include "
fhiclcpp/types/detail/DelegateBase.h
"
8
#include "
fhiclcpp/types/detail/ParameterArgumentTypes.h
"
9
#include "
fhiclcpp/types/detail/TableMemberRegistry.h
"
10
#include "
fhiclcpp/types/detail/strip_containing_names.h
"
11
12
namespace
fhicl
{
13
14
//========================================================
15
class
DelegatedParameter
final :
public
detail::DelegateBase
,
16
private
detail::RegisterIfTableMember
{
17
public
:
18
explicit
DelegatedParameter
(
Name
&&
name
);
19
explicit
DelegatedParameter
(
Name
&&
name
,
Comment
&&
comment
);
20
explicit
DelegatedParameter
(
Name
&&
name
,
21
Comment
&&
comment
,
22
std::function
<
bool
()> maybeUse);
23
24
// A DelegatedParameter object must be present. Therefore, it is
25
// safe and correct to call 'pset.get' with no default.
26
template
<
typename
T>
27
auto
28
get
()
const
29
{
30
auto
const
trimmed_key =
31
detail::strip_first_containing_name
(
key
());
32
return
pset_
.
get
<
T
>(trimmed_key);
33
}
34
35
private
:
36
void
37
do_set_value
(
fhicl::ParameterSet
const
& pset)
override
38
{
39
pset_
= pset;
40
};
41
42
fhicl::ParameterSet
pset_
{};
43
};
44
}
45
46
#endif
/* fhiclcpp_types_DelegatedParameter_h */
47
48
// Local variables:
49
// mode: c++
50
// End:
fhicl::detail::ParameterBase::name
std::string const & name() const
Definition:
ParameterBase.h:43
fhicl::detail::DelegateBase
Definition:
DelegateBase.h:8
TableMemberRegistry.h
strip_containing_names.h
fhicl::DelegatedParameter::DelegatedParameter
DelegatedParameter(Name &&name)
Definition:
DelegatedParameter.cc:7
ValidateOpDetSimulation.T
T
Definition:
ValidateOpDetSimulation.py:52
Comment.h
ParameterSet.h
fhicl::detail::strip_first_containing_name
std::string strip_first_containing_name(std::string const &key)
Definition:
strip_containing_names.cc:7
DelegateBase.h
fhicl::detail::RegisterIfTableMember
Definition:
TableMemberRegistry.h:103
fhicl
Definition:
InputSourceFactory.h:7
fhicl::ParameterSet::get
T get(std::string const &key) const
Definition:
ParameterSet.h:271
fhicl::detail::ParameterBase::key
std::string const & key() const
Definition:
ParameterBase.h:38
ParameterArgumentTypes.h
fhicl::detail::ParameterBase::comment
std::string const & comment() const
Definition:
ParameterBase.h:48
fhicl::DelegatedParameter::do_set_value
void do_set_value(fhicl::ParameterSet const &pset) override
Definition:
DelegatedParameter.h:37
function
void function(int client, int *resource, int parblock, int *test, int p)
fhicl::DelegatedParameter::pset_
fhicl::ParameterSet pset_
Definition:
DelegatedParameter.h:42
fhicl::Comment
Definition:
Comment.h:33
fhicl::Name
Definition:
Name.h:10
Name.h
fhicl::DelegatedParameter
Definition:
DelegatedParameter.h:15
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11