BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Member Functions | Static Public Member Functions | Protected Member Functions
BeeeOn::JournalQueuingStrategy::FileBuffer Class Reference

Representation of a persistent file buffer that contains entries holding the stored SensorData. More...

#include <JournalQueuingStrategy.h>

Public Member Functions

 FileBuffer (const Poco::Path &path, size_t offset, size_t size)
 
std::string name () const
 
Poco::Path path () const
 
size_t offset () const
 
size_t size () const
 
bool exhausted () const
 
size_t readEntries (std::function< void(const Entry &entry)> proc)
 Read all entries from the current offset. The offset is updated to point after the read data (even in case of an exception).
 
size_t readEntries (std::function< void(const Entry &entry)> proc, const size_t count)
 Read up to count entries from the current offset. The offset is updated to point after the read data (even in case of an exception).
 
void inspectAndVerify (const Poco::DigestEngine::Digest &digest, FileBufferStat &stat) const
 

Static Public Member Functions

static std::string formatEntries (const std::vector< SensorData > &data)
 Format the given data into the form as expected by the readEntries() method.
 

Protected Member Functions

size_t scanEntries (size_t offset, std::function< void(const Entry &entry)> proc, size_t &bytes, const size_t count) const
 Scan for up to count entries from the current offset. The parameter bytes is updated continuously while reading any bytes and it would up to date even in case of an exception.
 
size_t scanEntries (std::istream &in, std::function< void(const Entry &entry)> proc, size_t &bytes, const size_t count) const
 Scan for up to count entries from the given input stream. The parameter bytes is updated continuously while reading any bytes and it would up to date even in case of an exception.
 

Detailed Description

Representation of a persistent file buffer that contains entries holding the stored SensorData.

Member Function Documentation

bool JournalQueuingStrategy::FileBuffer::exhausted ( ) const
Returns
true if the offset is greater than size and thus the buffer contains no more data to be scanned.

The documentation for this class was generated from the following files: