casa::VisBufferAutoPtr Class Reference
A convenience class to assist in migrating code to potentially use asynchronous I/O.
More...
#include <VisBuffer.h>
List of all members.
Detailed Description
A convenience class to assist in migrating code to potentially use asynchronous I/O.
Prerequisite
Synopsis
When existing code is modified to potentially use asynchronous I/O the current VisBuffer usage is probably using automatic (stack) storage which will have to be replaced to allow VisBufferAsync objects (which derive from VisBuffer) to be used with asynchronous I/O. The goal of this class is to make that transition easier. The user will replace their existing declaration of a VisBuffer object with a declaration of a VisBufferAutoPtr object. Depending on the attributes of the VisBuffer reference/pointer or the ROVisibilityIterator provided in the VisBufferAutoPtr constructor, the appropriate type of VisBuffer will be created dynamically. The VisBufferAutoPtr will also function somewhat like an auto_ptr and delete the underlying object when the VisBufferAutoPtr object is destroyed.
Once the straight VisBuffer declaration is replaced, then the code in its scope will need to be modified to dereference the VisBufferAutoPtr or to delete use of the address-of operator, "&", applied to the previous VisBuffer variable. See the example below.
Example
Before adding asynchronous I/O support
VisBuffer vb (vi);
doSomething (vb); // void doSomething (VisBuffer &); doSomethingElse (& vb); // void doSomethingElse (VisBuffer *);
After adding asynchronous I/O support
VisBufferAutoPtr vb (vi);
doSomething (* vb); doSomethingElse (vb.get());
Definition at line 1196 of file VisBuffer.h.
Constructor & Destructor Documentation
casa::VisBufferAutoPtr::VisBufferAutoPtr |
( |
|
) |
|
casa::VisBufferAutoPtr::VisBufferAutoPtr |
( |
VisBuffer & |
|
) |
[explicit] |
casa::VisBufferAutoPtr::VisBufferAutoPtr |
( |
VisBuffer * |
|
) |
[explicit] |
casa::VisBufferAutoPtr::~VisBufferAutoPtr |
( |
|
) |
|
Member Function Documentation
void casa::VisBufferAutoPtr::constructVb |
( |
VisBuffer * |
rovi |
) |
[protected] |
VisBuffer* casa::VisBufferAutoPtr::get |
( |
|
) |
const |
VisBuffer& casa::VisBufferAutoPtr::operator* |
( |
|
) |
const |
VisBuffer* casa::VisBufferAutoPtr::operator-> |
( |
|
) |
const |
VisBuffer* casa::VisBufferAutoPtr::release |
( |
|
) |
|
void casa::VisBufferAutoPtr::set |
( |
VisBuffer * |
|
) |
|
void casa::VisBufferAutoPtr::set |
( |
VisBuffer & |
|
) |
|
Member Data Documentation
The documentation for this class was generated from the following file: