Jpp  18.0.0-rc.4
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Macros | Functions
JEnumeration.cc File Reference

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

#include <string>
#include <iostream>
#include <iomanip>
#include "JLang/JTypeList.hh"
#include "JLang/JTypeID.hh"
#include "JLang/JEnumeration.hh"
#include "JROOT/JRootLabel.hh"
#include "JDAQ/JDAQTimesliceIO.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Classes

struct  JTypeID< int >
 
struct  JTypeID< long int >
 
struct  JTypeID< std::string >
 
struct  JTypeID< double >
 
struct  JTypeID< __A__ >
 
struct  __B__< T >
 
struct  JTypeID< KM3NETDAQ::JDAQTimeslice >
 

Macros

#define PRINT(OUT, ENUMERATION, CLASS)   OUT << setw(10) << left << #CLASS << " --> " << ENUMERATION.getLabel(JLANG::JType<CLASS>()).getID() << endl;
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test JLANG::JEnumeration class.

Author
mdejong

Definition in file JEnumeration.cc.

Macro Definition Documentation

#define PRINT (   OUT,
  ENUMERATION,
  CLASS 
)    OUT << setw(10) << left << #CLASS << " --> " << ENUMERATION.getLabel(JLANG::JType<CLASS>()).getID() << endl;

Definition at line 43 of file JEnumeration.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 53 of file JEnumeration.cc.

54 {
55  using namespace std;
56 
57  int debug;
58 
59  try {
60 
61  JParser<> zap("Example program to test class enumeration.");
62 
63  zap['d'] = make_field(debug) = 0;
64 
65  zap(argc, argv);
66  }
67  catch(const exception &error) {
68  FATAL(error.what() << endl);
69  }
70 
71 
72  using namespace JPP;
73 
74 
75  typedef
76  JTypeList<int,
77  JTypeList<__A__,
78  JTypeList<__B__,
81  JTypeList<double> > > > > > JTypelist_t;
82 
83 
84  const JEnumeration<JTypelist_t> enumeration;
85 
86 
87  enumeration.print(cout);
88 
89  PRINT(cout, enumeration, int);
90  PRINT(cout, enumeration, __B__);
91 }
Utility class to parse command line options.
Definition: JParser.hh:1514
Enumeration of single data type.
Definition: JEnumeration.hh:46
Type list.
Definition: JTypeList.hh:22
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
then awk string
Data time slice.
#define FATAL(A)
Definition: JMessage.hh:67
static std::ostream & print(std::ostream &out)
Print enumeration.
Definition: JEnumeration.hh:80
int debug
debug level
#define PRINT(OUT, ENUMERATION, CLASS)
Definition: JEnumeration.cc:43