DataRequest Class Reference

DataRequest is a class used to specify how to get access to data through a DataAccessor. More...

#include <DataRequest.h>

List of all members.

Public Member Functions

virtual DataRequestcopy () const =0
virtual bool validate (const RasterDataDescriptor *pDescriptor) const =0
virtual bool polish (const RasterDataDescriptor *pDescriptor)=0
virtual int getRequestVersion (const RasterDataDescriptor *pDescriptor) const =0
virtual InterleaveFormatType getInterleaveFormat () const =0
virtual void setInterleaveFormat (InterleaveFormatType interleave)=0
virtual DimensionDescriptor getStartRow () const =0
virtual DimensionDescriptor getStopRow () const =0
virtual unsigned int getConcurrentRows () const =0
virtual void setRows (DimensionDescriptor startRow, DimensionDescriptor stopRow, unsigned int concurrentRows=0)=0
virtual DimensionDescriptor getStartColumn () const =0
virtual DimensionDescriptor getStopColumn () const =0
virtual unsigned int getConcurrentColumns () const =0
virtual void setColumns (DimensionDescriptor startColumn, DimensionDescriptor stopColumn, unsigned int concurrentColumns=0)=0
virtual DimensionDescriptor getStartBand () const =0
virtual DimensionDescriptor getStopBand () const =0
virtual unsigned int getConcurrentBands () const =0
virtual void setBands (DimensionDescriptor startBand, DimensionDescriptor stopBand, unsigned int concurrentBands=0)=0
virtual bool getWritable () const =0
virtual void setWritable (bool writable)=0

Protected Member Functions

virtual ~DataRequest ()


Detailed Description

DataRequest is a class used to specify how to get access to data through a DataAccessor.

To use, create an instance with the ObjectFactory or a FactoryResource. Set the fields for which the defaults are insufficient. Pass in the instance to RasterElement::getDataAccessor.

See also:
RasterElement, RasterDataDescriptor, DataAccessor
Examples:

SampleRasterElementImporter.cpp, and SampleRasterElementImporter.h.

Definition at line 28 of file DataRequest.h.


Constructor & Destructor Documentation

virtual DataRequest::~DataRequest (  )  [protected, virtual]

This should be destroyed by calling ObjectFactory::destroyObject.

Definition at line 293 of file DataRequest.h.


Member Function Documentation

virtual DataRequest* DataRequest::copy (  )  const [pure virtual]

Creates and returns a copy of the object.

Returns:
A new DataRequest, which is a copy of the existing one. The caller is responsible for ensuring deletion of the returned object.

virtual bool DataRequest::validate ( const RasterDataDescriptor pDescriptor  )  const [pure virtual]

Determine whether the DataRequest is valid for the given RasterDataDescriptor.

The validation will most likely fail if the DataRequest has not had polish() called on it.

Plug-ins generally do not need to call this function.

Parameters:
pDescriptor The descriptor to validate against.
Returns:
True if the DataRequest is a valid request for the descriptor, false otherwise.

virtual bool DataRequest::polish ( const RasterDataDescriptor pDescriptor  )  [pure virtual]

Polish the DataRequest for the given RasterDataDescriptor.

This function will apply any defaults to the actual value as appropriate for the given descriptor. This function should be called before validate().

The return values of accessor functions are not valid until this function has been called.

Plug-ins generally do not need to call this function, as the core will call it when appropriate.

Parameters:
pDescriptor The descriptor from which to apply defaults.
Returns:
True if the operation succeeded, false otherwise.

virtual int DataRequest::getRequestVersion ( const RasterDataDescriptor pDescriptor  )  const [pure virtual]

Get the version required to support this request.

Parameters:
pDescriptor The descriptor to use to determine required version.
Returns:
The smallest version number which can properly use this DataRequest. Currently always returns 1.
See also:
RasterPager::getSupportedRequestVersion()

virtual InterleaveFormatType DataRequest::getInterleaveFormat (  )  const [pure virtual]

Get the requested interleave.

This defaults to the interleave of the associated RasterElement.

Returns:
The requested interleave. If the interleave has not been set, either with polish() or setInterleaveFormat(), the return value is undefined.

virtual void DataRequest::setInterleaveFormat ( InterleaveFormatType  interleave  )  [pure virtual]

Set the requested interleave.

Parameters:
interleave The requested interleave.

virtual DimensionDescriptor DataRequest::getStartRow (  )  const [pure virtual]

Get the requested start row.

This defaults to the first row in the RasterElement.

Returns:
The requested start row.
See also:
setRows()

virtual DimensionDescriptor DataRequest::getStopRow (  )  const [pure virtual]

Get the requested stop row.

This defaults to the last row in the RasterElement.

Returns:
The requested stop row.
See also:
setRows()

virtual unsigned int DataRequest::getConcurrentRows (  )  const [pure virtual]

Get the request concurrent rows.

This defaults to 1.

Returns:
The requested number of concurrent rows.
See also:
setRows()

virtual void DataRequest::setRows ( DimensionDescriptor  startRow,
DimensionDescriptor  stopRow,
unsigned int  concurrentRows = 0 
) [pure virtual]

Set the start, stop, and concurrent rows.

Parameters:
startRow The requested start row. This may be an invalid DimensionDescriptor to apply the default.
stopRow The requested stop row. This may be an invalid DimensionDescriptor to apply the default.
concurrentRows The requested number of concurrent rows. This may be 0 to apply the default.
See also:
getStartRow(), getStopRow(), getConcurrentRows()

virtual DimensionDescriptor DataRequest::getStartColumn (  )  const [pure virtual]

Get the requested start column.

This defaults to the first column in the RasterElement.

Returns:
The requested start column.
See also:
setColumns()

virtual DimensionDescriptor DataRequest::getStopColumn (  )  const [pure virtual]

Get the requested stop column.

This defaults to the last column in the RasterElement.

Returns:
The requested stop column.
See also:
setColumn()

virtual unsigned int DataRequest::getConcurrentColumns (  )  const [pure virtual]

Get the request concurrent columns.

This defaults to the number of columns between start and stop.

Returns:
The requested number of concurrent column.
See also:
setColumn()

virtual void DataRequest::setColumns ( DimensionDescriptor  startColumn,
DimensionDescriptor  stopColumn,
unsigned int  concurrentColumns = 0 
) [pure virtual]

Set the start, stop, and concurrent column.

Parameters:
startColumn The requested start column. This may be an invalid DimensionDescriptor to apply the default.
stopColumn The requested stop column. This may be an invalid DimensionDescriptor to apply the default.
concurrentColumns The requested number of concurrent columns. This may be 0 to apply the default.
See also:
getStartColumn(), getStopColumn(), getConcurrentColumns()

virtual DimensionDescriptor DataRequest::getStartBand (  )  const [pure virtual]

Get the requested start band.

This defaults to the first band in the RasterElement.

Returns:
The requested start band.
See also:
setBands()

virtual DimensionDescriptor DataRequest::getStopBand (  )  const [pure virtual]

Get the requested stop band.

This defaults to the last band in the RasterElement for BIP and BIL data, or the requested start band for BSQ data.

Returns:
The requested stop band.
See also:
setBands()

virtual unsigned int DataRequest::getConcurrentBands (  )  const [pure virtual]

Get the request concurrent bands.

This defaults to the number of bands between the start and stop.

Returns:
The requested number of concurrent bands.
See also:
setBands()

virtual void DataRequest::setBands ( DimensionDescriptor  startBand,
DimensionDescriptor  stopBand,
unsigned int  concurrentBands = 0 
) [pure virtual]

Set the start, stop, and concurrent bands.

Parameters:
startBand The requested start band. This may be an invalid DimensionDescriptor to apply the default.
stopBand The requested stop band. This may be an invalid DimensionDescriptor to apply the default.
concurrentBands The requested number of concurrent bands. This may be 0 to apply the default.
Warning:
BSQ only supports accessing a single band at a time.
See also:
getStartBand(), getStopBand(), getConcurrentBands()

virtual bool DataRequest::getWritable (  )  const [pure virtual]

Get whether the request is for writable data.

This defaults to false.

Returns:
True if the request is for writable data, false otherwise.
See also:
setWritable()

virtual void DataRequest::setWritable ( bool  writable  )  [pure virtual]

Set whether the request is for writable data.

It is undefined what will happen if data is written from a DataAccessor requested with an unwritable DataRequest. Depending on the circumstances, it may apply the written data, ignore the written data, crash, or lead to other undesirable results. Always set the request to writable if you want to write to a RasterElement.

Parameters:
writable True if the request is for writable data, false otherwise.
See also:
getWritable(), RasterElement::updateData()


Software Development Kit - Opticks 4.9.0 Build 16218