Jpp
pmt_effective_area_update
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
examples
Jeep
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
11
using 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
*/
26
int
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
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1500
JEEP::getValue
double getValue(const JScale_t scale)
Get numerical value corresponding to scale.
Definition:
JScale.hh:47
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
JEEP::exa_t
exa
Definition:
JScale.hh:37
JEEP::micro_t
micro
Definition:
JScale.hh:29
PRINT
#define PRINT(out, scale)
Definition:
JScale.cc:13
JEEP::getScale
JScale_t getScale(const char unit)
Get scale corresponding to textual unit.
Definition:
JScale.hh:111
JEEP::kilo_t
kilo
Definition:
JScale.hh:32
JEEP::milli_t
milli
Definition:
JScale.hh:30
JEEP::peta_t
peta
Definition:
JScale.hh:36
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1961
JEEP::femto_t
femto
Definition:
JScale.hh:26
JScale.hh
Enumeration for scaling of quantity.
debug
int debug
debug level
Definition:
JSirene.cc:63
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JEEP::mega_t
mega
Definition:
JScale.hh:33
JEEP::nano_t
nano
Definition:
JScale.hh:28
JParser.hh
Utility class to parse command line options.
JEEP::pico_t
pico
Definition:
JScale.hh:27
JEEP::unit_t
unit
Definition:
JScale.hh:31
JEEP::tera_t
tera
Definition:
JScale.hh:35
Generated by
1.8.5