Commit 51c865b4 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Virtualize grid hasArea query.

parent abbdb96e
......@@ -3023,14 +3023,16 @@ void gridInqArea(int gridID, double *area)
gridptr->vtable->inqArea(gridptr, area);
}
static int
gridHasAreaBase(grid_t *gridptr)
{
return gridptr->area != NULL;
}
int gridHasArea(int gridID)
{
grid_t *gridptr = gridID2Ptr(gridID);
int hasArea = (gridptr->vtable->inqAreaPtr(gridptr) != NULL);
return (hasArea);
return gridptr->vtable->hasArea(gridptr);
}
......@@ -4800,6 +4802,7 @@ const struct gridVirtTable cdiGridVtable
.inqYValsPtr = gridInqYValsPtrSerial,
.inqArea = gridInqAreaSerial,
.inqAreaPtr = gridInqAreaPtrBase,
.hasArea = gridHasAreaBase,
.inqMask = gridInqMaskSerial,
.inqMaskGME = gridInqMaskGMESerial,
.inqXBounds = gridInqXBoundsSerial,
......
......@@ -26,6 +26,7 @@ struct gridVirtTable
const double *(*inqYValsPtr)(grid_t *gridptr);
void (*inqArea)(grid_t *gridptr, double *area);
const double *(*inqAreaPtr)(grid_t *gridptr);
int (*hasArea)(grid_t *gridptr);
int (*inqMask)(grid_t *gridptr, int *mask);
int (*inqMaskGME)(grid_t *gridptr, int *mask_gme);
int (*inqXBounds)(grid_t *gridptr, double *xbounds);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment