odtone::mih::archive
// In header: </home/carlos/Projectos/odtone/inc/odtone/mih/archive.hpp> class archive { public: // types typedef std::vector< uint8 >::const_iterator const_iterator; // construct/copy/destruct archive(); ~archive(); // public member functions void clear(); void swap(std::vector< uint8 > &); void buffer(const uint8 *, size_t); template<typename InputIteratorT> void append(InputIteratorT, InputIteratorT); const_iterator begin() const; const_iterator end() const; std::vector< uint8 > & buffer(); iarchive input(); oarchive output(); void position(uint); uint position() const; };
Provides serialization/deserialization for the message payload.
archive
public member functionsvoid clear();
Clear the contents of the archive. Its size and actual position is set to 0 (zero).
void swap(std::vector< uint8 > & buffer);
Exchanges the content of the archive by the content of buffer, which can have different sizes. All iterators, references and pointers remain valid for the swapped vectors.
Parameters: |
|
void buffer(const uint8 * buf, size_t len);
Fills archive's contents.
Parameters: |
|
template<typename InputIteratorT> void append(InputIteratorT begin, InputIteratorT end);
Inserts an element, a number of elements or a range of elements into the archive at a specified position.
Parameters: |
|
const_iterator begin() const;
A random-access iterator addressing the first element in the archive or to the location succeeding an empty archive. The iterator should always be compared with vector::end to ensure it is valid.
Returns: |
A random-access iterator to the first element in the container. |
const_iterator end() const;
A random-access iterator to the end of the archive object. If the archive is empty, vector::end == vector::begin.
Returns: |
A random-access iterator that points just beyond the end of the archive. |
std::vector< uint8 > & buffer();
Get archive's contents.
Returns: |
The archive's contents. |
iarchive input();
Get the corresponding input archive.
Returns: |
The input archive. |
oarchive output();
Get the corresponding output archive.
Returns: |
The output archive. |
void position(uint pos);
Point to a new position in the archive.
Parameters: |
|
uint position() const;
Get the current position in the archive.
Returns: |
The current position in the archive. |