Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JComparisonAvailable.cc File Reference

Example program to test JLANG::JComparisonAvailable and JLANG::JComparable classes. More...

#include <iostream>
#include <iomanip>
#include "JLang/JComparable.hh"
#include "JLang/JEquals.hh"
#include "JLang/JMultiEquals.hh"
#include "JLang/JComparisonAvailable.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Macros

#define PRINT(OUT, CLASS)
 Print availabilty of comparison operators.
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test JLANG::JComparisonAvailable and JLANG::JComparable classes.

Author
mdejong

Definition in file JComparisonAvailable.cc.

Macro Definition Documentation

◆ PRINT

#define PRINT ( OUT,
CLASS )
Value:
OUT << std::setw(6) << std::left << #CLASS << ' ' ; \
OUT << ' ' << JComparisonAvailable<CLASS>::has_eq << ' '; \
OUT << ' ' << JComparisonAvailable<CLASS>::has_ne << ' '; \
OUT << ' ' << JComparisonAvailable<CLASS>::has_lt << ' '; \
OUT << ' ' << JComparisonAvailable<CLASS>::has_gt << ' '; \
OUT << ' ' << JComparisonAvailable<CLASS>::has_le << ' '; \
OUT << ' ' << JComparisonAvailable<CLASS>::has_ge << std::endl;
Template definition of test availability of comparison operators.

Print availabilty of comparison operators.

Parameters
OUToutput stream
CLASSclass name

Definition at line 47 of file JComparisonAvailable.cc.

47#define PRINT(OUT, CLASS) \
48 OUT << std::setw(6) << std::left << #CLASS << ' ' ; \
49 OUT << ' ' << JComparisonAvailable<CLASS>::has_eq << ' '; \
50 OUT << ' ' << JComparisonAvailable<CLASS>::has_ne << ' '; \
51 OUT << ' ' << JComparisonAvailable<CLASS>::has_lt << ' '; \
52 OUT << ' ' << JComparisonAvailable<CLASS>::has_gt << ' '; \
53 OUT << ' ' << JComparisonAvailable<CLASS>::has_le << ' '; \
54 OUT << ' ' << JComparisonAvailable<CLASS>::has_ge << std::endl;

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 63 of file JComparisonAvailable.cc.

64{
65 using namespace std;
66 using namespace JPP;
67
68 int debug;
69
70 try {
71
72 JParser<> zap("Example program to test availability of object comparisons.");
73
74 zap['d'] = make_field(debug) = 3;
75
76 zap(argc, argv);
77 }
78 catch(const exception &error) {
79 FATAL(error.what() << endl);
80 }
81
82 if (debug >= debug_t) {
83
84 cout << setw(6) << left << "class" << ' ' << "eq ne lt gt le ge" << endl;
85
86 PRINT(cout, __A__);
87 PRINT(cout, __B__);
88 PRINT(cout, __C__);
89 PRINT(cout, __D__);
90 PRINT(cout, __E__);
91 }
92
99
106
113
120
121 return 0;
122}
#define PRINT(OUT, CLASS)
Print availabilty of comparison operators.
#define ASSERT(A,...)
Assert macro.
Definition JMessage.hh:90
#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
@ debug_t
debug
Definition JMessage.hh:29
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).