Jpp
17.3.1
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/MultiHead.hh
"
8
#include "
km3net-dataformat/offline/Evt.hh
"
9
10
#include "
JAAnet/JHead.hh
"
11
12
#include "
JDAQ/JDAQTimesliceIO.hh
"
13
#include "
JDAQ/JDAQEventIO.hh
"
14
#include "
JDAQ/JDAQSummarysliceIO.hh
"
15
16
#include "
JTrigger/JTriggerParameters.hh
"
17
18
#include "
antares-dataformat/TimeSlice.hh
"
19
#include "
antares-dataformat/PhysicsEvent.hh
"
20
21
#include "
JSupport/JSupport.hh
"
22
23
#include "
JROOT/JRootClass.hh
"
24
#include "
JROOT/JROOTClassSelector.hh
"
25
26
#include "
Jeep/JParser.hh
"
27
#include "
Jeep/JMessage.hh
"
28
29
namespace
{
30
31
using namespace
JPP;
32
33
/**
34
* Auxiliary class for printing class information.
35
*/
36
struct
JPrinter_t :
37
public
JROOTClassSelection
38
{
39
/**
40
* Constructor.
41
*
42
* \param out output stream
43
* \param selection selection
44
*/
45
JPrinter_t(std::ostream& out,
const
JROOTClassSelection
& selection) :
46
JROOTClassSelection
(selection),
47
out(out)
48
{}
49
50
51
/**
52
* Print class infomration.
53
*
54
* \param type data type
55
* \return this printer
56
*/
57
template
<
class
T>
58
void
operator()(
const
JType<T>
& type)
const
59
{
60
using namespace
std;
61
using namespace
JPP;
62
63
if
(static_cast<const JROOTClassSelection&>(*
this
)(type)) {
64
JRootClass
(type).
print
(out);
65
}
66
}
67
68
protected
:
69
std::ostream& out;
70
};
71
}
72
73
74
/**
75
* \file
76
* Auxiliary program to print ROOT class information.
77
*
78
* The name of the data structure following option -C should be preceded by a '+' or '-'
79
* to add or remove data types in the output, respectively.\n
80
* In this, ROOT wildcards are accepted (e.g. <tt>-C -\\\.\\*</tt> will remove all data types).
81
* \author mdejong
82
*/
83
int
main
(
int
argc,
char
**argv)
84
{
85
using namespace
std;
86
using namespace
JPP;
87
88
typedef
JTYPELIST<JAllDataTypes_t, JAntaresTypes_t, JHead>::typelist
typelist;
89
90
JPrinter_t printer(cout, getROOTClassSelection<typelist>());
91
int
debug
;
92
93
try
{
94
95
JParser<>
zap(
"Auxiliary program to print ROOT class information."
);
96
97
zap[
'C'
] =
make_field
(printer,
98
"Precede name of data structure by a '+' or '-' "
99
"to add or remove data types in the output, respectively."
100
"\nROOT wildcards are accepted."
) =
JPARSER::initialised
();
101
zap[
'd'
] =
make_field
(
debug
) = 1;
102
103
zap(argc, argv);
104
}
105
catch
(
const
exception& error) {
106
FATAL
(error.what() << endl);
107
}
108
109
for_each
(printer,
JType<typelist>
());
110
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1517
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:309
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:83
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:1993
MultiHead.hh
TimeSlice.hh
JDAQSummarysliceIO.hh
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:41
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
JTriggerParameters.hh
JHead.hh
Generated by
1.8.5