Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JScale.cc
Go to the documentation of this file.
1#include <string>
2#include <iostream>
3#include <iomanip>
4
5#include "Jeep/JScale.hh"
6
7#include "Jeep/JParser.hh"
8#include "Jeep/JMessage.hh"
9
10
11using namespace std;
12
13#define PRINT(out, scale) {\
14 out << setw(8) << left << #scale << ' ' \
15 << scientific << setprecision(0) << getValue(scale) << ' ' \
16 << getUnit(scale) \
17 << endl; \
18 }
19
20
21/**
22 * \file
23 * Example program to test JEEP::JScale_t enumeration.
24 * \author mdejong
25 */
26int main(int argc, char* argv[])
27{
28 using namespace std;
29
30 char unit;
31 int debug;
32
33 try {
34
35 JParser<> zap;
36
37 zap['U'] = make_field(unit) = ' ';
38 zap['d'] = make_field(debug) = 1;
39
40 zap(argc, argv);
41 }
42 catch(const exception &error) {
43 FATAL(error.what() << endl);
44 }
45
46
47 using namespace JPP;
48
49 cout << "unit [" << unit << "] " << scientific << setprecision(0) << getValue(getScale(unit)) << endl;
50
51 PRINT(cout, femto_t);
52 PRINT(cout, pico_t);
53 PRINT(cout, nano_t);
54 PRINT(cout, micro_t);
55 PRINT(cout, milli_t);
56 PRINT(cout, unit_t);
57 PRINT(cout, kilo_t);
58 PRINT(cout, mega_t);
59 PRINT(cout, tera_t);
60 PRINT(cout, peta_t);
61 PRINT(cout, exa_t);
62}
63
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
int main(int argc, char *argv[])
Definition JScale.cc:26
#define PRINT(out, scale)
Definition JScale.cc:13
Enumeration for scaling of quantity.
Utility class to parse command line options.
Definition JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).