GDAL
Public Member Functions | List of all members
GDALAsyncReader Class Referenceabstract

Class used as a session object for asynchronous requests. More...

#include <gdal_priv.h>

Inherited by GDALDefaultAsyncReader.

Public Member Functions

GDALDatasetGetGDALDataset ()
 Return dataset. More...
 
int GetXOffset () const
 Return x offset. More...
 
int GetYOffset () const
 Return y offset. More...
 
int GetXSize () const
 Return width. More...
 
int GetYSize () const
 Return height. More...
 
void * GetBuffer ()
 Return buffer. More...
 
int GetBufferXSize () const
 Return buffer width. More...
 
int GetBufferYSize () const
 Return buffer height. More...
 
GDALDataType GetBufferType () const
 Return buffer data type. More...
 
int GetBandCount () const
 Return band count. More...
 
int * GetBandMap ()
 Return band map. More...
 
int GetPixelSpace () const
 Return pixel spacing. More...
 
int GetLineSpace () const
 Return line spacing. More...
 
int GetBandSpace () const
 Return band spacing. More...
 
virtual GDALAsyncStatusType GetNextUpdatedRegion (double dfTimeout, int *pnBufXOff, int *pnBufYOff, int *pnBufXSize, int *pnBufYSize)=0
 Get async IO update. More...
 
virtual int LockBuffer (double dfTimeout=-1.0)
 Lock image buffer. More...
 
virtual void UnlockBuffer ()
 Unlock image buffer. More...
 

Detailed Description

Class used as a session object for asynchronous requests.

They are created with GDALDataset::BeginAsyncReader(), and destroyed with GDALDataset::EndAsyncReader().

Member Function Documentation

◆ GetBandCount()

int GDALAsyncReader::GetBandCount ( ) const
inline

Return band count.

Returns
band count

◆ GetBandMap()

int* GDALAsyncReader::GetBandMap ( )
inline

Return band map.

Returns
band map.

◆ GetBandSpace()

int GDALAsyncReader::GetBandSpace ( ) const
inline

Return band spacing.

Returns
band spacing.

◆ GetBuffer()

void* GDALAsyncReader::GetBuffer ( )
inline

Return buffer.

Returns
buffer

◆ GetBufferType()

GDALDataType GDALAsyncReader::GetBufferType ( ) const
inline

Return buffer data type.

Returns
buffer data type.

◆ GetBufferXSize()

int GDALAsyncReader::GetBufferXSize ( ) const
inline

Return buffer width.

Returns
buffer width.

◆ GetBufferYSize()

int GDALAsyncReader::GetBufferYSize ( ) const
inline

Return buffer height.

Returns
buffer height.

◆ GetGDALDataset()

GDALDataset* GDALAsyncReader::GetGDALDataset ( )
inline

Return dataset.

Returns
dataset

◆ GetLineSpace()

int GDALAsyncReader::GetLineSpace ( ) const
inline

Return line spacing.

Returns
line spacing.

◆ GetNextUpdatedRegion()

GDALAsyncStatusType GDALAsyncReader::GetNextUpdatedRegion ( double  dfTimeout,
int *  pnBufXOff,
int *  pnBufYOff,
int *  pnBufXSize,
int *  pnBufYSize 
)
pure virtual

Get async IO update.

Provide an opportunity for an asynchronous IO request to update the image buffer and return an indication of the area of the buffer that has been updated.

The dfTimeout parameter can be used to wait for additional data to become available. The timeout does not limit the amount of time this method may spend actually processing available data.

The following return status are possible.

  • GARIO_PENDING: No imagery was altered in the buffer, but there is still activity pending, and the application should continue to call GetNextUpdatedRegion() as time permits.
  • GARIO_UPDATE: Some of the imagery has been updated, but there is still activity pending.
  • GARIO_ERROR: Something has gone wrong. The asynchronous request should be ended.
  • GARIO_COMPLETE: An update has occurred and there is no more pending work on this request. The request should be ended and the buffer used.
Parameters
dfTimeoutthe number of seconds to wait for additional updates. Use -1 to wait indefinitely, or zero to not wait at all if there is no data available.
pnBufXOfflocation to return the X offset of the area of the request buffer that has been updated.
pnBufYOfflocation to return the Y offset of the area of the request buffer that has been updated.
pnBufXSizelocation to return the X size of the area of the request buffer that has been updated.
pnBufYSizelocation to return the Y size of the area of the request buffer that has been updated.
Returns
GARIO_ status, details described above.

◆ GetPixelSpace()

int GDALAsyncReader::GetPixelSpace ( ) const
inline

Return pixel spacing.

Returns
pixel spacing.

◆ GetXOffset()

int GDALAsyncReader::GetXOffset ( ) const
inline

Return x offset.

Returns
x offset.

◆ GetXSize()

int GDALAsyncReader::GetXSize ( ) const
inline

Return width.

Returns
width

◆ GetYOffset()

int GDALAsyncReader::GetYOffset ( ) const
inline

Return y offset.

Returns
y offset.

◆ GetYSize()

int GDALAsyncReader::GetYSize ( ) const
inline

Return height.

Returns
height

◆ LockBuffer()

int GDALAsyncReader::LockBuffer ( double  dfTimeout = -1.0)
virtual

Lock image buffer.

Locks the image buffer passed into GDALDataset::BeginAsyncReader(). This is useful to ensure the image buffer is not being modified while it is being used by the application. UnlockBuffer() should be used to release this lock when it is no longer needed.

Parameters
dfTimeoutthe time in seconds to wait attempting to lock the buffer. -1.0 to wait indefinitely and 0 to not wait at all if it can't be acquired immediately. Default is -1.0 (infinite wait).
Returns
TRUE if successful, or FALSE on an error.

◆ UnlockBuffer()

void GDALAsyncReader::UnlockBuffer ( )
virtual

Unlock image buffer.

Releases a lock on the image buffer previously taken with LockBuffer().


The documentation for this class was generated from the following files:

Generated for GDAL by doxygen 1.8.13.