#include <DataAccessor.h>
Public Member Functions | |
| DataAccessor (DataAccessorDeleter *pDeleter, DataAccessorImpl *pImpl) | |
| DataAccessor (const DataAccessor &da) | |
| ~DataAccessor () | |
| DataAccessor & | operator= (const DataAccessor &rhs) |
| DataAccessorImpl * | operator-> () |
| bool | isValid () const |
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.
Tutorial/Tutorial3.cpp, Tutorial/Tutorial4.cpp, and Tutorial/Tutorial5.cpp.
Definition at line 50 of file DataAccessor.h.
| 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.
| 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.
| DataAccessor& DataAccessor::operator= | ( | const DataAccessor & | rhs | ) |
| 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.
Definition at line 93 of file DataAccessor.h.
| bool DataAccessor::isValid | ( | ) | const |
Determines if the DataAccessor references a valid DataAccessorImpl.