Shiokaze Framework
A research-oriented fluid solver for computer graphics
shared_array_core2 Class Reference

Abstract storage class that enables sharing pre-allocated arrays. More...

#include <shared_array_core2.h>

Static Public Member Functions

static void * borrow_shared (const shape2 &shape, size_t class_hash, std::string core_name, std::function< void *(const shape2 &shape, std::string core_name)> alloc_func, std::function< void(void *ptr)> dealloc_func)
 Borrow a shared array. More...
 
static void return_shared (void *array)
 Return a borrowed array. More...
 
static size_t clear ()
 Clear grid storage.
 
static size_t get_total_grid_count ()
 Get the number of current shared arrays.
 

Detailed Description

Abstract storage class that enables sharing pre-allocated arrays.

Member Function Documentation

◆ borrow_shared()

static void* shared_array_core2::borrow_shared ( const shape2 shape,
size_t  class_hash,
std::string  core_name,
std::function< void *(const shape2 &shape, std::string core_name)>  alloc_func,
std::function< void(void *ptr)>  dealloc_func 
)
static

Borrow a shared array.

Parameters
[in]shapeShape of the grid.
[in]class_hashHash indicator for the type of grid.
[in]core_nameCore module name for the grid.
[in]alloc_funcGrid allocation func.
[in]dealloc_funcGrid deallocation func.
Returns
Pointer to a shared grid.

◆ return_shared()

static void shared_array_core2::return_shared ( void *  array)
static

Return a borrowed array.

Parameters
[in]arrayPointer to a borrowed array.

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