The ReadingThread class implements threadded polling of the serial input buffer. More...
#include <readingthread.h>

Public Member Functions | |
| std::string | getData () |
| Get retrieved data vom the serial input buffer. More... | |
| const bool | isQueueEmpty () const |
| Is a new line availible? More... | |
| ReadingThread (std::shared_ptr< Syntax > syntax, ThreadDispatcher *dispatcher) | |
| ReadingThread constructor. More... | |
| void | registerErrorCallback (errorCallbackPtr error) |
| Register an error function pointer to handle errors during communication. More... | |
| void | startThread () |
| Start the polling of the serial input buffer.. More... | |
| void | stopThread () |
| Stop the polling of the serial input buffer.. 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... | |
| 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 polling the serial input buffer. More... | |
Private Attributes | |
| std::queue< std::string > | data |
| ThreadDispatcher * | dispatcher |
| errorCallbackPtr | error |
| bool | errorCBregistered |
| std::shared_ptr< Syntax > | syntax |
Additional Inherited Members | |
Public Attributes inherited from CommunicationThread | |
| bool | active |
| std::thread | worker |
The ReadingThread class implements threadded polling of the serial input buffer.
Definition at line 31 of file readingthread.h.
| ReadingThread::ReadingThread | ( | std::shared_ptr< Syntax > | syntax, |
| ThreadDispatcher * | dispatcher | ||
| ) |
ReadingThread constructor.
| [in] | syntax | Syntax object |
| [in] | dispatcher | pointer to a ThreadDispatcher object |
Definition at line 9 of file readingthread.cpp.
| std::string ReadingThread::getData | ( | ) |
Get retrieved data vom the serial input buffer.
Definition at line 66 of file readingthread.cpp.
| const bool ReadingThread::isQueueEmpty | ( | ) | const |
Is a new line availible?
Definition at line 80 of file readingthread.cpp.
| void ReadingThread::registerErrorCallback | ( | errorCallbackPtr | error | ) |
Register an error function pointer to handle errors during communication.
| [in] | error | this function decides what to do with the contents of an error message |
Definition at line 30 of file readingthread.cpp.
|
virtual |
Start the polling of the serial input buffer..
Implements CommunicationThread.
Definition at line 17 of file readingthread.cpp.
|
virtual |
Stop the polling of the serial input buffer..
Implements CommunicationThread.
Definition at line 23 of file readingthread.cpp.
|
privatevirtual |
Worker function, responsible for polling the serial input buffer.
Implements CommunicationThread.
Definition at line 36 of file readingthread.cpp.
|
private |
Queue containing retrieved lines
Definition at line 65 of file readingthread.h.
|
private |
Dispatcher object managing multi threading
Definition at line 66 of file readingthread.h.
|
private |
Pointer to the error handling function
Definition at line 67 of file readingthread.h.
|
private |
Is an error callback availible?
Definition at line 68 of file readingthread.h.
|
private |
Pointer to a Syntax object
Definition at line 64 of file readingthread.h.