15#ifndef GDALRASTERBLOCK_H_INCLUDED
16#define GDALRASTERBLOCK_H_INCLUDED
19#include "cpl_atomic_ops.h"
34 friend class GDALAbstractBandBlockCache;
39 volatile int nLockCount = 0;
47 void *pData =
nullptr;
54 bool bMustDetach =
false;
56 CPL_INTERNAL
void Detach_unlocked(
void);
57 CPL_INTERNAL
void Touch_unlocked(
void);
59 CPL_INTERNAL
void RecycleFor(
int nXOffIn,
int nYOffIn);
74 return CPLAtomicInc(&nLockCount);
80 return CPLAtomicDec(&nLockCount);
148 return static_cast<GPtrDiff_t>(nXSize) * nYSize *
153 int DropLockForRemovalFromStorage();
162 static void FlushDirtyBlocks();
163 static int FlushCacheBlock(
int bDirtyBlocksOnly = FALSE);
164 static void Verify();
166 static void EnterDisableDirtyBlockFlush();
167 static void LeaveDisableDirtyBlockFlush();
172 static void DumpAll();
177 CPL_INTERNAL
static void DestroyRBMutex();
A single raster band (or channel).
Definition gdal_rasterband.h:105
A single raster block in the block cache.
Definition gdal_rasterblock.h:33
int GetDirty() const
Return the dirty flag.
Definition gdal_rasterblock.h:130
GDALRasterBand * GetBand()
Accessor to source GDALRasterBand object.
Definition gdal_rasterblock.h:157
void MarkDirty(void)
Mark the block as modified.
Definition gdalrasterblock.cpp:1087
int GetXSize() const
Return the width of the block.
Definition gdal_rasterblock.h:114
GPtrDiff_t GetBlockSize() const
Return the block size in bytes.
Definition gdal_rasterblock.h:146
int GetYSize() const
Return the height of the block.
Definition gdal_rasterblock.h:122
GDALDataType GetDataType() const
Return the data type.
Definition gdal_rasterblock.h:90
int GetXOff() const
Return the x offset of the top-left corner of the block.
Definition gdal_rasterblock.h:98
CPLErr Internalize(void)
Allocate memory for block.
Definition gdalrasterblock.cpp:871
void Touch(void)
Push block to top of LRU (least-recently used) list.
Definition gdalrasterblock.cpp:800
int AddLock(void)
Increment the lock count.
Definition gdal_rasterblock.h:72
void * GetDataRef(void)
Return the data buffer.
Definition gdal_rasterblock.h:138
int GetYOff() const
Return the y offset of the top-left corner of the block.
Definition gdal_rasterblock.h:106
GDALRasterBlock(GDALRasterBand *, int, int)
GDALRasterBlock Constructor.
Definition gdalrasterblock.cpp:527
void MarkClean(void)
Mark the block as unmodified.
Definition gdalrasterblock.cpp:1109
int DropLock(void)
Decrement the lock count.
Definition gdal_rasterblock.h:78
CPLErr
Error category.
Definition cpl_error.h:37
Core portability definitions for CPL.
int GPtrDiff_t
Integer type large enough to hold the difference between 2 addresses.
Definition cpl_port.h:246
#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
Public (C callable) GDAL entry points.
GDALDataType
Definition gdal.h:48
@ GDT_Unknown
Definition gdal.h:49
int GDALGetDataTypeSizeBytes(GDALDataType)
Get data type size in bytes.
Definition gdal_misc.cpp:374