5 #include <Poco/AtomicCounter.h>
6 #include <Poco/Mutex.h>
7 #include <Poco/SharedPtr.h>
9 #include "core/Exporter.h"
10 #include "model/SensorData.h"
11 #include "util/Loggable.h"
12 #include "util/FailDetector.h"
18 typedef Poco::SharedPtr<ExporterQueue> Ptr;
20 const static int UNLIMITED_BATCH_SIZE = 0;
21 const static int UNLIMITED_CAPACITY = 0;
22 const static int UNLIMITED_THRESHOLD = FailDetector::TRESHOLD_UNLIMITED;
30 Poco::SharedPtr<Exporter> exporter,
38 unsigned int exportBatch();
40 unsigned int sent()
const;
41 unsigned int dropped()
const;
49 bool canExport(
const Poco::Timespan &deadTimeout)
const;
58 bool deadTooLong(
const Poco::Timespan deadTimeout)
const;
66 mutable Poco::FastMutex m_queueMutex;
68 Poco::SharedPtr<Exporter> m_exporter;
70 Poco::AtomicCounter m_dropped;
71 Poco::AtomicCounter m_sent;
74 std::queue<SensorData> m_queue;
75 unsigned int m_capacity;
76 unsigned int m_batchSize;
Definition: FailDetector.h:8
Definition: SensorData.h:20
Definition: ExporterQueue.h:16
bool canExport(const Poco::Timespan &deadTimeout) const
Definition: ExporterQueue.cpp:82
ExporterQueue(Poco::SharedPtr< Exporter > exporter, int batchSize, int capacity, int treshold)
Definition: ExporterQueue.cpp:11
Definition: Loggable.h:19