GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <grass/raster3d.h>
#include "raster3d_intern.h"
#include "cachehash.h"
Go to the source code of this file.
Macros | |
#define | IS_ACTIVE_ELT(elt) (c->locks[elt] != 2) |
#define | IS_NOT_ACTIVE_ELT(elt) (c->locks[elt] == 2) |
#define | IS_LOCKED_ELT(elt) (c->locks[elt] == 1) |
#define | IS_UNLOCKED_ELT(elt) (c->locks[elt] == 0) |
#define | IS_NOT_IN_QUEUE_ELT(elt) (IS_LOCKED_ELT (elt)) |
#define | IS_IN_QUEUE_ELT(elt) (! IS_NOT_IN_QUEUE_ELT (elt)) |
#define | DEACTIVATE_ELT(elt) |
#define | LOCK_ELT(elt) |
#define | UNLOCK_ELT(elt) |
#define | ONE_UNLOCKED_ELT_ONLY (c->first == c->last) |
#define | ARE_MIN_UNLOCKED (c->nofUnlocked <= c->minUnlocked) |
#define ARE_MIN_UNLOCKED (c->nofUnlocked <= c->minUnlocked) |
Definition at line 30 of file cache1.c.
Referenced by Rast3d_cache_elt_ptr(), and Rast3d_cache_lock().
#define DEACTIVATE_ELT | ( | elt | ) |
#define IS_ACTIVE_ELT | ( | elt | ) | (c->locks[elt] != 2) |
Definition at line 12 of file cache1.c.
Referenced by Rast3d_cache_elt_ptr(), Rast3d_cache_flush_all(), and Rast3d_cache_remove_all().
#define IS_IN_QUEUE_ELT | ( | elt | ) | (! IS_NOT_IN_QUEUE_ELT (elt)) |
#define IS_LOCKED_ELT | ( | elt | ) | (c->locks[elt] == 1) |
Definition at line 14 of file cache1.c.
Referenced by Rast3d_cache_lock(), Rast3d_cache_lock_intern(), and Rast3d_cache_unlock_all().
#define IS_NOT_IN_QUEUE_ELT | ( | elt | ) | (IS_LOCKED_ELT (elt)) |
#define IS_UNLOCKED_ELT | ( | elt | ) | (c->locks[elt] == 0) |
Definition at line 15 of file cache1.c.
Referenced by Rast3d_cache_elt_ptr(), Rast3d_cache_lock_all(), and Rast3d_cache_unlock().
#define LOCK_ELT | ( | elt | ) |
#define ONE_UNLOCKED_ELT_ONLY (c->first == c->last) |
Definition at line 29 of file cache1.c.
Referenced by Rast3d_cache_elt_ptr(), and Rast3d_cache_lock().
#define UNLOCK_ELT | ( | elt | ) |
Definition at line 25 of file cache1.c.
Referenced by Rast3d_cache_elt_ptr().
void Rast3d_cache_autolock_off | ( | RASTER3D_cache * | c | ) |
Definition at line 359 of file cache1.c.
References RASTER3D_cache::autoLock.
Referenced by Rast3d_autolock_off().
void Rast3d_cache_autolock_on | ( | RASTER3D_cache * | c | ) |
Definition at line 352 of file cache1.c.
References RASTER3D_cache::autoLock.
Referenced by Rast3d_autolock_on().
void Rast3d_cache_dispose | ( | RASTER3D_cache * | c | ) |
void* Rast3d_cache_elt_ptr | ( | RASTER3D_cache * | c, |
int | name | ||
) |
Definition at line 465 of file cache1.c.
References ARE_MIN_UNLOCKED, RASTER3D_cache::autoLock, RASTER3D_cache::eltLoadFun, RASTER3D_cache::eltLoadFunData, RASTER3D_cache::eltRemoveFun, RASTER3D_cache::eltRemoveFunData, RASTER3D_cache::elts, RASTER3D_cache::eltSize, RASTER3D_cache::first, RASTER3D_cache::hash, IS_ACTIVE_ELT, IS_UNLOCKED_ELT, name, RASTER3D_cache::names, NULL, ONE_UNLOCKED_ELT_ONLY, Rast3d_cache_hash_load_name(), Rast3d_cache_hash_name2index(), Rast3d_cache_hash_remove_name(), Rast3d_cache_lock_intern(), Rast3d_cache_unlock(), Rast3d_error(), and UNLOCK_ELT.
Referenced by Rast3d_cache_get_elt(), Rast3d_cache_load(), and Rast3d_get_tile_ptr().
int Rast3d_cache_flush | ( | RASTER3D_cache * | c, |
int | name | ||
) |
Definition at line 420 of file cache1.c.
Referenced by Rast3d_cache_flush_all().
int Rast3d_cache_flush_all | ( | RASTER3D_cache * | c | ) |
Definition at line 449 of file cache1.c.
References IS_ACTIVE_ELT, RASTER3D_cache::names, RASTER3D_cache::nofElts, Rast3d_cache_flush(), and Rast3d_error().
int Rast3d_cache_get_elt | ( | RASTER3D_cache * | c, |
int | name, | ||
void * | dst | ||
) |
Definition at line 527 of file cache1.c.
References RASTER3D_cache::eltSize, NULL, Rast3d_cache_elt_ptr(), and Rast3d_error().
int Rast3d_cache_load | ( | RASTER3D_cache * | c, |
int | name | ||
) |
Definition at line 515 of file cache1.c.
References NULL, Rast3d_cache_elt_ptr(), and Rast3d_error().
int Rast3d_cache_lock | ( | RASTER3D_cache * | c, |
int | name | ||
) |
Definition at line 266 of file cache1.c.
References ARE_MIN_UNLOCKED, RASTER3D_cache::hash, IS_LOCKED_ELT, ONE_UNLOCKED_ELT_ONLY, Rast3d_cache_hash_name2index(), and Rast3d_error().
Referenced by Rast3d_lock_tile().
int Rast3d_cache_lock_all | ( | RASTER3D_cache * | c | ) |
Definition at line 339 of file cache1.c.
References IS_UNLOCKED_ELT, RASTER3D_cache::nofElts, and Rast3d_cache_lock_intern().
void Rast3d_cache_lock_intern | ( | RASTER3D_cache * | c, |
int | index | ||
) |
Definition at line 291 of file cache1.c.
References IS_LOCKED_ELT.
Referenced by Rast3d_cache_elt_ptr(), and Rast3d_cache_lock_all().
void* Rast3d_cache_new | ( | int | nofElts, |
int | sizeOfElts, | ||
int | nofNames, | ||
int(*)() | eltRemoveFun, | ||
void * | eltRemoveFunData, | ||
int(*)() | eltLoadFun, | ||
void * | eltLoadFunData | ||
) |
Definition at line 88 of file cache1.c.
Referenced by Rast3d_cache_new_read().
void* Rast3d_cache_new_read | ( | int | nofElts, |
int | sizeOfElts, | ||
int | nofNames, | ||
read_fn * | eltLoadFun, | ||
void * | eltLoadFunData | ||
) |
Definition at line 161 of file cache1.c.
References Rast3d_cache_new().
int Rast3d_cache_put_elt | ( | RASTER3D_cache * | c, |
int | name, | ||
const void * | src | ||
) |
int Rast3d_cache_remove_all | ( | RASTER3D_cache * | c | ) |
Definition at line 432 of file cache1.c.
References IS_ACTIVE_ELT, RASTER3D_cache::names, RASTER3D_cache::nofElts, Rast3d_cache_remove_elt(), and Rast3d_error().
Referenced by Rast3d_flush_all_tiles().
int Rast3d_cache_remove_elt | ( | RASTER3D_cache * | c, |
int | name | ||
) |
Definition at line 408 of file cache1.c.
Referenced by Rast3d__remove_tile(), and Rast3d_cache_remove_all().
void Rast3d_cache_reset | ( | RASTER3D_cache * | c | ) |
void Rast3d_cache_set_load_fun | ( | RASTER3D_cache * | c, |
int(*)() | eltLoadFun, | ||
void * | eltLoadFunData | ||
) |
Definition at line 152 of file cache1.c.
References RASTER3D_cache::eltLoadFun, and RASTER3D_cache::eltLoadFunData.
void Rast3d_cache_set_min_unlock | ( | RASTER3D_cache * | c, |
int | nofMinUnLocked | ||
) |
Definition at line 366 of file cache1.c.
References RASTER3D_cache::minUnlocked.
Referenced by Rast3d_min_unlocked().
void Rast3d_cache_set_remove_fun | ( | RASTER3D_cache * | c, |
int(*)() | eltRemoveFun, | ||
void * | eltRemoveFunData | ||
) |
int Rast3d_cache_unlock | ( | RASTER3D_cache * | c, |
int | name | ||
) |
Definition at line 302 of file cache1.c.
References RASTER3D_cache::hash, IS_UNLOCKED_ELT, Rast3d_cache_hash_name2index(), and Rast3d_error().
Referenced by Rast3d_cache_elt_ptr(), Rast3d_cache_unlock_all(), and Rast3d_unlock_tile().
int Rast3d_cache_unlock_all | ( | RASTER3D_cache * | c | ) |
Definition at line 323 of file cache1.c.
References IS_LOCKED_ELT, RASTER3D_cache::names, RASTER3D_cache::nofElts, Rast3d_cache_unlock(), and Rast3d_error().
Referenced by Rast3d_unlock_all().