DataAccessor Class Reference

Provides reference counting for the DataAccessorImpl. More...

#include <DataAccessor.h>

List of all members.

Public Member Functions

 DataAccessor (DataAccessorDeleter *pDeleter, DataAccessorImpl *pImpl)
 DataAccessor (const DataAccessor &da)
 ~DataAccessor ()
DataAccessoroperator= (const DataAccessor &rhs)
DataAccessorImploperator-> ()
bool isValid () const


Detailed Description

Provides reference counting for the DataAccessorImpl.

A plug-in developer does not use this class directly. The DataAccessor exists for the sole purpose of managing the lifespan of the DataAccessorImpl. This class is used to create a wrapper around the DataAccessorImpl class to provide safe reference counting. When the DataAccessor loses scope the DataAccessorImpl class is deleted, causing its associated RasterPager to release its held RasterPage. If the RasterPager has already been deleted (e.g.: by deleting its RasterElement), the destruction of the DataAccessorImpl will cause undefined behavior. Therefore, the deletion of a RasterElement must occur after the deletion of its associated DataAccessors.

See also:
DataAccessorDeleter, DataAccessorImpl
Examples:

Tutorial/Tutorial3.cpp, Tutorial/Tutorial4.cpp, and Tutorial/Tutorial5.cpp.

Definition at line 50 of file DataAccessor.h.


Constructor & Destructor Documentation

DataAccessor::DataAccessor ( DataAccessorDeleter pDeleter,
DataAccessorImpl pImpl 
)

Creates a DataAccessor.

This class is not called directly by a plug-in developer. This creates an instance of a class that manages the lifespan of the DataAccessorImpl.

Parameters:
pDeleter A class that manages the deletion of the DataAccessorImpl.
pImpl The DataAccessorImpl class to manage.

DataAccessor::DataAccessor ( const DataAccessor da  ) 

Default copy constructor.

DataAccessor::~DataAccessor (  ) 

Destructor for the DataAccessor.


Member Function Documentation

DataAccessor& DataAccessor::operator= ( const DataAccessor rhs  ) 

The equals operator.

Parameters:
rhs The DataAccessor from which to set this accessor's values.

DataAccessorImpl* DataAccessor::operator-> (  ) 

Provides access to the real DataAccessorImpl.

The overloaded operator-> allows us to continue to use pointer notation to directly access the internally held pointer to the DataAccessorImpl. See also the Boost smart pointers. You will see the same thing.

Returns:
Returns a pointer to the DataAccessorImpl.

Definition at line 93 of file DataAccessor.h.

bool DataAccessor::isValid (  )  const

Determines if the DataAccessor references a valid DataAccessorImpl.

Returns:
Returns true if the DataAccessorImpl is valid.
Examples:
Tutorial/Tutorial3.cpp, Tutorial/Tutorial4.cpp, and Tutorial/Tutorial5.cpp.


Software Development Kit - Opticks 4.9.0 Build 16218