Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JClass.cc File Reference

Example program to test JLANG::JClass class. More...

#include <iostream>
#include <iomanip>
#include <vector>
#include "JLang/JClass.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Macros

#define PRINT(OUT, T)
 Print class parameters.
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test JLANG::JClass class.

Author
mdejong

Definition in file JClass.cc.

Macro Definition Documentation

◆ PRINT

#define PRINT ( OUT,
T )
Value:
print<T>(OUT, #T)
void print(const TH1 &h1, std::ostream &out)
Print histogram parameters.

Print class parameters.

Parameters
OUToutput stream
Tclass

Definition at line 43 of file JClass.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 52 of file JClass.cc.

53{
54 using namespace std;
55 using namespace JPP;
56
57 int debug;
58
59 try {
60
61 JParser<> zap("Example program to test class inspection.");
62
63 zap['d'] = make_field(debug) = 3;
64
65 zap(argc, argv);
66 }
67 catch(const exception &error) {
68 FATAL(error.what() << endl);
69 }
70
71 if (debug >= debug_t) {
72
73 cout << setw(36) << left << "name";
74 cout << setw(12) << "primitive";
75 cout << setw(12) << " pointer";
76 cout << setw(12) << "reference";
77 cout << setw(12) << "constant";
78 cout << endl;
79
80 cout << setfill('.');
81
82 PRINT(cout, int);
83 PRINT(cout, int&);
84 PRINT(cout, const int*);
85 PRINT(cout, __A__);
86
89 }
90
95
100
105
110
113
117
119 ASSERT(is_iterator<vector<__A__>::const_iterator>::value == true);
121 ASSERT(is_iterator<vector<__A__>::const_reverse_iterator>::value == true);
122
123 return 0;
124}
#define PRINT(OUT, T)
Print class parameters.
Definition JClass.cc:43
#define ASSERT(A,...)
Assert macro.
Definition JMessage.hh:90
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Template for generic class types.
Definition JClass.hh:80
JArgument< T >::argument_type argument_type
Definition JClass.hh:82
Data structure to check whether given data type is an iterator.
Definition JClass.hh:62