Template Class SimpleFilter

Inheritance Relationships

Base Type

Derived Types

Class Documentation

template<class M>
class SimpleFilter : public message_filters::noncopyable

Convenience base-class for simple filters which output a single message.

SimpleFilter provides some of the tricky callback registering functionality, so that simple filters do not have to duplicate it. It also provides getName()/setName() for debugging purposes.

Subclassed by message_filters::Cache< M >, message_filters::Chain< M >, message_filters::PassThrough< M >, message_filters::TimeSequencer< M >

Public Types

typedef std::shared_ptr<M const> MConstPtr
typedef std::function<void(const MConstPtr&)> Callback
typedef MessageEvent<M const> EventType
typedef std::function<void(const EventType&)> EventCallback

Public Functions

template<typename C>
inline Connection registerCallback(const C &callback)

Register a callback to be called when this filter has passed.

Parameters:

callback – The callback to call

template<typename P>
inline Connection registerCallback(const std::function<void(P)> &callback)

Register a callback to be called when this filter has passed.

Parameters:

callback – The callback to call

template<typename P>
inline Connection registerCallback(void (*callback)(P))

Register a callback to be called when this filter has passed.

Parameters:

callback – The callback to call

template<typename T, typename P>
inline Connection registerCallback(void (T::* callback)(P), T *t)

Register a callback to be called when this filter has passed.

Parameters:

callback – The callback to call

inline void setName(const std::string &name)

Set the name of this filter. For debugging use.

inline const std::string &getName()

Get the name of this filter. For debugging use.

Protected Functions

inline void signalMessage(const MConstPtr &msg)

Call all registered callbacks, passing them the specified message.

inline void signalMessage(const MessageEvent<M const> &event)

Call all registered callbacks, passing them the specified message.