Template Class Sink
Defined in File sink.hpp
Nested Relationships
Nested Types
Inheritance Relationships
Base Type
public fkie_message_filters::FilterBase(Class FilterBase)
Derived Type
public fkie_message_filters::Publisher< M, Translate, A >(Template Class Publisher)
Class Documentation
-
template<typename ...Inputs>
class Sink : public virtual fkie_message_filters::FilterBase Base class for data consumers.
In the message filter library, all data flows from sources to sinks. The sinks are data consumers, which process all data they receive from a source.
Derived classes must override the receive() method to actually process data. The receive() method takes the same number and types of arguments as specified in the template instantiation.
See also
Subclassed by fkie_message_filters::Publisher< M, Translate, A >
Public Types
Public Functions
-
inline virtual ~Sink()
-
Connection connect_to_source(Source<Inputs...> &src) noexcept
Connect this sink to a source.
Can be called multiple times to connect multiple sources; in that case, the sink receives data from all connected sources. This function does basically the same thing as Source::connect_to_sink(), only from the opposite point of view.
srcthe source 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 sources.
The sink implementation calls disconnect_from_all_sources().
Does not throw any exceptions.
-
void disconnect_from_all_sources() noexcept
Disconnect from all connected sources.
Severs the connection to all sources. The receive() method will not be called any more.
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
Protected Functions
-
class ReentryProtector
-
inline virtual ~Sink()