Jpp  master_rocky-43-ge265d140c
the software that should make you happy
JPrintTreeParameters.cc
Go to the documentation of this file.
1 
2 #include <string>
3 #include <iostream>
4 #include <iomanip>
5 
7 
8 #include "JAAnet/JSupport.hh"
9 #include "JDAQ/JSupport.hh"
10 #include "JSupport/JSupport.hh"
11 
12 #include "JLang/JBool.hh"
13 #include "JLang/JType.hh"
14 
15 #include "Jeep/JParser.hh"
16 #include "Jeep/JMessage.hh"
17 
18 
19 namespace {
20 
21  using namespace JPP;
22 
23  /**
24  * Printer for TTree parameters.
25  */
26  struct JPrinter {
27  /**
28  * Print TTree parameters of given data type.
29  *
30  * \param type type
31  */
32  template<class T>
33  void operator()(JType<T> type)
34  {
36  }
37 
38  /**
39  * Print TTree parameters of given data type according option.
40  *
41  * \param type type
42  * \param option option
43  */
44  template<class T>
45  static void print(JType<T> type, JBool<true> option)
46  {
47  using namespace std;
48  using namespace JPP;
49 
50  cout << getTreeParameters<T>() << endl;
51  };
52 
53  /**
54  * Print TTree parameters of given data type according option.
55  *
56  * \param type type
57  * \param option option
58  */
59  template<class T>
60  static void print(JType<T> type, JBool<false> option)
61  {}
62  };
63 }
64 
65 
66 /**
67  * \file
68  *
69  * Auxiliary program to print ROOT TTree parameters.
70  * \author mdejong
71  */
72 int main(int argc, char **argv)
73 {
74  using namespace std;
75  using namespace JPP;
76  using namespace KM3NETDAQ;
77 
78  int debug;
79 
80  try {
81 
82  JParser<> zap("Auxiliary program to print ROOT TTree parameters.");
83 
84  zap['d'] = make_field(debug) = 1;
85 
86  zap(argc, argv);
87  }
88  catch(const exception &error) {
89  FATAL(error.what() << endl);
90  }
91 
92  JPrinter printer;
93 
94  for_each(printer, JType<JAllTypes_t>());
95 }
ROOT TTree parameter settings.
ROOT TTree parameter settings.
General purpose messaging.
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level
Definition: JSirene.cc:69
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:2142
int main(int argc, char **argv)
ROOT TTree parameter settings of various packages.
Utility class to parse command line options.
Definition: JParser.hh:1698
Test availability of TTree parameters for given class.
std::ostream & print(std::ostream &out, const JTestSummary &summary, const char delimiter=' ', const bool useColors=true)
Print test summary.
JObject_t & for_each(JObject_t &object, JType< JTypeList< JHead_t, JTail_t > > typelist)
For each data type method.
Definition: JTypeList.hh:415
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
Definition: JSTDTypes.hh:14
Auxiliary template class for type bool.
Definition: JBool.hh:21
Auxiliary class to temporarily replace std::ostream.
Auxiliary class for a type holder.
Definition: JType.hh:19