Jpp
Functions
JHashCollection.cc File Reference
#include <iostream>
#include <iomanip>
#include <cmath>
#include "JTools/JHashCollection.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 JTOOLS::JHashCollection class.

Author
mdejong

Definition in file JHashCollection.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 52 of file JHashCollection.cc.

53 {
54  using namespace std;
55 
56  double precision;
57  int debug;
58 
59  try {
60 
61  JParser<> zap("Example program to test hash collection.");
62 
63  zap['e'] = make_field(precision) = 1.0e-3;
64  zap['d'] = make_field(debug) = 0;
65 
66  zap(argc, argv);
67  }
68  catch(const exception &error) {
69  FATAL(error.what() << endl);
70  }
71 
72 
73  using namespace JPP;
74 
75  typedef JHashCollection<double, get_value> hash_collection;
76 
77  hash_collection buffer(precision);
78 
79  for (double x = 2.0; x >= 1.0; x -= 0.1) {
80  buffer.insert(x);
81  }
82 
83  for (hash_collection::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
84  cout << *i << endl;
85  }
86 }
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
make_field
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1954
std
Definition: jaanetDictionary.h:36
FATAL
#define FATAL(A)
Definition: JMessage.hh:67