Jpp  18.4.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
JObjectIterator.cc File Reference

Example program to test JLANG::JObjectIterator class. More...

#include <string>
#include <iostream>
#include <iomanip>
#include <sstream>
#include "JLang/JObjectIterator.hh"
#include "JLang/JStreamObjectIterator.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test JLANG::JObjectIterator class.

Author
mdejong

Definition in file JObjectIterator.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 20 of file JObjectIterator.cc.

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 }
Utility class to parse command line options.
Definition: JParser.hh:1514
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#define FATAL(A)
Definition: JMessage.hh:67
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48
int debug
debug level
#define DEBUG(A)
Message macros.
Definition: JMessage.hh:62