#include <Storage.h>
|
| Cache (Storage &mem, void *buf, size_t size, size_t nmemb=1) |
|
uint32_t | addr (size_t ix=0) |
|
int | read (size_t ix=0) |
|
int | write (size_t ix=0) |
|
uint32_t | addr () |
|
int | read (void *buf, uint32_t offset, size_t size) |
|
int | write (uint32_t offset, const void *buf, size_t size) |
|
Storage Cache for data; temporary or persistent external storage of data with local memory copy. Allows element access of vectors on external storage.
Definition at line 171 of file Storage.h.
Storage::Cache::Cache |
( |
Storage & |
mem, |
|
|
void * |
buf, |
|
|
size_t |
size, |
|
|
size_t |
nmemb = 1 |
|
) |
| |
|
inline |
Construct cached block on given storage device with the given local buffer, member size and number of members. Storage is allocated on the device for the total storage of the members. The buffer is assumed to only hold a single member.
- Parameters
-
[in] | mem | storage device for block. |
[in] | buf | buffer address. |
[in] | size | number of bytes per member. |
[in] | nmemb | number of members (default 1). |
Definition at line 183 of file Storage.h.
uint32_t Storage::Block::addr |
( |
| ) |
|
|
inlineinherited |
Returns storage address for the memory block.
- Returns
- address.
Definition at line 119 of file Storage.h.
uint32_t Storage::Cache::addr |
( |
size_t |
ix = 0 | ) |
|
|
inline |
Returns storage address for the indexed storage block.
- Parameters
-
[in] | ix | member index (default 0): |
- Returns
- address.
Definition at line 196 of file Storage.h.
int Storage::Block::read |
( |
void * |
buf, |
|
|
uint32_t |
offset, |
|
|
size_t |
size |
|
) |
| |
|
inlineinherited |
Read given number of bytes from offset within block to given buffer. Returns number of bytes read or negative error code.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | offset | offset within block. |
[in] | size | number of bytes to read. |
- Returns
- number of bytes read or negative error code.
Definition at line 132 of file Storage.h.
int Storage::Cache::read |
( |
size_t |
ix = 0 | ) |
|
|
inline |
Read indexed storage block to buffer. Default index is the first member. Returns number of bytes read or negative error code.
- Parameters
-
[in] | ix | member index (default 0): |
- Returns
- number of bytes read or negative error code.
Definition at line 212 of file Storage.h.
int Storage::Block::write |
( |
uint32_t |
offset, |
|
|
const void * |
buf, |
|
|
size_t |
size |
|
) |
| |
|
inlineinherited |
Write given number of bytes from buffer to given offset within block. Returns number of bytes written or negative error code.
- Parameters
-
[in] | buf | buffer pointer. |
[in] | offset | offset within block. |
[in] | size | number of bytes to write. |
- Returns
- number of bytes written or negative error code.
Definition at line 148 of file Storage.h.
int Storage::Cache::write |
( |
size_t |
ix = 0 | ) |
|
|
inline |
Write buffer to indexed storage block. Default index is the first member. Returns number of bytes written or negative error code.
- Parameters
-
[in] | ix | member index (default 0): |
- Returns
- number of bytes written or negative error code.
Definition at line 228 of file Storage.h.
const uint32_t Storage::Block::m_addr |
|
protectedinherited |
Address on storage device.
Definition at line 163 of file Storage.h.
void* Storage::Cache::m_buf |
|
protected |
const size_t Storage::Cache::MSIZE |
const size_t Storage::Cache::NMEMB |
Number of members.
Definition at line 241 of file Storage.h.
const uint32_t Storage::Block::SIZE |
|
inherited |
Size of memory block.
Definition at line 156 of file Storage.h.
The documentation for this class was generated from the following file: