Public Member Functions | Private Member Functions | Private Attributes | List of all members
SensorGroupThread Class Reference

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>

Inheritance diagram for SensorGroupThread:
Inheritance graph
[legend]

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...
 
- Public Member Functions inherited from CommunicationThread
 CommunicationThread ()
 CommunicationThread default constructor. More...
 
 CommunicationThread (CommunicationThread &&other)=delete
 CommunicationThread default Move initialization. More...
 
 CommunicationThread (const CommunicationThread &other)=delete
 CommunicationThread default Copy initialization. More...
 
CommunicationThreadoperator= (CommunicationThread &&other)=delete
 CommunicationThread default Move assignment. More...
 
CommunicationThreadoperator= (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

ThreadDispatcherdispatcher
 
errorCallbackPtr error
 
bool errorCBregistered
 
std::unordered_map< unsigned char, std::shared_ptr< SensorGroup > > sensorGroups
 
std::shared_ptr< Syntaxsyntax
 

Additional Inherited Members

- Public Attributes inherited from CommunicationThread
bool active
 
std::thread worker
 

Detailed Description

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.

Constructor & Destructor Documentation

SensorGroupThread::SensorGroupThread ( std::shared_ptr< Syntax syntax,
ThreadDispatcher dispatcher,
const std::unordered_map< unsigned char, std::shared_ptr< SensorGroup >> &  sensorGroups 
)

SensorGroupThread constructor.

Parameters
[in]syntaxSyntax object
[in]dispatcherpointer to a ThreadDispatcher object
[in]sensorGroupsmap of SensorGroup object which can be accessed by this class.

Definition at line 9 of file sensorgroupthread.cpp.

Member Function Documentation

void SensorGroupThread::registerErrorCallback ( errorCallbackPtr  error)

Register an error callback that can be called to treat occuing communication and parsing errors.

Parameters
errorpointer to the error handling callback which decides what to do with an error message.

Definition at line 31 of file sensorgroupthread.cpp.

void SensorGroupThread::startThread ( )
virtual

Start parsing incoming sensor group messages.

Implements CommunicationThread.

Definition at line 18 of file sensorgroupthread.cpp.

void SensorGroupThread::stopThread ( )
virtual

Stop parsing incoming sensor group messages.

Implements CommunicationThread.

Definition at line 24 of file sensorgroupthread.cpp.

void SensorGroupThread::workerFunction ( )
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.

Member Data Documentation

ThreadDispatcher* SensorGroupThread::dispatcher
private

Dispatcher object managing multi threading

Definition at line 68 of file sensorgroupthread.h.

errorCallbackPtr SensorGroupThread::error
private

Pointer to the error handling function

Definition at line 73 of file sensorgroupthread.h.

bool SensorGroupThread::errorCBregistered
private

Is an error callback available?

Definition at line 74 of file sensorgroupthread.h.

std::unordered_map<unsigned char, std::shared_ptr<SensorGroup> > SensorGroupThread::sensorGroups
private

SensorGroup map (first: group number, second: SensorGroup)

Definition at line 71 of file sensorgroupthread.h.

std::shared_ptr<Syntax> SensorGroupThread::syntax
private

Pointer to a Syntax object

Definition at line 69 of file sensorgroupthread.h.


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


pses_ucbridge
Author(s): Sebastian Ehmes
autogenerated on Sat Oct 28 2017 19:16:13