Template Class MultiConsumer

Inheritance Relationships

Base Type

Class Documentation

template<typename T>
class MultiConsumer : public urcl::comm::IConsumer<T>

Consumer, that allows one product to be consumed by multiple arbitrary consumers.

Template Parameters:

T – Type of the consumed products

Public Functions

inline MultiConsumer(std::vector<std::shared_ptr<IConsumer<T>>> consumers)

Creates a new MultiConsumer object.

Parameters:

consumers – The list of consumers that should all consume given products

inline void addConsumer(std::shared_ptr<IConsumer<T>> consumer)

Adds a new consumer to the list of consumers.

Parameters:

consumer – Consumer that should be added to the list

inline void removeConsumer(std::shared_ptr<IConsumer<T>> consumer)

Remove a consumer from the list of consumers.

Parameters:

consumer – Consumer that should be removed from the list

inline virtual void setupConsumer()

Sets up all registered consumers.

inline virtual void teardownConsumer()

Tears down all registered consumers.

inline virtual void stopConsumer()

Stops all registered consumers.

inline virtual void onTimeout()

Triggers timeout functionality for all registered consumers.

inline virtual bool consume(std::shared_ptr<T> product)

Consumes a given product with all registered consumers.

Parameters:

product – Shared pointer to the product to be consumed.

Returns:

Success of the consumption.