stdex
Additional custom or not Standard C++ covered algorithms
|
Helper class for read/write of records to/from memory. More...
#include <stdex/idrec.hpp>
Public Member Functions | |
record (T &d) | |
Constructs the class. | |
record (const T &d) | |
Constructs the class. | |
const record< T, T_ID, ID, T_SIZE, ALIGN > & | operator= (const record< T, T_ID, ID, T_SIZE, ALIGN > &r) |
Assignment operator. | |
Static Public Member Functions | |
static const T_ID | id () |
Returns record id. | |
static std::streamoff | open (std::ostream &stream) |
Writes record header. | |
static stdex::stream::foff_t | open (stdex::stream::basic_file &stream) |
Writes record header. | |
static std::streamoff | close (std::ostream &stream, std::streamoff start) |
Updates record header. | |
static stdex::stream::foff_t | close (stdex::stream::basic_file &stream, stdex::stream::foff_t start) |
Updates record header. | |
static bool | find (std::istream &stream, std::streamoff end=(std::streamoff) -1) |
Finds record data. | |
static bool | find (stdex::stream::basic_file &stream, stdex::stream::foff_t end=stdex::stream::foff_max) |
Finds record data. | |
Public Attributes | |
T & | data |
Record data reference. | |
Helper class for read/write of records to/from memory.
|
inline |
Constructs the class.
[in] | d | Reference to record data |
|
inline |
Constructs the class.
[in] | d | Reference to record data |
|
inlinestatic |
Updates record header.
[in] | stream | Output stream |
[in] | start | Start position of the record in stream |
stream
|
inlinestatic |
Updates record header.
[in] | stream | Output stream |
[in] | start | Start position of the record in stream |
stream
|
inlinestatic |
Finds record data.
[in] | stream | Input stream |
[in] | end | Position limit. Default is -1 (no limit). |
true
when foundfalse
otherwise
|
inlinestatic |
Finds record data.
[in] | stream | Input stream |
[in] | end | Position limit. Default is -1 (no limit). |
true
when foundfalse
otherwise
|
inlinestatic |
Writes record header.
[in] | stream | Output stream |
stream
. Save for later close
call.
|
inlinestatic |
Writes record header.
[in] | stream | Output stream |
stream
. Save for later close
call.
|
inline |
Assignment operator.
[in] | r | Source record |