Jpp - the software that should make you happy
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
software
JGizmo
JPrintRootClass.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
6
#include "
km3net-dataformat/offline/Head.hh
"
7
#include "
km3net-dataformat/offline/Evt.hh
"
8
9
#include "
JAAnet/JHead.hh
"
10
11
#include "
JDAQ/JDAQTimesliceIO.hh
"
12
#include "
JDAQ/JDAQEventIO.hh
"
13
#include "
JDAQ/JDAQSummarysliceIO.hh
"
14
15
#include "
JTrigger/JTriggerParameters.hh
"
16
17
#include "
antares-dataformat/TimeSlice.hh
"
18
#include "
antares-dataformat/PhysicsEvent.hh
"
19
20
#include "
JSupport/JSupport.hh
"
21
22
#include "
JROOT/JRootClass.hh
"
23
#include "
JROOT/JROOTClassSelector.hh
"
24
25
#include "
Jeep/JParser.hh
"
26
#include "
Jeep/JMessage.hh
"
27
28
namespace
{
29
30
using namespace
JPP;
31
32
/**
33
* Auxiliary class for printing class information.
34
*/
35
struct
JPrinter_t :
36
public
JROOTClassSelection
37
{
38
/**
39
* Constructor.
40
*
41
* \param out output stream
42
* \param selection selection
43
*/
44
JPrinter_t(std::ostream& out,
const
JROOTClassSelection
& selection) :
45
JROOTClassSelection
(selection),
46
out(out)
47
{}
48
49
50
/**
51
* Print class infomration.
52
*
53
* \param type data type
54
* \return this printer
55
*/
56
template
<
class
T>
57
void
operator()(
const
JType<T>
& type)
const
58
{
59
using namespace
std;
60
using namespace
JPP;
61
62
if
(static_cast<const JROOTClassSelection&>(*
this
)(type)) {
63
JRootClass
(type).
print
(out);
64
}
65
}
66
67
protected
:
68
std::ostream& out;
69
};
70
}
71
72
73
/**
74
* \file
75
* Auxiliary program to print class information.
76
*
77
* The name of the data structure following option -C should be preceded by a '+' or '-'
78
* to add or remove data types in the output, respectively.\n
79
* In this, ROOT wildcards are accepted (e.g. <pre>-C -\\.\\*</pre> will remove all data types).
80
* \author mdejong
81
*/
82
int
main
(
int
argc,
char
**argv)
83
{
84
using namespace
std;
85
using namespace
JPP;
86
87
typedef
JTYPELIST<JAllDataTypes_t, JAntaresTypes_t, JHead>::typelist
typelist;
88
89
JPrinter_t printer(cout, getROOTClassSelection<typelist>());
90
int
debug
;
91
92
try
{
93
94
JParser<>
zap(
"Auxiliary program to print 'any' data."
);
95
96
zap[
'C'
] =
make_field
(printer,
97
"Precede name of data structure by a '+' or '-' "
98
"to add or remove data types in the output, respectively."
99
"\nROOT wildcards are accepted."
) =
JPARSER::initialised
();
100
zap[
'd'
] =
make_field
(
debug
) = 1;
101
102
zap(argc, argv);
103
}
104
catch
(
const
exception& error) {
105
FATAL
(error.what() << endl);
106
}
107
108
for_each
(printer,
JType<typelist>
());
109
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JSupport.hh
ROOT TTree parameter settings of various packages.
JROOT::JRootClass::print
void print(std::ostream &out) const
Print ROOT class information.
Definition:
JRootClass.hh:304
JROOT::JROOTClassSelection
Auxiliary class for ROOT class selection.
Definition:
JROOTClassSelector.hh:91
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e. does not require input)...
Definition:
JParser.hh:66
JLANG::JType
Auxiliary class for a type holder.
Definition:
JType.hh:19
JLANG::JTypeList
Type list.
Definition:
JTypeList.hh:22
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
TimeSlice.hh
JDAQSummarysliceIO.hh
debug
int debug
debug level
Definition:
JSirene.cc:63
PhysicsEvent.hh
JMessage.hh
General purpose messaging.
JLANG::for_each
JObject_t & for_each(JObject_t &object, JType< JTypeList< JHead_t, JTail_t > > typelist)
For each data type method.
Definition:
JTypeList.hh:415
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
Evt.hh
JParser.hh
Utility class to parse command line options.
JROOTClassSelector.hh
JRootClass.hh
JDAQEventIO.hh
Head.hh
JDAQTimesliceIO.hh
JROOT::JRootClass
Auxiliary class to manage access to base classes and data members of ROOT class.
Definition:
JRootClass.hh:39
JTriggerParameters.hh
JHead.hh
Generated by
1.8.5