libpgplotxx.a (C++ interface to PGPLOT)

◆ testhandle()

void testhandle ( )

Test handles.

Definition at line 118 of file pgtestxx.cc.

References section(), subsection(), and testhandlefunction().

Referenced by main().

119 {
120  section("test handles");
121  subsection("create objects");
122  CODE( Handletestbaseclass B1(1) );
123  CODE( Handletestclass C1(2,3) );
124  subsection("create handle from object");
125  CODE( pgplot::Handle<Handletestclass> H1(C1) );
126  CODE( H1->value()=8 );
127  CODE( H1->print(cout) );
128  subsection("create handle to base from handle");
130  CODE( H1->basevalue()=9 );
131  CODE( H1->print(cout) );
132  CODE( H2->print(cout) );
133  CODE( H1->value()=-20 );
134  CODE( H2->basevalue()=-5 );
135  CODE( H2->print(cout) );
136  ILLEGAL( H2->value()=18 );
137  subsection("create handles directly");
140  subsection("create handle to constant base");
142  CODE( H5->print(cout) );
143  ILLEGAL( H5->basevalue()=-8 );
144  cout << endl;
145  CODE( testhandlefunction(H3) );
146  subsection("assignement using inheritance transparency");
147  CODE( H4->print(cout) );
148  CODE( H4=H3 );
149  CODE( H4->print(cout) );
150  CODE( H4->basevalue()=100 );
151  CODE( H3->print(cout) );
153  CODE( H6->print(cout) );
154  CODE( H6=H3 );
155  CODE( H6->print(cout) );
156  ILLEGAL( H6->basevalue()=64 );
157  subsection("finished");
158 }
void subsection(const std::string &s)
Definition: pgtestxx.cc:64
void testhandlefunction(const pgplot::Handle< Handletestbaseclass >::Tcoc &h)
Test function for inheritance transparency.
Definition: pgtestxx.cc:110
Test class for handles.
Definition: pgtestxx.cc:92
The handle class.
Definition: pghandle.h:219
Base class for handles.
Definition: pghandle.h:85
void section(const std::string &s)
Definition: pgtestxx.cc:63
Base class for testing handles.
Definition: pgtestxx.cc:78
Here is the call graph for this function:
Here is the caller graph for this function: