 |
Shiokaze Framework
A research-oriented fluid solver for computer graphics
|
|
Go to the documentation of this file.
25 #ifndef SHKZ_SHARED_ARRAY2_H
26 #define SHKZ_SHARED_ARRAY2_H
54 [](
const shape2 &shape, std::string core_name ) {
56 credit(
"Shared Array 2D",
"SharedArray"));
57 return (
void *)(
new array2<T>(shape,T(),core_name));
60 delete reinterpret_cast<array2<T> *
>(ptr);
62 assert( m_array->shape() == shape );
63 m_array->clear(initial_value);
74 m_array->set_type(type);
144 [](
const shape2 &shape, std::string core_name ) {
146 credit(
"Shared MAC Array 2D",
"SharedMACArray"));
152 assert( m_array->shape() == shape );
153 m_array->clear(initial_value);
164 m_array->set_type(type);
173 m_array->copy(array);
shared_macarray2(const macarray2< T > &array)
Borrow a shared array and copy the input.
Definition: shared_array2.h:172
array2< T > * operator->()
Get the pointer to the internal borrowed array.
Definition: shared_array2.h:107
const macarray2< T > * get() const
Get the const pointer to the internal borrowed array.
Definition: shared_array2.h:212
shared_array2(const shape2 &shape, T initial_value=T(), std::string core_name="")
Borrow a shared array.
Definition: shared_array2.h:52
macarray2< T > * get()
Get the pointer to the internal borrowed array.
Definition: shared_array2.h:207
shared_macarray2(const shape2 &shape, vec2< T > initial_value=vec2< T >(), std::string core_name="")
Borrow a shared MAC array.
Definition: shared_array2.h:142
array2< T > * get()
Get the pointer to the internal borrowed array.
Definition: shared_array2.h:117
const array2< T > & operator()() const
Get the const reference to the internal borrowed array.
Definition: shared_array2.h:97
Collection of properties of this grid.
Definition: macarray2.h:1037
shared_array2(const typename array2< T >::type2 &type, T initial_value=T())
Borrow a shared array.
Definition: shared_array2.h:73
Collection of properties of this grid.
Definition: array2.h:1797
shared_macarray2(const typename macarray2< T >::type2 &type, vec2< T > initial_value=vec2< T >())
Borrow a shared array.
Definition: shared_array2.h:163
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.
const array2< T > * get() const
Get the const pointer to the internal borrowed array.
Definition: shared_array2.h:122
array2< T > & operator()()
Get the reference to the internal borrowed array.
Definition: shared_array2.h:102
#define SHKZ_BEGIN_NAMESPACE
Name space beggining definition for shiokaze.
Definition: common.h:39
macarray2< T > * operator->()
Get the pointer to the internal borrowed array.
Definition: shared_array2.h:197
const array2< T > * operator->() const
Get the const pointer to the internal borrowed array.
Definition: shared_array2.h:112
~shared_array2()
Destructor for shared_array2.
Definition: shared_array2.h:89
~shared_macarray2()
Destructor for shared_macarray2.
Definition: shared_array2.h:179
static configuration & get_global_configuration()
Get the global settings of the program.
shared_array2(const array2< T > &array)
Borrow a shared array and copy the input.
Definition: shared_array2.h:82
const macarray2< T > & operator()() const
Get the const reference to the internal borrowed array.
Definition: shared_array2.h:187
const macarray2< T > * operator->() const
Get the const pointer to the internal borrowed array.
Definition: shared_array2.h:202
Class that automates the push and pop groups.
Definition: configuration.h:107
macarray2< T > & operator()()
Get the reference to the internal borrowed array.
Definition: shared_array2.h:192
Fixed sized vector structure.
Definition: vec.h:38
Storage class that enables sharing pre-allocated arrays.
Definition: shared_array2.h:40
Two dimensional array class designed to be defined as instance member in recursive_configurable class...
Definition: array2.h:42
Class that defines the name, argument name, author's name, email address, date and the version of the...
Definition: credit.h:47
static void return_shared(void *array)
Return a borrowed array.
Structure that defines shape such as width, height.
Definition: shape.h:42
#define SHKZ_END_NAMESPACE
Name space end definition for shiokaze.
Definition: common.h:44
Two dimensional staggered grid class designed to be defined as instance member in recursive_configura...
Definition: macarray2.h:37
Storage class that enables sharing pre-allocated arrays for MAC grid.
Definition: shared_array2.h:130