Jpp 19.3.0-rc.5
the software that should make you happy
Loading...
Searching...
No Matches
JAutoMap.cc File Reference

Example program to test JTOOLS::JAutoMap class. More...

#include <iostream>
#include <iomanip>
#include <string>
#include "JTools/JAutoMap.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Namespaces

namespace  JTOOLS
 Auxiliary classes and methods for multi-dimensional interpolations and histograms.
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test JTOOLS::JAutoMap class.

Author
mdejong

Definition in file JAutoMap.cc.

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 55 of file JAutoMap.cc.

56{
57 using namespace std;
58 using namespace JPP;
59
60 int debug;
61
62 try {
63
64 JParser<> zap("Example program to test automatic generation of map based on data types.");
65
66 zap['d'] = make_field(debug) = 0;
67
68 zap(argc, argv);
69 }
70 catch(const exception &error) {
71 FATAL(error.what() << endl);
72 }
73
74
75 typedef
76 JTypeList<int,
77 JTypeList<char,
78 JTypeList<double,
79 JTypeList<float> > > > JDataTypes_t;
80
81 {
82 JAutoMap_t zmap;
83
84 zmap.insert<JDataTypes_t>();
85
86 cout << "First method" << endl;
87
88 for (JAutoMap_t::const_iterator i = zmap.begin(); i != zmap.end(); ++i) {
89 cout << setw(2) << i->first << ' ' << i->second << endl;
90 }
91 }
92
93 {
94 JAutoMap_t zmap;
95
96 zmap.insert<JDataTypes_t>(JAutomate<JElement_t>());
97
98 cout << "Second method" << endl;
99
100 for (JAutoMap_t::const_iterator i = zmap.begin(); i != zmap.end(); ++i) {
101 cout << setw(2) << i->first << ' ' << i->second << endl;
102 }
103 }
104}
#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
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Type list.
Definition JTypeList.hh:23
Auxiliary class for automatic element creation.
Definition JAutoMap.hh:46