Template Class IProducer
Defined in File pipeline.h
Inheritance Relationships
Derived Type
public urcl::comm::URProducer< T >(Template Class URProducer)
Class Documentation
-
template<typename T>
class IProducer Parent class for arbitrary producers of packages.
- Template Parameters:
T – Type of the produced products
Subclassed by urcl::comm::URProducer< T >
Public Functions
-
virtual ~IProducer() = default
-
inline virtual void setupProducer(const size_t max_num_tries = 0, const std::chrono::milliseconds reconnection_time = std::chrono::seconds(10))
Set-up functionality of the producers.
- Parameters:
max_num_tries – Maximum number of connection attempts before counting the connection as failed. Unlimited number of attempts when set to 0.
reconnection_time – time in between connection attempts to the server
-
inline virtual void teardownProducer()
Fully tears down the producer - by default no difference to stopping it.
-
inline virtual void stopProducer()
Stops the producer.
-
inline virtual void startProducer()
-
virtual bool tryGet(std::vector<std::unique_ptr<T>> &products) = 0
Reads packages from some source and produces corresponding objects.
- Parameters:
products – Vector of unique pointers to be filled with produced packages.
- Returns:
Success of the package production.
-
virtual bool tryGet(std::unique_ptr<T> &product) = 0
Reads a single package from some source and produces the corresponding object.
If possible this function should try to reuse existing memory in the passed unique pointer.
- Parameters:
product – Unique pointer to be set to the produced package.
- Returns:
Success of the package production.