7 #ifndef THREADDISPATCHER_H 8 #define THREADDISPATCHER_H 147 #endif // THREADDISPATCHER_H Header file for the CommunicationConfig class.
const bool IsResponseQueueEmpty() const
Is there a response in the response queue?
Header file for the SensorGroupThread class.
Header file for the CommunicationThread class.
bool rawCommunicationEnabled
Header file for the ReadingThread class.
The ThreadDispatcher class coordinates other communication threads and handles start up and shut down...
std::condition_variable * comCV
ReadingThread * readingThread
The ReadingThread class implements threadded polling of the serial input buffer.
void enableDebugMessages(debugCallbackPtr debug)
Enable pass through of every line in the input buffer.
std::queue< std::string > sensorGroupMessage
void registerErrorCallback(debugCallbackPtr error)
Register a callback to handle transmission/communication errors.
void setCommunicationCondVar(std::condition_variable *condVar)
Register the condition variable of the Communication object in order to wakeup a waiting command resp...
void setReadingThread(ReadingThread *rxThread)
Register ReadingThread with the thread dispatcher.
SensorGroupThread * sensorGroupThread
void startThread()
Start dispatching thread, SensorGroupThread and ReadingThread.
The CommunicationThread class is the abstract base class of all thread objects used in the communicat...
const bool IsMessageQueueEmpty() const
Is there a message in the message queue?
Header file for the SerialInterface class.
std::queue< std::string > commandResponse
void stopThread()
Stop dispatching thread, SensorGroupThread and ReadingThread.
void wakeUp()
Unlocks the current worker thread.
ThreadDispatcher(const std::shared_ptr< Syntax > &syntax)
ThreadDispatcher constructor.
boost::function< void(const std::string &)> debugCallbackPtr
void setSensorGroupThread(SensorGroupThread *grpThread)
Register SensorGroupThread with the thread dispatcher.
void setCommunicationWakeUp(bool wakeUp)
Set wether there is a command response thread waiting or not.
void workerFunction()
Worker function, responsible for dispatching the correct thread and observing incoming messages from ...
void enableRawCommunication()
Enables the transmission of raw messages to the serial device.
void dequeueResponse(std::string &response)
Pop a received command response from the response queue.
std::shared_ptr< Syntax > syntax
The SensorGroupThread class implements functionality to extract the group identifier of an incoming s...
void dequeueSensorGroupMessage(std::string &response)
Pop a received sensor group message from the message queue.
void registerTextCallback(debugCallbackPtr text)
Register a callback to handle plain text messages from the serial device.