Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JClassDef.cc
Go to the documentation of this file.
1#include <string>
2#include <iostream>
3#include <iomanip>
4
5#include "JLang/JType.hh"
6#include "JLang/JBool.hh"
7
8#include "JROOT/JClassDef.hh"
9
11#include "JAAnet/JHead.hh"
12
13#include "Jeep/JPrint.hh"
14#include "Jeep/JParser.hh"
15#include "Jeep/JMessage.hh"
16
17namespace {
18
19 using JLANG::JType;
20 using JLANG::JBool;
21 using JROOT::JClassDef;
22
23 /**
24 * Print data type.
25 *
26 * \param out output stream
27 * \param type data type
28 * \param option option
29 */
30 template<class T>
31 inline void print(std::ostream& out, const JType<T>& type, const JBool<true>& opton)
32 {
33 using namespace std;
34
35 out << "ROOT " << T::Class_Name() << endl;
36 }
37
38 /**
39 * Print data type.
40 *
41 * \param out output stream
42 * \param type data type
43 * \param option option
44 */
45 template<class T>
46 inline void print(std::ostream& out, const JType<T>& type, const JBool<false>& opton)
47 {
48 using namespace std;
49
50 out << "C++ " << typeid(T).name() << endl;
51 }
52
53 /**
54 * Print data type.
55 *
56 * \param out output stream
57 * \param type data type
58 */
59 template<class T>
60 inline void print(std::ostream& out, const JType<T>& type)
61 {
62 print(out, type, JBool<JClassDef<T>::value>());
63 }
64}
65
66
67/**
68 * \file
69 *
70 * Program to test JROOT::JClassDef.
71 * \author mdejong
72 */
73int main(int argc, char **argv)
74{
75 using namespace std;
76 using namespace JPP;
77
78 int debug;
79
80 try {
81
82 JParser<> zap("Program to test JClassDef.");
83
84 zap['d'] = make_field(debug) = 3;
85
86 zap(argc, argv);
87 }
88 catch(const exception& error) {
89 FATAL(error.what() << endl);
90 }
91
92 print(cout, JType<JHead>());
93 print(cout, JType<double>());
94
95 return 0;
96}
int main(int argc, char **argv)
Definition JClassDef.cc:73
General purpose messaging.
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
I/O formatting auxiliaries.
void print(const TH1 &h1, std::ostream &out)
Print histogram parameters.
Utility class to parse command line options.
Definition JParser.hh:1698
Test ROOT ClassDef.
Definition JClassDef.hh:22
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary template class for type bool.
Definition JBool.hh:21
Auxiliary class for a type holder.
Definition JType.hh:19