libdballe 9.6
|
Buffer of simple structures that becomes file backed if it grows beyond a certain size. More...
#include <structbuf.h>
Protected Member Functions | |
void | write_to_file () |
Protected Attributes | |
T * | membuf = nullptr |
In-memory buffer using during appending. | |
unsigned | membuf_last = 0 |
Number of items in membuf. | |
const T * | readbuf = (const T*)MAP_FAILED |
Memory area used for reading. | |
size_t | m_count = 0 |
Number of items appended so far. | |
int | tmpfile_fd = -1 |
Unix file descriptor to the temporary file, or -1 if we are memory backed. | |
Buffer of simple structures that becomes file backed if it grows beyond a certain size.
bufsize is the number of T items that we keep in memory before becoming file-backed.
|
protected |
In-memory buffer using during appending.
When it becomes full, it is flushed out to a temporary file.
Referenced by dballe::Structbuf< T, bufsize >::append(), and dballe::Structbuf< T, bufsize >::ready_to_read().
|
protected |
Memory area used for reading.
It points to membuf if we are memory-backed, or it is the mmap view of the file if we are file-backed
Referenced by dballe::Structbuf< T, bufsize >::append(), dballe::Structbuf< T, bufsize >::operator[](), and dballe::Structbuf< T, bufsize >::ready_to_read().