34 #define HANDLETEST_VERSION \ 35 "HANDLETEST V1.0 test handle containers" 39 #include <tfxx/commandline.h> 40 #include <tfxx/handle.h> 41 #include <tfxx/range.h> 48 #define CODE(line) cout.width(50); cout << endl << #line << "; --> "; line 51 #define ILLEGAL(line) cout.width(50); cout << #line << \ 52 "; !!! does not compile!" << endl; 66 virtual void print()
const { cout <<
"ERROR: called base!" << endl; }
72 void print()
const { cout <<
Mv << endl; }
80 void print()
const { cout <<
Mv << endl; }
85 int main(
int iargc,
char* argv[])
92 "usage: handletest" "\n" 93 " or: handletest --help|-h" "\n" 116 cerr << usage_text << endl;
126 cerr << usage_text << endl;
127 cerr << help_text << endl;
132 CODE( cout << r1 << endl );
134 CODE( Tirhandle h1(r1) );
135 CODE( cout << *h1 << endl );
136 CODE( Tirhandle h2(h1) );
137 CODE( cout << *h2 << endl );
139 CODE( cout << *h2 << endl );
140 CODE( h2->shift(-12) );
141 CODE( cout << *h1 << endl );
142 CODE( Tirhandle::Tcoc ch1(h1) );
143 CODE( cout << *ch1 << endl );
144 CODE( h2->shift(10) );
145 CODE( cout << *ch1 << endl );
147 CODE( cout << *h1 <<
", " << h1 << endl );
148 CODE( cout << *ch1 <<
", " << ch1 << endl );
155 CODE( Tanyhandle ah1(s1) );
156 CODE( ah1->print() );
157 CODE( Tanyhandle ah2(
new String(
"ein string")) );
158 CODE( ah2->print() );
159 CODE( Tanyhandle ah3(ah2) );
160 CODE( ah3->print() );
161 CODE( Tanyhandle ah4(
new Int(4321)) );
162 CODE( ah4->print() );
164 CODE( ah3->print() );
Tvalue & last()
access end of range
template #tfxx::THandle<class TObj>#:
#define HANDLETEST_VERSION
#define CODE(line)
Show code along with output of executed code.
std::ostream & operator<<(std::ostream &os, const Tirange &r)
bool optset(const int &iopt) const
true if option # iopt was set on commandline
Tvalue & first()
access start of range
String(const std::string &v)
A class to deal with numerical ranges.
Namespace containing all components of module commandline. ,.
Evaluates commandline by calling long_getopt. ,You may instantiate a Commandline object by passing th...
virtual void print() const
#define ILLEGAL(line)
Show code that does not compile.
tfxx::Range< int > Tirange
struct to define options ,This struct is used to define a list of options. An example is: ...
int main(int iargc, char *argv[])