Template Class Source
Defined in File source.hpp
Inheritance Relationships
Base Type
public fkie_message_filters::FilterBase(Class FilterBase)
Derived Type
public fkie_message_filters::Subscriber< M, Translate, A >(Template Class Subscriber)
Class Documentation
-
template<typename ...Outputs>
class Source : public virtual fkie_message_filters::FilterBase Base class for data providers.
In the message filter library, all data flows from sources to sinks. The sources are providers of data, which may either be generated synthetically or gathered from other sources, such as ROS topics.
Derived classes need to call the send() method to pass actual data to the connected sinks. This class does nothing but track which sinks have been connected. The send() method takes the same number and types of arguments as specified in the template instantiation.
See also
Subclassed by fkie_message_filters::Subscriber< M, Translate, A >
Public Types
Public Functions
-
inline virtual ~Source()
-
Connection connect_to_sink(Sink<Outputs...> &dst) noexcept
Connect this source to a sink.
Can be called multiple times to connect multiple sinks; in that case, the sinks receive data in the same order as they have been connected. This function does basically the same thing as Sink::connect_to_source(), only from the opposite point of view.
dstthe sink that is to be connected
Does not throw any exceptions.
- Returns:
a connection object that can be used to monitor or sever the created connection
-
virtual void disconnect() noexcept override
Disconnect from all connected sinks.
The source implementation calls disconnect_from_all_sinks().
Does not throw any exceptions.
-
void disconnect_from_all_sinks() noexcept
Disconnect from all connected sinks.
Severs the connection to all sinks, turning the send() method into a no-op.
Does not throw any exceptions.
-
inline virtual void reset() noexcept
Reset filter state.
For stateful filters, this method resets the internal state as if the filter had just been created. Existing connections to sources and sinks are unaffected.
The default implementation does nothing.
Does not throw any exceptions.
Public Static Attributes
-
inline virtual ~Source()