print_allowed_configuration_t.cc
Go to the documentation of this file.
1 #include "fhiclcpp/types/Atom.h"
3 #include "fhiclcpp/types/Table.h"
4 #include "fhiclcpp/types/Tuple.h"
5 
6 #include <iostream>
7 
8 namespace {
9 
10  using namespace fhicl;
11 
12  //============================================================================
13  // Job configuration
14  //
15 
16  struct PSet2 {
17  Atom<std::string> test{Name("test"), Comment("this works")};
18  Sequence<int> sequence{Name("sequence")};
19  Sequence<double, 5> array{Name("array")};
20  };
21 
22  struct Test {
23  Atom<int> value{Name("c")};
24  };
25 
26  struct ForRootInput {
27  Atom<std::string> primary{Name("a")};
28  Sequence<std::string> secondaries{Name("b")};
29  Sequence<Table<Test>> tablesequence2{Name("tableSequence2")};
30  };
31 
32  struct Configuration {
33  Atom<bool> flag{Name("flag")};
34 
35  Tuple<double, std::string> pair{Name("pair")};
37 
38  Sequence<Tuple<int, double>> vt{Name("vecOfTuples")};
39  Sequence<Tuple<int, double>, 2> at{Name("arrayOfTuples")};
40 
41  Sequence<Sequence<int>> vv{Name("vecOfVecs")};
42  Sequence<Sequence<int, 2>> va{Name("vecOfArrays")};
43  Sequence<Sequence<int>, 2> av{Name("arrayOfVecs")};
44  Sequence<Sequence<int, 2>, 2> aa{Name("arrayOfArrays")};
45 
46  Tuple<Sequence<double>, bool, int> tv{Name("tupleWithVec")};
47  Tuple<Sequence<double, 2>, bool, int> ta{Name("tupleWithArray")};
48  Tuple<Tuple<int, double>, bool, int> tt{Name("tupleWithTuple")};
49 
50  Sequence<Table<ForRootInput>> vtable{Name("vecOfTables")};
51  Sequence<Table<ForRootInput>, 2> atable{Name("arrayOfTables")};
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
68 {
69  Table<Configuration> pset{Name("pset")};
70  pset.print_allowed_configuration(std::cout);
71 }
ChannelGroupService::Name Name
Definition: type_traits.h:61
auto array(Array const &a)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:228
#define Comment
Test()
Definition: templ.cpp:25
int bool
Definition: qglobal.h:345