Jpp
18.2.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
examples
JTools
JMultiKey.cc
Go to the documentation of this file.
1
2
#include <iostream>
3
#include <iomanip>
4
5
#include "
JTools/JMultiKey.hh
"
6
7
#include "
Jeep/JParser.hh
"
8
#include "
Jeep/JMessage.hh
"
9
10
11
#define PRINT(OUT, A, B, OP) do { OUT << A << ' ' << std::setw(2) << left << #OP << ' ' << B << " ?= " << (A OP B) << std::endl; } while (0)
12
13
14
/**
15
* \file
16
*
17
* Example program to test JTOOLS::JMultiKey class.
18
* \author mdejong
19
*/
20
int
main
(
int
argc,
char
**argv)
21
{
22
using namespace
std;
23
24
int
debug
;
25
26
try
{
27
28
JParser<>
zap(
"Example program to test multi-dimensional key."
);
29
30
zap[
'd'
] =
make_field
(
debug
) = 0;
31
32
zap(argc, argv);
33
}
34
catch
(
const
exception &error) {
35
FATAL
(error.what() << endl);
36
}
37
38
39
using namespace
JPP;
40
41
{
42
const
int
N
= 3;
43
44
typedef
JMultiKey<N, int> JMultiKey1_t;
45
46
JMultiKey1_t
a
, b;
47
48
a.first = 1;
49
a.second.first = 2;
50
a.second.second.first = 3;
51
52
b.first = 1;
53
b.second.first = 2;
54
b.second.second.first = 4;
55
56
PRINT
(cout, a, b, ==);
57
PRINT
(cout, a, b, <);
58
PRINT
(cout, a, b, <=);
59
PRINT
(cout, a, b, >);
60
PRINT
(cout, a, b, >=);
61
}
62
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1514
main
int main(int argc, char *argv[])
Definition:
Main.cc:15
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1989
a
then JCalibrateToT a
Definition:
JTuneHV.sh:113
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JMultiKey.hh
N
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition:
JMuonPostfit.sh:40
JParser.hh
Utility class to parse command line options.
PRINT
#define PRINT(OUT, A, B, OP)
Definition:
JMultiKey.cc:11
debug
int debug
debug level
Definition:
archive-put-wiki-detectors.sh:92
Generated by
1.8.5