Jpp  18.2.1-ARCA-DF-PATCH
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions
JMultiEquals.cc File Reference

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

#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

#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 113 of file JMultiEquals.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 123 of file JMultiEquals.cc.

124 {
125  using namespace std;
126  using namespace JPP;
127 
128  int debug;
129 
130  try {
131 
132  JParser<> zap("Example program to test object comparisons.");
133 
134  zap['d'] = make_field(debug) = 3;
135 
136  zap(argc, argv);
137  }
138  catch(const exception &error) {
139  FATAL(error.what() << endl);
140  }
141 
142  __C__ c1(1,1);
143  __C__ c2(1,1);
144  __C__ c3(0,1);
145  __C__ c4(1,0);
146 
147  PRINT(cout, ==, c1, c2);
148  PRINT(cout, !=, c1, c2);
149  PRINT(cout, ==, c1, c3);
150  PRINT(cout, !=, c1, c3);
151  PRINT(cout, ==, c1, c4);
152  PRINT(cout, !=, c1, c4);
153 
154  ASSERT(c1 == c2);
155  ASSERT(c1 != c3);
156  ASSERT(c1 == c4);
157 
158  __D__ d1(1,1);
159  __D__ d2(1,1);
160  __D__ d3(0,1);
161  __D__ d4(1,0);
162 
163  PRINT(cout, ==, d1, d2);
164  PRINT(cout, !=, d1, d2);
165  PRINT(cout, ==, d1, d3);
166  PRINT(cout, !=, d1, d3);
167  PRINT(cout, ==, d1, d4);
168  PRINT(cout, !=, d1, d4);
169 
170  ASSERT(d1 == d2);
171  ASSERT(d1 != d3);
172  ASSERT(d1 != d4);
173 
174  return 0;
175 }
Utility class to parse command line options.
Definition: JParser.hh:1514
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1989
#define FATAL(A)
Definition: JMessage.hh:67
TCanvas * c1
Global variables to handle mouse events.
then echo Launching message logger in new window xterm geometry e JGetMessage H $HOST T $TAG d3
#define PRINT(OUT, OP, A, B)
Print.
int debug
debug level