BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Types | Public Member Functions
BeeeOn::InMemoryQueuingStrategy Class Reference

Basic implementation of the QueuingStrategy interface. More...

#include <InMemoryQueuingStrategy.h>

Inheritance diagram for BeeeOn::InMemoryQueuingStrategy:
BeeeOn::QueuingStrategy

Public Types

typedef Poco::SharedPtr
< InMemoryQueuingStrategy
Ptr
 
- Public Types inherited from BeeeOn::QueuingStrategy
typedef Poco::SharedPtr
< QueuingStrategy
Ptr
 

Public Member Functions

bool empty () override
 
size_t size ()
 
void push (const std::vector< SensorData > &data) override
 
size_t peek (std::vector< SensorData > &data, size_t count) override
 
void pop (size_t count) override
 

Detailed Description

Basic implementation of the QueuingStrategy interface.

Serves as temporary non-persistent storage of SensorData. The data are held in the std::vector.

Member Function Documentation

bool InMemoryQueuingStrategy::empty ( )
overridevirtual
Returns
True, if the vector is empty, false otherwise.

Implements BeeeOn::QueuingStrategy.

size_t InMemoryQueuingStrategy::peek ( std::vector< SensorData > &  data,
size_t  count 
)
overridevirtual

Peek the given count of data off the vector starting from the oldest one. Calling this method is stable (returns the same results) until the pop() method is called.

Parameters
dataVector to be filled with data
countRequired count of data
Returns
Real count of data added to the "data" vector.

Implements BeeeOn::QueuingStrategy.

void InMemoryQueuingStrategy::pop ( size_t  count)
overridevirtual

Pop the required amount of data off the vector.

Parameters
countNumber of data to be popped

Implements BeeeOn::QueuingStrategy.

void InMemoryQueuingStrategy::push ( const std::vector< SensorData > &  data)
overridevirtual

Adds the given data to the end of the vector.

Parameters
data

Implements BeeeOn::QueuingStrategy.

size_t InMemoryQueuingStrategy::size ( )
Returns
actual size of the in-memory queue.

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