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

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

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

Go to the source code of this file.

Macros

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

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test JLANG::JAbstractClass class.

Author
mdejong

Definition in file JAbstractClass.cc.

Macro Definition Documentation

#define PRINT (   OUT,
  T 
)    print<T>(OUT, #T)

Print class parameters.

Parameters
OUToutput stream
Tclass

Definition at line 46 of file JAbstractClass.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 55 of file JAbstractClass.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(36) << left << "name";
77  cout << setw(12) << "abstract";
78  cout << endl;
79 
80  cout << setfill('.');
81 
82  PRINT(cout, int);
83  PRINT(cout, __A__);
84  PRINT(cout, __C__);
85  }
86 
87  ASSERT(!JAbstractClass<int> ::is_abstract);
88  ASSERT(!JAbstractClass<__A__>::is_abstract);
89  ASSERT( JAbstractClass<__C__>::is_abstract);
90 }
Utility class to parse command line options.
Definition: JParser.hh:1514
debug
Definition: JMessage.hh:29
#define PRINT(OUT, T)
Print class parameters.
#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