42 lines
769 B
C++
Executable File
42 lines
769 B
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* Routing Test - data writer thread
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <queue>
|
|
#include <mutex>
|
|
#include <condition_variable>
|
|
#include <DDS/Routing/routing_plugin.h>
|
|
|
|
#include "logger.h"
|
|
|
|
namespace RoutingService
|
|
{
|
|
class DataWriterTask final : public DataWriterTaskInterface
|
|
{
|
|
public:
|
|
DataWriterTask();
|
|
~DataWriterTask();
|
|
|
|
void enqueue(SampleWriterInterface *swi) override;
|
|
void shutdown();
|
|
bool waitForData();
|
|
|
|
SampleWriterInterface *getNextSampleWriter();
|
|
void writeSamples();
|
|
|
|
private:
|
|
std::queue<SampleWriterInterface *> m_writerQueue;
|
|
std::mutex m_queueLock;
|
|
std::condition_variable m_waitForDataCondition;
|
|
bool m_doShutdown;
|
|
NGL::INGLLogger &m_logger;
|
|
};
|
|
|
|
} // namespace RoutingService
|