Example program to test JLANG::JSTDObjectReader class.
More...
#include <string>
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include "JLang/JSTDObjectReader.hh"
#include "JLang/JConversionIterator.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
| int | main (int argc, char **argv) |
| |
Example program to test JLANG::JSTDObjectReader class.
- Author
- mdejong
Definition in file JSTDObjectReader.cc.
◆ main()
| int main |
( |
int | argc, |
|
|
char ** | argv ) |
Definition at line 21 of file JSTDObjectReader.cc.
22{
24
26
27 try {
28
29 JParser<> zap(
"Example program to test object iteration using STD containers.");
30
32
33 zap(argc, argv);
34 }
35 catch(const exception &error) {
36 FATAL(error.what() << endl);
37 }
38
39
41
43
45
46 for (int i = 0; i != 3; ++i) {
47 buffer.push_back(i + 0.1);
48 }
49
50 {
52
53 for (int i = 0; in.hasNext(); ++i) {
54
55 const double value = *in.next();
56
58
59 ASSERT(value == buffer[i]);
60 }
61
62 in.rewind();
63
65
66 for (int i = 0; out.hasNext(); ++i) {
67
68 const int value = *in.next();
69
71
72 ASSERT(value == (
int) buffer[i]);
73 }
74 }
75 {
77
78 for (int i = 0; in.hasNext(); ++i) {
79
80 const double value = *in.next();
81
83
84 ASSERT(value == buffer[i]);
85 }
86 }
87
88 return 0;
89}
#define DEBUG(A)
Message macros.
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Template definition of a multi-dimensional oscillation probability interpolation table.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).