Jpp
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
12
#define PRINT(OUT, A, B, OP) do { OUT << A << ' ' << std::setw(2) << left << #OP << ' ' << B << " ?= " << (A OP B) << std::endl; } while (0)
13
14
15
/**
16
* \file
17
*
18
* Example program to test JTOOLS::JMultiKey class.
19
* \author mdejong
20
*/
21
int
main
(
int
argc,
char
**argv)
22
{
23
using namespace
std
;
24
25
int
debug
;
26
27
try
{
28
29
JParser<>
zap(
"Example program to test multi-dimensional key."
);
30
31
zap[
'd'
] =
make_field
(
debug
) = 0;
32
33
zap(argc, argv);
34
}
35
catch
(
const
exception &error) {
36
FATAL
(error.what() << endl);
37
}
38
39
40
using namespace
JPP
;
41
42
{
43
const
int
N = 3;
44
45
typedef
JMultiKey<N, int> JMultiKey1_t;
46
47
JMultiKey1_t a, b;
48
49
a.first = 1;
50
a.second.first = 2;
51
a.second.second.first = 3;
52
53
b.first = 1;
54
b.second.first = 2;
55
b.second.second.first = 4;
56
57
PRINT
(cout, a, b, ==);
58
PRINT
(cout, a, b, <);
59
PRINT
(cout, a, b, <=);
60
PRINT
(cout, a, b, >);
61
PRINT
(cout, a, b, >=);
62
}
63
}
PRINT
#define PRINT(OUT, A, B, OP)
Definition:
JMultiKey.cc:12
JMessage.hh
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JMultiKey.hh
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition:
JAAnetToolkit.hh:37
debug
int debug
debug level
Definition:
JSirene.cc:59
JParser.hh
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
std
Definition:
jaanetDictionary.h:36
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
main
int main(int argc, char **argv)
Definition:
JMultiKey.cc:21
Generated by
1.8.16