GDAL

gdal_asyncreader.h
1/******************************************************************************
2 *
3 * Project: GDAL Core
4 * Purpose: Declaration of GDALAsyncReader base class.
5 * Author: Frank Warmerdam, warmerdam@pobox.com
6 *
7 ******************************************************************************
8 * Copyright (c) 2010, Frank Warmerdam
9 *
10 * SPDX-License-Identifier: MIT
11 ****************************************************************************/
12
13#ifndef GDALASYNCREADER_H_INCLUDED
14#define GDALASYNCREADER_H_INCLUDED
15
16#include "cpl_port.h"
17
18#include "gdal.h"
19
20 class GDALDataset;
21
22/* ******************************************************************** */
23/* GDALAsyncReader */
24/* ******************************************************************** */
25
31 class CPL_DLL GDALAsyncReader
32{
33
34 CPL_DISALLOW_COPY_ASSIGN(GDALAsyncReader)
35
36 protected:
38 GDALDataset *poDS;
39 int nXOff;
40 int nYOff;
41 int nXSize;
42 int nYSize;
43 void *pBuf;
44 int nBufXSize;
45 int nBufYSize;
46 GDALDataType eBufType;
47 int nBandCount;
48 int *panBandMap;
49 int nPixelSpace;
50 int nLineSpace;
51 int nBandSpace;
53
54 public:
55 GDALAsyncReader();
56 virtual ~GDALAsyncReader();
57
61 GDALDataset *GetGDALDataset()
62 {
63 return poDS;
64 }
65
69 int GetXOffset() const
70 {
71 return nXOff;
72 }
73
77 int GetYOffset() const
78 {
79 return nYOff;
80 }
81
85 int GetXSize() const
86 {
87 return nXSize;
88 }
89
93 int GetYSize() const
94 {
95 return nYSize;
96 }
97
101 void *GetBuffer()
102 {
103 return pBuf;
104 }
105
109 int GetBufferXSize() const
110 {
111 return nBufXSize;
112 }
113
117 int GetBufferYSize() const
118 {
119 return nBufYSize;
120 }
121
125 GDALDataType GetBufferType() const
126 {
127 return eBufType;
128 }
129
133 int GetBandCount() const
134 {
135 return nBandCount;
136 }
137
141 int *GetBandMap()
142 {
143 return panBandMap;
144 }
145
149 int GetPixelSpace() const
150 {
151 return nPixelSpace;
152 }
153
157 int GetLineSpace() const
158 {
159 return nLineSpace;
160 }
161
165 int GetBandSpace() const
166 {
167 return nBandSpace;
168 }
169
170 virtual GDALAsyncStatusType
171 GetNextUpdatedRegion(double dfTimeout, int *pnBufXOff, int *pnBufYOff,
172 int *pnBufXSize, int *pnBufYSize) = 0;
173 virtual int LockBuffer(double dfTimeout = -1.0);
174 virtual void UnlockBuffer();
175};
176
177#endif
GDALAsyncReader
Class used as a session object for asynchronous requests.
Definition gdal_asyncreader.h:32
GDALAsyncReader::GetXOffset
int GetXOffset() const
Return x offset.
Definition gdal_asyncreader.h:69
GDALAsyncReader::GetYOffset
int GetYOffset() const
Return y offset.
Definition gdal_asyncreader.h:77
GDALAsyncReader::GetYSize
int GetYSize() const
Return height.
Definition gdal_asyncreader.h:93
GDALAsyncReader::GetBandCount
int GetBandCount() const
Return band count.
Definition gdal_asyncreader.h:133
GDALAsyncReader::GetBufferType
GDALDataType GetBufferType() const
Return buffer data type.
Definition gdal_asyncreader.h:125
GDALAsyncReader::GetBandSpace
int GetBandSpace() const
Return band spacing.
Definition gdal_asyncreader.h:165
GDALAsyncReader::GetBufferYSize
int GetBufferYSize() const
Return buffer height.
Definition gdal_asyncreader.h:117
GDALAsyncReader::GetXSize
int GetXSize() const
Return width.
Definition gdal_asyncreader.h:85
GDALAsyncReader::GetNextUpdatedRegion
virtual GDALAsyncStatusType GetNextUpdatedRegion(double dfTimeout, int *pnBufXOff, int *pnBufYOff, int *pnBufXSize, int *pnBufYSize)=0
= 0;
GDALAsyncReader::GetBuffer
void * GetBuffer()
Return buffer.
Definition gdal_asyncreader.h:101
GDALAsyncReader::GetPixelSpace
int GetPixelSpace() const
Return pixel spacing.
Definition gdal_asyncreader.h:149
GDALAsyncReader::GetBandMap
int * GetBandMap()
Return band map.
Definition gdal_asyncreader.h:141
GDALAsyncReader::GetGDALDataset
GDALDataset * GetGDALDataset()
Return dataset.
Definition gdal_asyncreader.h:61
GDALAsyncReader::GetLineSpace
int GetLineSpace() const
Return line spacing.
Definition gdal_asyncreader.h:157
GDALAsyncReader::GetBufferXSize
int GetBufferXSize() const
Return buffer width.
Definition gdal_asyncreader.h:109
GDALDataset
A set of associated raster bands, usually from one file.
Definition gdal_dataset.h:76
cpl_port.h
Core portability definitions for CPL.
CPL_DISALLOW_COPY_ASSIGN
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition cpl_port.h:936
gdal.h
Public (C callable) GDAL entry points.
GDALDataType
GDALDataType
Definition gdal.h:48
GDALAsyncStatusType
GDALAsyncStatusType
status of the asynchronous stream
Definition gdal.h:104