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

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

#include <iostream>
#include <iomanip>
#include "JLang/JConstructor.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::JConstructor class.

Author
mdejong

Definition in file JConstructor.cc.

Macro Definition Documentation

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

Print class parameters.

Parameters
OUToutput stream
Uclass
Vclass

Definition at line 46 of file JConstructor.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 55 of file JConstructor.cc.

56 {
57  using namespace std;
58  using namespace JPP;
59 
60  int debug;
61 
62  try {
63 
64  JParser<> zap("Example program to test class inspection.");
65 
66  zap['d'] = make_field(debug) = 3;
67 
68  zap(argc, argv);
69  }
70  catch(const exception &error) {
71  FATAL(error.what() << endl);
72  }
73 
74  if (debug >= debug_t) {
75 
76  cout << setw(16) << left << "name";
77  cout << " has constructor ";
78  cout << endl;
79 
80  PRINT(cout, __A__, __A__);
81  PRINT(cout, __C__, __A__);
82  PRINT(cout, __C__, __B__);
83  }
84 
85  ASSERT(( JConstructor<__A__, __A__>::has_constructor));
86  ASSERT(( JConstructor<__C__, __A__>::has_constructor));
87  ASSERT((!JConstructor<__C__, __B__>::has_constructor));
88 }
Utility class to parse command line options.
Definition: JParser.hh:1514
#define PRINT(OUT, U, V)
Print class parameters.
Definition: JConstructor.cc:46
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:1989
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level