readingthread.h
Go to the documentation of this file.
1 
7 #ifndef READINGTHREAD_H
8 #define READINGTHREAD_H
9 
10 #include <string>
11 #include <queue>
15 #include <boost/range/algorithm/remove_if.hpp>
16 
17 class ThreadDispatcher;
18 
24 typedef boost::function<void(const std::string&)> errorCallbackPtr;
25 
32 {
33 public:
39  ReadingThread(std::shared_ptr<Syntax> syntax, ThreadDispatcher* dispatcher);
43  void startThread();
47  void stopThread();
57  std::string getData();
62  const bool isQueueEmpty() const;
63 private:
64  std::shared_ptr<Syntax> syntax;
65  std::queue<std::string> data;
72  void workerFunction();
73 };
74 
75 #endif // READINGTHREAD_H
Header file for the CommunicationConfig class.
void workerFunction()
Worker function, responsible for polling the serial input buffer.
void registerErrorCallback(errorCallbackPtr error)
Register an error function pointer to handle errors during communication.
Header file for the CommunicationThread class.
The ThreadDispatcher class coordinates other communication threads and handles start up and shut down...
ThreadDispatcher * dispatcher
Definition: readingthread.h:66
boost::function< void(const std::string &)> errorCallbackPtr
Definition: readingthread.h:24
The ReadingThread class implements threadded polling of the serial input buffer.
Definition: readingthread.h:31
std::shared_ptr< Syntax > syntax
Definition: readingthread.h:64
bool errorCBregistered
Definition: readingthread.h:68
Header file for the ThreadDispatcher class.
ReadingThread(std::shared_ptr< Syntax > syntax, ThreadDispatcher *dispatcher)
ReadingThread constructor.
errorCallbackPtr error
Definition: readingthread.h:67
void startThread()
Start the polling of the serial input buffer..
void stopThread()
Stop the polling of the serial input buffer..
The CommunicationThread class is the abstract base class of all thread objects used in the communicat...
std::queue< std::string > data
Definition: readingthread.h:65
const bool isQueueEmpty() const
Is a new line availible?
std::string getData()
Get retrieved data vom the serial input buffer.


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