Example program to test JLANG::JMultiPointer class.
More...
#include <iostream>
#include <iomanip>
#include "JLang/JMultiPointer.hh"
#include "JLang/JType.hh"
#include "Jeep/JParser.hh"
#include "Jeep/JMessage.hh"
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
Example program to test JLANG::JMultiPointer class.
- Author
- mdejong
Definition in file JMultiPointer.cc.
◆ main()
int main |
( |
int | argc, |
|
|
char ** | argv ) |
Definition at line 81 of file JMultiPointer.cc.
82{
84
86
87 try {
88
89 JParser<> zap(
"Example program to test multi pointer.");
90
92
93 zap(argc, argv);
94 }
95 catch(const exception &error) {
96 FATAL(error.what() << endl);
97 }
98
99
101
102 {
104
106
107 delete ps.get<int>();
108 }
109
110
111 {
112 typedef
116
118
120 ps.
reset(
new int(1));
121 ps.
reset(
new double(123.456));
122
123 *ps.
get<
int>() += 10;
124
128
129 delete ps.
get<
int> ();
130 delete ps.
get<
double>();
131 }
132}
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.
std::ostream & print(std::ostream &out, const JTestSummary &summary, const char delimiter=' ', const bool useColors=true)
Print test summary.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
General purpose class for multiple pointers.
T * get() const
Get single pointer.
void reset(const JMultiPointer< JClass_t > &pointer)
Reset multi-pointer.