Template Class CommandListener

Inheritance Relationships

Base Type

  • public dds::sub::NoOpDataReaderListener< T >

Class Documentation

template<typename T>
class mimir::control::CommandListener : public dds::sub::NoOpDataReaderListener<T>

Listener class that calls a callback function when subscribed DDS data becomes available.

Public Functions

inline CommandListener(std::function<void(dds::sub::DataReader<T>&)> doHandle)

Constructor.

Data reader listener for DDS type T. When data becomes available, the user-provided function is called.

Parameters

doHandle[in] Function pointer to call, when on_data_available().

inline virtual void on_data_available(dds::sub::DataReader<T> &dataReader)

Function overridden from base class to be called on data available.

This function is called when subscribed data becomes available on the DDS bus. It dispatches a reference of the data reader to the handle function that the user provided at construction.

Private Members

std::function<void(dds::sub::DataReader<T>&)> m_doHandleFcn

Function object to be called.