Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JObject.cc File Reference

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

#include <iostream>
#include <iomanip>
#include <vector>
#include <iterator>
#include "JLang/JObject.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::JObject class.

Author
mdejong

Definition in file JObject.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 59 of file JObject.cc.

60{
61 using namespace std;
62
63 int debug;
64
65 try {
66
67 JParser<> zap("Example program to test object.");
68
69 zap['d'] = make_field(debug) = 3;
70
71 zap(argc, argv);
72 }
73 catch(const exception &error) {
74 FATAL(error.what() << endl);
75 }
76
77
78 using namespace JPP;
79
80 buffer_type buffer;
81
82 process(__A__(3, buffer).getInstance());
83 process(getInstance(__A__(2, buffer)));
84 //process(__A__(5, buffer)); // compiler error: invalid initialization of non-const reference (as should be)
85
86 for (buffer_type::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
87 cout << *i << endl;
88 }
89}
#define FATAL(A)
Definition JMessage.hh:67
int debug
debug level
Definition JSirene.cc:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition JParser.hh:2142
Utility class to parse command line options.
Definition JParser.hh:1698
T & getInstance(const T &object)
Get static instance from temporary object.
Definition JObject.hh:75
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).