statepublisher_zmq.h
Go to the documentation of this file.
1 #ifndef STATE_PUBLISHER_ZMQ_H
2 #define STATE_PUBLISHER_ZMQ_H
3 
4 #include <QObject>
5 #include <QtPlugin>
6 #include <zmq.hpp>
7 #include <thread>
8 #include <mutex>
9 #include "../statepublisher_base.h"
10 
11 class StatePublisherZMQ : public QObject, StatePublisher
12 {
13  Q_OBJECT
14  Q_PLUGIN_METADATA(IID "facontidavide.PlotJuggler3.StatePublisher")
15  Q_INTERFACES(PJ::StatePublisher)
16 
17 public:
19 
20  virtual void updateState(PlotDataMap* datamap, double current_time);
21 
22  virtual ~StatePublisherZMQ();
23 
24 private:
25  PlotDataMap* _prev_dataplot;
26 
27  void run_thread();
28 
29  std::thread _thread;
30  std::mutex _mutex;
31 
32  std::map<QString, double> _current_data;
33  double _prev_time;
34 };
35 
36 #endif // STATE_PUBLISHER_ZMQ_H
StatePublisherZMQ::_prev_time
double _prev_time
Definition: statepublisher_zmq.h:33
StatePublisherZMQ::updateState
virtual void updateState(PlotDataMap *datamap, double current_time)
Definition: statepublisher_zmq.cpp:95
StatePublisherZMQ::run_thread
void run_thread()
Definition: statepublisher_zmq.cpp:19
zmq.hpp
StatePublisherZMQ::_thread
std::thread _thread
Definition: statepublisher_zmq.h:29
StatePublisherZMQ::_mutex
std::mutex _mutex
Definition: statepublisher_zmq.h:30
StatePublisherZMQ::~StatePublisherZMQ
virtual ~StatePublisherZMQ()
Definition: statepublisher_zmq.cpp:15
StatePublisherZMQ::StatePublisherZMQ
StatePublisherZMQ()
Definition: statepublisher_zmq.cpp:8
StatePublisherZMQ::_prev_dataplot
PlotDataMap * _prev_dataplot
Definition: statepublisher_zmq.h:25
StatePublisherZMQ::_current_data
std::map< QString, double > _current_data
Definition: statepublisher_zmq.h:32
StatePublisherZMQ
Definition: statepublisher_zmq.h:11
PJ::StatePublisher
Definition: statepublisher_base.h:20


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:47