GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include "BlockArray.h"
Public Member Functions | |
BlockArray () | |
Creates a history file for holding maximal size blocks. | |
~BlockArray () | |
destructor | |
size_t | append (Block *block) |
adds the Block at the end of history. | |
const Block * | at (size_t index) |
gets the block at the index. | |
size_t | getCurrent () const |
bool | has (size_t index) const |
Block * | lastBlock () const |
size_t | len () const |
size_t | newBlock () |
bool | setHistorySize (size_t newsize) |
reorders blocks as needed. | |
bool | setSize (size_t newsize) |
Convenient function to set the size in KBytes instead of blocks. |
Private Member Functions | |
void | decreaseBuffer (size_t newsize) |
void | increaseBuffer () |
void | unmap () |
Private Attributes | |
size_t | current |
size_t | index |
int | ion |
Block * | lastblock |
Block * | lastmap |
size_t | lastmap_index |
size_t | length |
size_t | size |
Definition at line 39 of file BlockArray.h.
BlockArray::BlockArray | ( | ) |
Creates a history file for holding maximal size blocks.
If more blocks are requested, then it drops earlier added ones.
Definition at line 39 of file BlockArray.cpp.
BlockArray::~BlockArray | ( | ) |
destructor
Definition at line 54 of file BlockArray.cpp.
References lastblock, and setHistorySize().
adds the Block at the end of history.
This may drop other blocks.
The ownership on the block is transfered. An unique index number is returned for accessing it later (if not yet dropped then)
Note, that the block may be dropped completely if history is turned off.
Definition at line 60 of file BlockArray.cpp.
References current, index, ion, length, SEEK_SET, setHistorySize(), and size.
Referenced by newBlock().
gets the block at the index.
Function may return 0 if the block isn't available any more.
The returned block is strictly readonly as only maped in memory - and will be invalid on the next operation on this class.
Definition at line 108 of file BlockArray.cpp.
References index, ion, lastblock, lastmap, lastmap_index, size, and unmap().
Referenced by HistoryScrollBlockArray::getCells().
Definition at line 227 of file BlockArray.cpp.
References blocksize, current, index, ion, length, moveBlock(), and size.
Referenced by setHistorySize().
|
inline |
Definition at line 97 of file BlockArray.h.
References current.
Referenced by HistoryScrollBlockArray::addCells().
Definition at line 96 of file BlockArray.cpp.
|
private |
Definition at line 273 of file BlockArray.cpp.
References blocksize, current, index, ion, length, moveBlock(), SEEK_SET, and size.
Referenced by setHistorySize().
Block * BlockArray::lastBlock | ( | ) | const |
Definition at line 91 of file BlockArray.cpp.
References lastblock.
Referenced by HistoryScrollBlockArray::addCells().
|
inline |
size_t BlockArray::newBlock | ( | ) |
Definition at line 81 of file BlockArray.cpp.
References append(), index, lastblock, and size.
Referenced by HistoryScrollBlockArray::addCells().
reorders blocks as needed.
If newsize is null, the history is emptied completely. The indices returned on append won't change their semantic, but they may not be valid after this call.
Definition at line 156 of file BlockArray.cpp.
References current, decreaseBuffer(), increaseBuffer(), ion, lastblock, length, size, and unmap().
Referenced by append(), HistoryScrollBlockArray::HistoryScrollBlockArray(), setSize(), and ~BlockArray().
Convenient function to set the size in KBytes instead of blocks.
Definition at line 151 of file BlockArray.cpp.
References setHistorySize().
|
private |
Definition at line 141 of file BlockArray.cpp.
References lastmap, and lastmap_index.
Referenced by at(), and setHistorySize().
|
private |
Definition at line 106 of file BlockArray.h.
Referenced by append(), decreaseBuffer(), getCurrent(), increaseBuffer(), and setHistorySize().
|
private |
Definition at line 107 of file BlockArray.h.
Referenced by append(), at(), decreaseBuffer(), has(), increaseBuffer(), and newBlock().
|
private |
Definition at line 113 of file BlockArray.h.
Referenced by append(), at(), decreaseBuffer(), increaseBuffer(), and setHistorySize().
|
private |
Definition at line 111 of file BlockArray.h.
Referenced by at(), lastBlock(), newBlock(), setHistorySize(), and ~BlockArray().
|
private |
Definition at line 109 of file BlockArray.h.
|
private |
Definition at line 110 of file BlockArray.h.
|
private |
Definition at line 114 of file BlockArray.h.
Referenced by append(), decreaseBuffer(), has(), increaseBuffer(), len(), and setHistorySize().
|
private |
Definition at line 104 of file BlockArray.h.
Referenced by append(), at(), decreaseBuffer(), increaseBuffer(), newBlock(), and setHistorySize().