Jpp  15.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions
JConversion.cc File Reference

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

#include <iostream>
#include <iomanip>
#include "JLang/JConversion.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"

Go to the source code of this file.

Macros

#define PRINT(OUT, U, V)   print<U,V>(OUT, #U, #V)
 Print class parameters. More...
 

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test JLANG::JConversion class.

Author
mdejong

Definition in file JConversion.cc.

Macro Definition Documentation

#define PRINT (   OUT,
  U,
 
)    print<U,V>(OUT, #U, #V)

Print class parameters.

Parameters
OUToutput stream
Uclass
Vclass

Definition at line 45 of file JConversion.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 54 of file JConversion.cc.

55 {
56  using namespace std;
57  using namespace JPP;
58 
59  int debug;
60 
61  try {
62 
63  JParser<> zap("Example program to test class inspection.");
64 
65  zap['d'] = make_field(debug) = 3;
66 
67  zap(argc, argv);
68  }
69  catch(const exception &error) {
70  FATAL(error.what() << endl);
71  }
72 
73  if (debug >= debug_t) {
74 
75  cout << setw(36) << left << "name";
76  cout << setw(12) << " same ";
77  cout << setw(12) << " derived";
78  cout << endl;
79 
80  cout << setfill('.');
81 
82  PRINT(cout, __A__, __A__);
83  PRINT(cout, __B__, __A__);
84  PRINT(cout, __A__, __B__);
85  PRINT(cout, __A__, __B__);
86  }
87 
88  ASSERT(( JConversion<__A__, __A__>::is_same));
89  ASSERT(( JConversion<__B__, __A__>::is_derived));
90  ASSERT((!JConversion<__A__, __B__>::is_same));
91  ASSERT((!JConversion<__A__, __B__>::is_derived));
92 }
Utility class to parse command line options.
Definition: JParser.hh:1500
debug
Definition: JMessage.hh:29
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1961
int debug
debug level
Definition: JSirene.cc:63
#define FATAL(A)
Definition: JMessage.hh:67
#define PRINT(OUT, U, V)
Print class parameters.
Definition: JConversion.cc:45