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

The ReadingThread class implements threadded polling of the serial input buffer. More...

#include <readingthread.h>

Inheritance diagram for ReadingThread:
Inheritance graph
[legend]

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...
 
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 polling the serial input buffer. More...
 

Private Attributes

std::queue< std::string > data
 
ThreadDispatcherdispatcher
 
errorCallbackPtr error
 
bool errorCBregistered
 
std::shared_ptr< Syntaxsyntax
 

Additional Inherited Members

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

Detailed Description

The ReadingThread class implements threadded polling of the serial input buffer.

Definition at line 31 of file readingthread.h.

Constructor & Destructor Documentation

ReadingThread::ReadingThread ( std::shared_ptr< Syntax syntax,
ThreadDispatcher dispatcher 
)

ReadingThread constructor.

Parameters
[in]syntaxSyntax object
[in]dispatcherpointer to a ThreadDispatcher object

Definition at line 9 of file readingthread.cpp.

Member Function Documentation

std::string ReadingThread::getData ( )

Get retrieved data vom the serial input buffer.

Returns
a parsed line from the buffer

Definition at line 66 of file readingthread.cpp.

const bool ReadingThread::isQueueEmpty ( ) const

Is a new line availible?

Returns
true if a line has been retrieved from the buffer, elso false

Definition at line 80 of file readingthread.cpp.

void ReadingThread::registerErrorCallback ( errorCallbackPtr  error)

Register an error function pointer to handle errors during communication.

Parameters
[in]errorthis function decides what to do with the contents of an error message

Definition at line 30 of file readingthread.cpp.

void ReadingThread::startThread ( )
virtual

Start the polling of the serial input buffer..

Implements CommunicationThread.

Definition at line 17 of file readingthread.cpp.

void ReadingThread::stopThread ( )
virtual

Stop the polling of the serial input buffer..

Implements CommunicationThread.

Definition at line 23 of file readingthread.cpp.

void ReadingThread::workerFunction ( )
privatevirtual

Worker function, responsible for polling the serial input buffer.

Implements CommunicationThread.

Definition at line 36 of file readingthread.cpp.

Member Data Documentation

std::queue<std::string> ReadingThread::data
private

Queue containing retrieved lines

Definition at line 65 of file readingthread.h.

ThreadDispatcher* ReadingThread::dispatcher
private

Dispatcher object managing multi threading

Definition at line 66 of file readingthread.h.

errorCallbackPtr ReadingThread::error
private

Pointer to the error handling function

Definition at line 67 of file readingthread.h.

bool ReadingThread::errorCBregistered
private

Is an error callback availible?

Definition at line 68 of file readingthread.h.

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

Pointer to a Syntax object

Definition at line 64 of file readingthread.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