Jpp
Namespaces | Functions
JAutoMap.cc File Reference
#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

 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 51 of file JAutoMap.cc.

52 {
53  using namespace std;
54 
55  int debug;
56 
57  try {
58 
59  JParser<> zap("Example program to test automatic generation of map based on data types.");
60 
61  zap['d'] = make_field(debug) = 0;
62 
63  zap(argc, argv);
64  }
65  catch(const exception &error) {
66  FATAL(error.what() << endl);
67  }
68 
69 
70  using namespace JPP;
71 
72  typedef
73  JTypeList<int,
74  JTypeList<char,
75  JTypeList<double,
76  JTypeList<float> > > > JDataTypes_t;
77 
78  {
79  JAutoMap_t zmap;
80 
81  zmap.insert<JDataTypes_t>();
82 
83  for (JAutoMap_t::const_iterator i = zmap.begin(); i != zmap.end(); ++i)
84  cout << setw(2) << i->first << ' ' << i->second << endl;
85  }
86 
87  {
88  JAutoMap_t zmap;
89 
90  zmap.insert<JDataTypes_t>(JAutomate<JElement_t>());
91 
92  for (JAutoMap_t::const_iterator i = zmap.begin(); i != zmap.end(); ++i)
93  cout << setw(2) << i->first << ' ' << i->second << endl;
94  }
95 }
JPARSER::JParser
Utility class to parse command line options.
Definition: JParser.hh:1493
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
debug
int debug
debug level
Definition: JSirene.cc:59
JLANG::JTypeList
Type list.
Definition: JTypeList.hh:22
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
std
Definition: jaanetDictionary.h:36
JTOOLS::JAutomate
Auxiliary class for automatic element creation.
Definition: JAutoMap.hh:40
FATAL
#define FATAL(A)
Definition: JMessage.hh:67