The SensorGroupThread class implements functionality to extract the group identifier of an incoming sensor group message and starts the parsing function of the correct SensorGroup object. More...
#include <sensorgroupthread.h>
Public Member Functions | |
void | registerErrorCallback (errorCallbackPtr error) |
Register an error callback that can be called to treat occuing communication and parsing errors. More... | |
SensorGroupThread (std::shared_ptr< Syntax > syntax, ThreadDispatcher *dispatcher, const std::unordered_map< unsigned char, std::shared_ptr< SensorGroup >> &sensorGroups) | |
SensorGroupThread constructor. More... | |
void | startThread () |
Start parsing incoming sensor group messages. More... | |
void | stopThread () |
Stop parsing incoming sensor group messages. More... | |
![]() | |
CommunicationThread () | |
CommunicationThread default constructor. More... | |
CommunicationThread (CommunicationThread &&other)=delete | |
CommunicationThread default Move initialization. More... | |
CommunicationThread (const CommunicationThread &other)=delete | |
CommunicationThread default Copy initialization. More... | |
CommunicationThread & | operator= (CommunicationThread &&other)=delete |
CommunicationThread default Move assignment. More... | |
CommunicationThread & | operator= (const CommunicationThread &other) |
CommunicationThread default Copy assignment. More... | |
void | sleep () |
Locks the current worker thread until wakeUp() is called. More... | |
void | wakeUp () |
Unlocks the current worker thread. More... | |
Private Member Functions | |
void | workerFunction () |
Worker function, responsible for parsing sensor messages and calling the correct sensor group processing function. More... | |
Private Attributes | |
ThreadDispatcher * | dispatcher |
errorCallbackPtr | error |
bool | errorCBregistered |
std::unordered_map< unsigned char, std::shared_ptr< SensorGroup > > | sensorGroups |
std::shared_ptr< Syntax > | syntax |
Additional Inherited Members | |
![]() | |
bool | active |
std::thread | worker |
The SensorGroupThread class implements functionality to extract the group identifier of an incoming sensor group message and starts the parsing function of the correct SensorGroup object.
Definition at line 36 of file sensorgroupthread.h.
SensorGroupThread::SensorGroupThread | ( | std::shared_ptr< Syntax > | syntax, |
ThreadDispatcher * | dispatcher, | ||
const std::unordered_map< unsigned char, std::shared_ptr< SensorGroup >> & | sensorGroups | ||
) |
SensorGroupThread constructor.
[in] | syntax | Syntax object |
[in] | dispatcher | pointer to a ThreadDispatcher object |
[in] | sensorGroups | map of SensorGroup object which can be accessed by this class. |
Definition at line 9 of file sensorgroupthread.cpp.
void SensorGroupThread::registerErrorCallback | ( | errorCallbackPtr | error | ) |
Register an error callback that can be called to treat occuing communication and parsing errors.
error | pointer to the error handling callback which decides what to do with an error message. |
Definition at line 31 of file sensorgroupthread.cpp.
|
virtual |
Start parsing incoming sensor group messages.
Implements CommunicationThread.
Definition at line 18 of file sensorgroupthread.cpp.
|
virtual |
Stop parsing incoming sensor group messages.
Implements CommunicationThread.
Definition at line 24 of file sensorgroupthread.cpp.
|
privatevirtual |
Worker function, responsible for parsing sensor messages and calling the correct sensor group processing function.
Implements CommunicationThread.
Definition at line 37 of file sensorgroupthread.cpp.
|
private |
Dispatcher object managing multi threading
Definition at line 68 of file sensorgroupthread.h.
|
private |
Pointer to the error handling function
Definition at line 73 of file sensorgroupthread.h.
|
private |
Is an error callback available?
Definition at line 74 of file sensorgroupthread.h.
|
private |
SensorGroup map (first: group number, second: SensorGroup)
Definition at line 71 of file sensorgroupthread.h.
|
private |
Pointer to a Syntax object
Definition at line 69 of file sensorgroupthread.h.