Jpp
 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 94 of file JMultiEquals.cc.

Function Documentation

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 }
Utility class to parse command line options.
Definition: JParser.hh:1410
#define ASSERT(A)
Assert macro.
Definition: JMessage.hh:72
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1836
int debug
debug level
Definition: JSirene.cc:59
#define FATAL(A)
Definition: JMessage.hh:65
TCanvas * c1
Global variables to handle mouse events.
#define PRINT(OUT, OP, A, B)
Print.
Definition: JMultiEquals.cc:94