Template Class IProducer

Inheritance Relationships

Derived Types

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< urcl::rtde_interface::RTDEPackage >, urcl::comm::URProducer< T >

Public Functions

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.