BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Types | Public Member Functions | Static Public Attributes
BeeeOn::ExporterQueue Class Reference
Inheritance diagram for BeeeOn::ExporterQueue:
BeeeOn::Loggable

Public Types

typedef Poco::SharedPtr
< ExporterQueue
Ptr
 

Public Member Functions

 ExporterQueue (Poco::SharedPtr< Exporter > exporter, int batchSize, int capacity, int treshold)
 
void enqueue (const SensorData &sensorData)
 
unsigned int exportBatch ()
 
unsigned int sent () const
 
unsigned int dropped () const
 
bool canExport (const Poco::Timespan &deadTimeout) const
 
bool working () const
 

Static Public Attributes

static const int UNLIMITED_BATCH_SIZE = 0
 
static const int UNLIMITED_CAPACITY = 0
 
static const int UNLIMITED_THRESHOLD = FailDetector::TRESHOLD_UNLIMITED
 

Additional Inherited Members

- Protected Member Functions inherited from BeeeOn::Loggable
void setupLogger (Poco::Logger *logger=0) const
 
Poco::Logger & logger () const
 
 Loggable (const ClassInfo &info)
 
 Loggable (const std::type_info &info)
 
- Static Protected Member Functions inherited from BeeeOn::Loggable
static Poco::Logger & forMethod (const char *name)
 
static Poco::Logger & forClass (const ClassInfo &info)
 
static Poco::Logger & forClass (const std::type_info &info)
 
template<typename T >
static Poco::Logger & forInstance (const T *i)
 
static void configureSimple (Poco::Logger &logger, const std::string &level)
 
static void logException (Poco::Logger &logger, const Poco::Message::Priority priority, const Poco::Exception &e, const char *file, size_t line)
 

Constructor & Destructor Documentation

ExporterQueue::ExporterQueue ( Poco::SharedPtr< Exporter exporter,
int  batchSize,
int  capacity,
int  treshold 
)

If batchSize <= 0 then size of batch is unlimited. If capacity <= 0 then data count is unlimited. If treshold <= 0 then treshold is unlimited.

Member Function Documentation

bool ExporterQueue::canExport ( const Poco::Timespan &  deadTimeout) const

The method canExport returns true if queue is not empty and at least one of following conditions is met:

  • queue is working
  • queue is dead too long

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