Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
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)
 

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

◆ PRINT

#define PRINT ( OUT,
ENUMERATION,
CLASS )
Value:
OUT << setw(10) << left << #CLASS << " --> " << ENUMERATION.getLabel(JLANG::JType<CLASS>()).getID() << endl;
Auxiliary class for a type holder.
Definition JType.hh:19

Definition at line 43 of file JEnumeration.cc.

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

Function Documentation

◆ main()

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__,
80 JTypeList<std::string,
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}
#define PRINT(OUT, ENUMERATION, CLASS)
#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).
Enumeration of single data type.
static std::ostream & print(std::ostream &out)
Print enumeration.
Type list.
Definition JTypeList.hh:23