Jpp
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 "evt/Head.hh"
7
#include "evt/Evt.hh"
8
9
#include "
JAAnet/JHead.hh
"
10
11
#include "
JDAQ/JDAQTimeslice.hh
"
12
#include "
JDAQ/JDAQEvent.hh
"
13
#include "
JDAQ/JDAQSummaryslice.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
:
36
public
JROOTClassSelection
37
{
38
/**
39
* Constructor.
40
*
41
* \param out output stream
42
* \param selection selection
43
*/
44
JPrinter
(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
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:1410
JTriggerParameters.hh
JLANG::JPrinter
Auxiliary class to temporarily replace std::ostream.
Definition:
JPrintHelper.hh:149
JROOT::JRootClass::print
void print(std::ostream &out) const
Print ROOT class information.
Definition:
JRootClass.hh:290
JROOT::JROOTClassSelection
Auxiliary class for ROOT class selection.
Definition:
JROOTClassSelector.hh:90
JDAQEvent.hh
JPARSER::initialised
Empty structure for specification of parser element that is initialised (i.e.
Definition:
JParser.hh:64
JLANG::JType
Auxiliary class for a type holder.
Definition:
JType.hh:19
JDAQSummaryslice.hh
JLANG::JTypeList
Type list.
Definition:
JTypeList.hh:22
JLANG::JPrinter::JPrinter
JPrinter(std::ostream &out)
Constructor.
Definition:
JPrintHelper.hh:155
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1836
debug
int debug
debug level
Definition:
JSirene.cc:59
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:572
FATAL
#define FATAL(A)
Definition:
JMessage.hh:65
JParser.hh
Utility class to parse command line options.
JROOTClassSelector.hh
JSupport.hh
ROOT TTree parameter settings.
JDAQTimeslice.hh
JRootClass.hh
JROOT::JRootClass
Auxiliary class to manage access to base classes and data members of ROOT class.
Definition:
JRootClass.hh:38
JHead.hh
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5