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

#include <datastream_zmq.h>

Inheritance diagram for DataStreamZMQ:
Inheritance graph
[legend]

Public Member Functions

 DataStreamZMQ ()
 
virtual bool isDebugPlugin () override
 
virtual bool isRunning () const override
 isRunning More...
 
virtual const char * name () const override
 Name of the plugin type, NOT the particular instance. More...
 
virtual void shutdown () override
 shutdown Stop streaming More...
 
virtual bool start (QStringList *) override
 start streaming. More...
 
virtual ~DataStreamZMQ () override
 
- Public Member Functions inherited from PJ::DataStreamer
PlotDataMapRefdataMap ()
 
const PlotDataMapRefdataMap () const
 
 DataStreamer ()=default
 
std::mutex & mutex ()
 
virtual std::pair< QAction *, int > notificationAction ()
 Gets the action to execute when clicking the 'notifications' button and the current number of outstanding notifications. More...
 
const ParserFactoriesparserFactories () const
 
void setMaximumRangeX (double range)
 
void setParserFactories (ParserFactories *parsers)
 
virtual ~DataStreamer ()=default
 
- Public Member Functions inherited from PJ::PlotJugglerPlugin
virtual const std::vector< QAction * > & availableActions ()
 
virtual QWidget * optionsWidget ()
 optionsWidget pointer to a persistent widget used to set the plugin options . More...
 
 PlotJugglerPlugin ()=default
 
virtual bool xmlLoadState (const QDomElement &parent_element)
 Override this method to load the status of the plugin from XML. More...
 
QDomElement xmlSaveState (QDomDocument &doc) const
 
virtual bool xmlSaveState (QDomDocument &doc, QDomElement &parent_element) const
 Override this method to save the status of the plugin to XML. More...
 

Private Member Functions

bool parseMessage (const PJ::MessageRef &msg, double &timestamp)
 
bool parseMessage (const std::string &topic, const PJ::MessageRef &msg, double &timestamp)
 
void parseTopicFilters (const QString &filters)
 
void receiveLoop ()
 
void subscribeTopics ()
 
void unsubscribeTopics ()
 

Private Attributes

bool _is_connect = false
 
PJ::MessageParserPtr _parser
 
PJ::ParserFactoryPlugin::Ptr _parser_creator
 
std::map< std::string, PJ::MessageParserPtr_parsers
 
std::thread _receive_thread
 
bool _running
 
std::string _socket_address
 
std::vector< std::string > _topic_filters
 
zmq::context_t _zmq_context
 
zmq::socket_t _zmq_socket
 

Additional Inherited Members

- Signals inherited from PJ::DataStreamer
void clearBuffers ()
 Request the main application to clear previous data points. More...
 
void closed ()
 
void dataReceived ()
 
void notificationsChanged (int active_notification_count)
 
void removeGroup (std::string group_name)
 All the series which share this group, will be deleted. More...
 

Detailed Description

Definition at line 24 of file datastream_zmq.h.

Constructor & Destructor Documentation

◆ DataStreamZMQ()

DataStreamZMQ::DataStreamZMQ ( )

Definition at line 32 of file datastream_zmq.cpp.

◆ ~DataStreamZMQ()

DataStreamZMQ::~DataStreamZMQ ( )
overridevirtual

Definition at line 37 of file datastream_zmq.cpp.

Member Function Documentation

◆ isDebugPlugin()

virtual bool DataStreamZMQ::isDebugPlugin ( )
inlineoverridevirtual

Override this to return true, if you want this plugin to be loaded only when the command line option [-t] is used.

Reimplemented from PJ::PlotJugglerPlugin.

Definition at line 49 of file datastream_zmq.h.

◆ isRunning()

virtual bool DataStreamZMQ::isRunning ( ) const
inlineoverridevirtual

isRunning

Returns
true if start() called, false after shutwodn()

Implements PJ::DataStreamer.

Definition at line 39 of file datastream_zmq.h.

◆ name()

virtual const char* DataStreamZMQ::name ( ) const
inlineoverridevirtual

Name of the plugin type, NOT the particular instance.

Implements PJ::PlotJugglerPlugin.

Definition at line 44 of file datastream_zmq.h.

◆ parseMessage() [1/2]

bool DataStreamZMQ::parseMessage ( const PJ::MessageRef msg,
double &  timestamp 
)
private

Definition at line 290 of file datastream_zmq.cpp.

◆ parseMessage() [2/2]

bool DataStreamZMQ::parseMessage ( const std::string &  topic,
const PJ::MessageRef msg,
double &  timestamp 
)
private

Definition at line 304 of file datastream_zmq.cpp.

◆ parseTopicFilters()

void DataStreamZMQ::parseTopicFilters ( const QString &  filters)
private

Definition at line 325 of file datastream_zmq.cpp.

◆ receiveLoop()

void DataStreamZMQ::receiveLoop ( )
private

Definition at line 207 of file datastream_zmq.cpp.

◆ shutdown()

void DataStreamZMQ::shutdown ( )
overridevirtual

shutdown Stop streaming

Implements PJ::DataStreamer.

Definition at line 183 of file datastream_zmq.cpp.

◆ start()

bool DataStreamZMQ::start ( QStringList *  pre_selected_sources)
overridevirtual

start streaming.

Parameters
optionallist of pre selected sources.
Returns
true if started correctly.

Implements PJ::DataStreamer.

Definition at line 42 of file datastream_zmq.cpp.

◆ subscribeTopics()

void DataStreamZMQ::subscribeTopics ( )
private

Definition at line 344 of file datastream_zmq.cpp.

◆ unsubscribeTopics()

void DataStreamZMQ::unsubscribeTopics ( )
private

Definition at line 354 of file datastream_zmq.cpp.

Member Data Documentation

◆ _is_connect

bool DataStreamZMQ::_is_connect = false
private

Definition at line 64 of file datastream_zmq.h.

◆ _parser

PJ::MessageParserPtr DataStreamZMQ::_parser
private

Definition at line 58 of file datastream_zmq.h.

◆ _parser_creator

PJ::ParserFactoryPlugin::Ptr DataStreamZMQ::_parser_creator
private

Definition at line 63 of file datastream_zmq.h.

◆ _parsers

std::map<std::string, PJ::MessageParserPtr> DataStreamZMQ::_parsers
private

Definition at line 62 of file datastream_zmq.h.

◆ _receive_thread

std::thread DataStreamZMQ::_receive_thread
private

Definition at line 60 of file datastream_zmq.h.

◆ _running

bool DataStreamZMQ::_running
private

Definition at line 55 of file datastream_zmq.h.

◆ _socket_address

std::string DataStreamZMQ::_socket_address
private

Definition at line 59 of file datastream_zmq.h.

◆ _topic_filters

std::vector<std::string> DataStreamZMQ::_topic_filters
private

Definition at line 61 of file datastream_zmq.h.

◆ _zmq_context

zmq::context_t DataStreamZMQ::_zmq_context
private

Definition at line 56 of file datastream_zmq.h.

◆ _zmq_socket

zmq::socket_t DataStreamZMQ::_zmq_socket
private

Definition at line 57 of file datastream_zmq.h.


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


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon May 26 2025 02:22:39