Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
fhiclcpp
fhiclcpp
test
types
validate_ParameterSet_t.cc
Go to the documentation of this file.
1
#include "
fhiclcpp/ParameterSet.h
"
2
3
#include "
fhiclcpp/types/Atom.h
"
4
#include "
fhiclcpp/types/Sequence.h
"
5
#include "
fhiclcpp/types/Table.h
"
6
#include "
fhiclcpp/types/Tuple.h
"
7
8
#include <iostream>
9
10
namespace
{
11
12
using namespace
fhicl
;
13
14
//============================================================================
15
// Job configuration
16
//
17
18
struct
PSet2 {
19
Atom<std::string>
test
{
Name
(
"test"
),
Comment
(
"this works"
),
"try again"
};
20
Sequence<int>
sequence{
Name
(
"sequence"
)};
21
};
22
23
struct
Test
{
24
Atom<int>
value
{
Name
(
"c"
)};
25
};
26
27
struct
ForRootInput {
28
Atom<std::string>
primary{
Name
(
"a"
)};
29
Sequence<std::string>
secondaries{
Name
(
"b"
)};
30
Sequence<Table<Test>
> tablesequence2{
Name
(
"tableSequence2"
)};
31
};
32
33
struct
Configuration
{
34
Atom<bool>
flag{
Name
(
"flag"
),
true
};
35
36
Tuple<double, std::string>
pair{
Name
(
"pair"
)};
37
Tuple<int, std::string, double>
tup{
Name
(
"tuple"
)};
38
39
Sequence<Tuple<int, double>
> vt{
Name
(
"vecOfTuples"
)};
40
Sequence<Tuple<int, double>
, 2> at{
Name
(
"arrayOfTuples"
)};
41
42
Sequence<Sequence<int>
> vv{
Name
(
"vecOfVecs"
)};
43
Sequence<Sequence<int, 2>
> va{
Name
(
"vecOfArrays"
)};
44
Sequence<Sequence<int>
, 2> av{
Name
(
"arrayOfVecs"
)};
45
Sequence<Sequence<int, 2>
, 2> aa{
Name
(
"arrayOfArrays"
)};
46
47
Tuple<Sequence<double>
,
bool
,
int
> tv{
Name
(
"tupleWithVec"
)};
48
Tuple<Sequence<double, 2>
,
bool
,
int
> ta{
Name
(
"tupleWithArray"
)};
49
Tuple<Tuple<int, double>
,
bool
,
int
>
tt
{
Name
(
"tupleWithTuple"
)};
50
51
Sequence<Table<ForRootInput>
> vtable{
Name
(
"vecOfTables"
)};
52
Tuple<Table<ForRootInput>
,
bool
,
int
> tupleWithTable{
53
Name
(
"tupleWithTable"
)};
54
Tuple<Sequence<Table<ForRootInput>
>,
double
> tvtable{
55
Name
(
"tupleWithVecTable"
)};
56
Tuple<Sequence<Table<ForRootInput>
, 2>,
double
> tstable{
57
Name
(
"tupleWithArrTable"
)};
58
Sequence<Tuple<Table<ForRootInput>
,
double
>> vttable{
59
Name
(
"vecWithTupleTable"
)};
60
Sequence<Tuple<Table<ForRootInput>
,
double
>, 2> attable{
61
Name
(
"arrWithTupleTable"
)};
62
Table<PSet2>
pset2{
Name
(
"pset2"
)};
63
};
64
}
65
66
int
67
main
()
68
{
69
putenv(const_cast<char*>(
"FHICL_FILE_PATH=./test:."
));
70
cet::filepath_lookup
policy(
"FHICL_FILE_PATH"
);
71
std::string
cfg_in(
"validate_ParameterSet_t.fcl"
);
72
auto
const
pset =
fhicl::ParameterSet::make
(cfg_in, policy);
73
74
try
{
75
Table<Configuration>
table{
Name
(
"pset"
)};
76
table.validate(pset.get<
fhicl::ParameterSet
>(
"pset"
));
77
}
78
catch
(
std::exception
const
&
e
) {
79
std::cout << e.what() <<
std::endl
;
80
}
81
}
Sequence.h
fhicl::Table
Definition:
type_traits.h:30
string
std::string string
Definition:
nybbler.cc:12
fhicl::ParameterSet::make
static ParameterSet make(intermediate_table const &tbl)
Definition:
ParameterSet.cc:68
test
Definition:
PandoraAnalysis_module.cc:49
Name
ChannelGroupService::Name Name
Definition:
FixedChannelGroupService_service.cc:19
art::errors::Configuration
Definition:
Exception.h:32
ParameterSet.h
tt
Definition:
type_traits.h:61
e
const double e
Definition:
gUpMuFluxGen.cxx:165
cet::filepath_lookup
Definition:
filepath_maker.h:52
fhicl
Definition:
InputSourceFactory.h:7
fhicl::Atom< std::string >
main
int main()
Definition:
validate_ParameterSet_t.cc:67
Comment
#define Comment
Definition:
commentscan.cpp:4062
Tuple.h
Table.h
Atom.h
Test::Test
Test()
Definition:
templ.cpp:25
fhicl::Sequence< int >
fhicl::Tuple
Definition:
type_traits.h:38
submit_mcc.value
value
Definition:
submit_mcc.py:159
bool
int bool
Definition:
qglobal.h:345
fhicl::exception
cet::coded_exception< error, detail::translate > exception
Definition:
exception.h:33
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11