Jpp
Macros | Functions
JMultiEquals.cc File Reference
#include <iostream>
#include <iomanip>
#include "JLang/JEquals.hh"
#include "JLang/JMultiEquals.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Macros

#define PRINT(OUT, OP, A, B)   OUT << "(" << A << ") " << #OP " (" << B << ") => " << (A OP B) << std::endl;
 Print. More...
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test JLANG::JMultiEquals class.

Author
mdejong

Definition in file JMultiEquals.cc.

Macro Definition Documentation

◆ PRINT

#define PRINT (   OUT,
  OP,
  A,
 
)    OUT << "(" << A << ") " << #OP " (" << B << ") => " << (A OP B) << std::endl;

Print.

Parameters
OUToutput stream
OPoperator
Afirst object
Bsecond object

Definition at line 94 of file JMultiEquals.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 104 of file JMultiEquals.cc.

105 {
106  using namespace std;
107  using namespace JPP;
108 
109  int debug;
110 
111  try {
112 
113  JParser<> zap("Example program to test object comparisons.");
114 
115  zap['d'] = make_field(debug) = 3;
116 
117  zap(argc, argv);
118  }
119  catch(const exception &error) {
120  FATAL(error.what() << endl);
121  }
122 
123  __C__ c1(1,1);
124  __C__ c2(1,1);
125  __C__ c3(0,1);
126  __C__ c4(1,0);
127 
128  PRINT(cout, ==, c1, c2);
129  PRINT(cout, !=, c1, c2);
130  PRINT(cout, ==, c1, c3);
131  PRINT(cout, !=, c1, c3);
132  PRINT(cout, ==, c1, c4);
133  PRINT(cout, !=, c1, c4);
134 
135  ASSERT(c1 == c2);
136  ASSERT(c1 != c3);
137  ASSERT(c1 != c4);
138 
139  return 0;
140 }
ASSERT
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
c1
TCanvas * c1
Global variables to handle mouse events.
Definition: JDrawModule3D.cc:34
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
PRINT
#define PRINT(OUT, OP, A, B)
Print.
Definition: JMultiEquals.cc:94
std
Definition: jaanetDictionary.h:36
FATAL
#define FATAL(A)
Definition: JMessage.hh:67