Jpp
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
examples
JLang
JObjectIterator.cc
Go to the documentation of this file.
1
2
#include <string>
3
#include <iostream>
4
#include <iomanip>
5
#include <sstream>
6
7
#include "
JLang/JObjectIterator.hh
"
8
#include "
JLang/JStreamObjectIterator.hh
"
9
10
#include "
Jeep/JParser.hh
"
11
#include "
Jeep/JMessage.hh
"
12
13
14
/**
15
* \file
16
*
17
* Example program to test JLANG::JObjectIterator 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 object iteration."
);
29
30
zap[
'd'
] =
make_field
(
debug
) = 3;
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
stringstream buffer;
42
43
for
(
int
i = 1; i != 5; ++i) {
44
buffer <<
' '
<< i;
45
}
46
47
typedef
int
JType_t;
48
49
JStreamObjectIterator<JType_t>
in
(buffer);
50
51
for
(
int
i = 1; in.hasNext(); ++i) {
52
53
int
value = *in.next();
54
55
DEBUG
(value << endl);
56
57
ASSERT
(value == i);
58
}
59
60
return
0;
61
}
JPARSER::JParser
Utility class to parse command line options.
Definition:
JParser.hh:1493
JStreamObjectIterator.hh
in
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
Definition:
JSirene.sh:45
ASSERT
#define ASSERT(A,...)
Assert macro.
Definition:
JMessage.hh:90
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition:
JParser.hh:1954
debug
int debug
debug level
Definition:
JSirene.cc:61
JMessage.hh
General purpose messaging.
FATAL
#define FATAL(A)
Definition:
JMessage.hh:67
JObjectIterator.hh
JParser.hh
Utility class to parse command line options.
DEBUG
#define DEBUG(A)
Message macros.
Definition:
JMessage.hh:62
main
int main(int argc, char *argv[])
Definition:
Main.cpp:15
Generated by
1.8.5