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

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

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

Author
mdejong

Definition in file JSharedPointer.cc.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 35 of file JSharedPointer.cc.

36 {
37  using namespace std;
38 
39  unsigned int N;
40  int debug;
41 
42  try {
43 
44  JParser<> zap("Example program to test shared pointer.");
45 
46  zap['n'] = make_field(N) = 4;
47  zap['d'] = make_field(debug) = 3;
48 
49  zap(argc, argv);
50  }
51  catch(const exception &error) {
52  FATAL(error.what() << endl);
53  }
54 
55 
56  using namespace JPP;
57 
58 
59  typedef JSharedPointer<__A__> JSharedPointer_t;
60 
61  JSharedPointer_t a;
62 
63  cout << "JSharedPointer::create()" << endl;
64 
65  a.create();
66 
68 
69  for (unsigned int i = 0; i != N; ++i) {
70 
71  cout << "buffer.push_back() " << i << endl;
72 
73  buffer.push_back(a);
74  }
75 
76  for (unsigned int i = 0; i != N; ++i) {
77  cout << "buffer[" << i << "] is valid? " << buffer[i].is_valid() << endl;
78  }
79 }
Utility class to parse command line options.
Definition: JParser.hh:1517
then JShowerPostfit f $INPUT_FILE o $OUTPUT_FILE N
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Definition: JParser.hh:1993
then JCalibrateToT a
Definition: JTuneHV.sh:116
#define FATAL(A)
Definition: JMessage.hh:67
int debug
debug level