Jpp  master_rocky
the software that should make you happy
Functions
JClonable.cc File Reference

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

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

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Detailed Description

Example program to test JLANG::JClonable class.

Author
mdejong

Definition in file JClonable.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 54 of file JClonable.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 object cloning.");
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  __B__ b;
74  __C__ c;
75 
76  {
77  __A__* p = b.clone();
78 
79  ASSERT(p->get() == __B__::value);
80 
81  delete p;
82  }
83 
84  {
85  __A__* p = c.clone();
86 
87  ASSERT(p->get() == __C__::value);
88 
89  delete p;
90  }
91 
92  return 0;
93 }
#define ASSERT(A,...)
Assert macro.
Definition: JMessage.hh:90
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level
Definition: JSirene.cc:69
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:2142
Utility class to parse command line options.
Definition: JParser.hh:1698
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JSTDTypes.hh:14