COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
|
A Buffer that is constructed passing a boost::multi_array<T,2> table. This class allows to interface this table by using a buffer. More...
#include <ArrayBufferT.hpp>
Classes | |
struct | Buffer |
Public Types | |
typedef boost::multi_array< T, 2 > | Array_t |
typedef T | value_type |
typedef boost::detail::multi_array::sub_array< T, 1 > | SubArray_t |
typedef boost::detail::multi_array::const_sub_array< T, 1 > | ConstSubArray_t |
Public Member Functions | |
ArrayBufferT (Array_t &array, size_t nbRows) | |
virtual | ~ArrayBufferT () |
Virtual destructor. More... | |
void | change_buffersize (const size_t nbRows) |
Change the buffer to the new size. More... | |
void | flush () |
template<typename vectorType > | |
Uint | add_row (const vectorType &row) |
Uint | add_empty_row () |
template<typename vectorType > | |
Uint | add_row_directly (const vectorType &row) |
template<typename vectorType > | |
void | set_row (const Uint array_idx, const vectorType &row) |
SubArray_t | get_row (const Uint idx) |
void | rm_row (const Uint array_idx) |
Array_t & | get_appointed () |
Uint | total_allocated () |
Uint | buffers_count () const |
void | increase_array_size (const size_t increase) |
increase the size of the array, only to be used when going to write directly in array More... | |
Static Public Member Functions | |
static std::string | type_name () |
Get the class name. More... | |
Private Member Functions | |
void | add_buffer () |
Create a new buffer, allocate it with m_buffersize, and fill m_new_buffer_rows with the new ones. More... | |
bool | is_array_row_empty (const Uint row) const |
void | reset () |
std::string | string () |
Private Attributes | |
Array_t & | m_array |
reference to the array that is buffered More... | |
Uint | m_nb_cols |
the number of columns of the array More... | |
Uint | m_buffersize |
std::vector< Buffer > | m_buffers |
vector of temporary buffers More... | |
std::deque< Uint > | m_empty_array_rows |
storage of removed array rows More... | |
std::deque< Uint > | m_new_array_rows |
storage of array rows where rows can be added directly using add_row_directly More... | |
std::deque< Uint > | m_empty_buffer_rows |
storage of removed buffer rows More... | |
std::deque< Uint > | m_new_buffer_rows |
storage of buffer rows where rows can be added More... | |
A Buffer that is constructed passing a boost::multi_array<T,2> table. This class allows to interface this table by using a buffer.
The idea is to add and remove rows from the table through this buffer. The table is resized when the buffer is full, and values are copied from the buffer into the table.
First entry that is removed from the array using rm_row(), will also be the first to be filled when non-empty buffers are flushed. So in order of removal.
Definition at line 44 of file ArrayBufferT.hpp.
typedef boost::multi_array<T,2> Array_t |
Definition at line 49 of file ArrayBufferT.hpp.
typedef boost::detail::multi_array::const_sub_array<T,1> ConstSubArray_t |
Definition at line 53 of file ArrayBufferT.hpp.
typedef boost::detail::multi_array::sub_array<T,1> SubArray_t |
Definition at line 52 of file ArrayBufferT.hpp.
typedef T value_type |
Definition at line 50 of file ArrayBufferT.hpp.
ArrayBufferT | ( | Array_t & | array, |
size_t | nbRows | ||
) |
Contructor
array | The table that will be interfaced with |
nbRows | The size the buffer will be allocated with |
Definition at line 208 of file ArrayBufferT.hpp.
|
virtual |
Virtual destructor.
Definition at line 218 of file ArrayBufferT.hpp.
|
inlineprivate |
Create a new buffer, allocate it with m_buffersize, and fill m_new_buffer_rows with the new ones.
Definition at line 373 of file ArrayBufferT.hpp.
|
inline |
Definition at line 399 of file ArrayBufferT.hpp.
|
inline |
Add a row to the buffer. rows are only added to the buffer, even if there are empty rows in the array! Only when flush() is called, will the empty rows be filled.
[in] | row | Row to be added to buffer |
Definition at line 386 of file ArrayBufferT.hpp.
|
inline |
Add a row directly to the array
[in] | row | Row to be added to buffer or array |
Definition at line 414 of file ArrayBufferT.hpp.
|
inline |
Definition at line 143 of file ArrayBufferT.hpp.
|
inline |
Change the buffer to the new size.
Definition at line 486 of file ArrayBufferT.hpp.
void flush | ( | ) |
Flush the buffer in the connectivity Buffer 2 cases:
Definition at line 238 of file ArrayBufferT.hpp.
|
inline |
Definition at line 137 of file ArrayBufferT.hpp.
|
inline |
Definition at line 336 of file ArrayBufferT.hpp.
|
inline |
increase the size of the array, only to be used when going to write directly in array
Definition at line 359 of file ArrayBufferT.hpp.
|
inlineprivate |
Definition at line 153 of file ArrayBufferT.hpp.
|
inlineprivate |
Definition at line 158 of file ArrayBufferT.hpp.
|
inline |
Mark row as empty in array or buffer
[in] | array_idx | the index of the row to be removed |
Definition at line 458 of file ArrayBufferT.hpp.
|
inline |
copy a given row into the array or buffer, depending on the given index
[in] | array_idx | the index of the row that will be set (both in array and buffers) |
[in] | row | the row that will be copied into the buffer or array |
Definition at line 427 of file ArrayBufferT.hpp.
|
inlineprivate |
Definition at line 494 of file ArrayBufferT.hpp.
|
inline |
Definition at line 227 of file ArrayBufferT.hpp.
|
inlinestatic |
Get the class name.
Definition at line 87 of file ArrayBufferT.hpp.
|
private |
reference to the array that is buffered
Definition at line 179 of file ArrayBufferT.hpp.
|
private |
vector of temporary buffers
Definition at line 189 of file ArrayBufferT.hpp.
|
private |
The size newly created buffers will have
Definition at line 186 of file ArrayBufferT.hpp.
|
private |
storage of removed array rows
Definition at line 192 of file ArrayBufferT.hpp.
|
private |
storage of removed buffer rows
Definition at line 198 of file ArrayBufferT.hpp.
|
private |
the number of columns of the array
Definition at line 182 of file ArrayBufferT.hpp.
|
private |
storage of array rows where rows can be added directly using add_row_directly
Definition at line 195 of file ArrayBufferT.hpp.
|
private |
storage of buffer rows where rows can be added
Definition at line 201 of file ArrayBufferT.hpp.
Send comments to: COOLFluiD Web Admin |