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.
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 21 of file JSTDObjectReader.cc.
29 JParser<> zap(
"Example program to test object iteration using STD containers.");
35 catch(
const exception &error) {
36 FATAL(error.what() << endl);
46 for (
int i = 0; i != 3; ++i) {
47 buffer.push_back(i + 0.1);
51 JSTDObjectReader<double>
in(buffer);
53 for (
int i = 0;
in.hasNext(); ++i) {
55 const double value = *
in.next();
57 DEBUG(
"in " << value << endl);
59 ASSERT(value == buffer[i]);
64 JConversionIterator<double, int> out(
in);
66 for (
int i = 0; out.hasNext(); ++i) {
68 const int value = *
in.next();
70 DEBUG(
"out " << value << endl);
72 ASSERT(value == (
int) buffer[i]);
76 JSTDObjectReader<const double>
in(buffer);
78 for (
int i = 0;
in.hasNext(); ++i) {
80 const double value = *
in.next();
82 DEBUG(
"in " << value << endl);
84 ASSERT(value == buffer[i]);
Utility class to parse command line options.
esac print_variable DETECTOR INPUT_FILE OUTPUT_FILE CDF for TYPE in
#define ASSERT(A,...)
Assert macro.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
#define DEBUG(A)
Message macros.