A general producer for URPackages. Implements funcionality to produce packages by reading and parsing from a byte stream. More...
#include <producer.h>

Public Member Functions | |
| void | setupProducer () override |
| Triggers the stream to connect to the robot. More... | |
| void | startProducer () override |
| void | stopProducer () override |
| Stops the producer. Currently no functionality needed. More... | |
| void | teardownProducer () override |
| Tears down the producer. Currently no special handling needed. More... | |
| bool | tryGet (std::vector< std::unique_ptr< T >> &products) override |
| Attempts to read byte stream from the robot and parse it as a URPackage. More... | |
| URProducer (URStream< T > &stream, Parser< T > &parser) | |
| Creates a URProducer object, registering a stream and a parser. More... | |
Private Attributes | |
| Parser< T > & | parser_ |
| bool | running_ |
| URStream< T > & | stream_ |
| std::chrono::seconds | timeout_ |
A general producer for URPackages. Implements funcionality to produce packages by reading and parsing from a byte stream.
| HeaderT | Header type of packages to produce. |
Definition at line 40 of file producer.h.
|
inline |
Creates a URProducer object, registering a stream and a parser.
| stream | The stream to read from |
| parser | The parser to use to interpret received byte information |
Definition at line 56 of file producer.h.
|
inlineoverridevirtual |
Triggers the stream to connect to the robot.
Reimplemented from urcl::comm::IProducer< T >.
Definition at line 63 of file producer.h.
|
inlineoverridevirtual |
Reimplemented from urcl::comm::IProducer< T >.
Definition at line 89 of file producer.h.
|
inlineoverridevirtual |
Stops the producer. Currently no functionality needed.
Reimplemented from urcl::comm::IProducer< T >.
Definition at line 84 of file producer.h.
|
inlineoverridevirtual |
Tears down the producer. Currently no special handling needed.
Reimplemented from urcl::comm::IProducer< T >.
Definition at line 77 of file producer.h.
|
inlineoverridevirtual |
Attempts to read byte stream from the robot and parse it as a URPackage.
| products | Unique pointer to hold the produced package |
Implements urcl::comm::IProducer< T >.
Definition at line 101 of file producer.h.
|
private |
Definition at line 44 of file producer.h.
|
private |
Definition at line 47 of file producer.h.
|
private |
Definition at line 43 of file producer.h.
|
private |
Definition at line 45 of file producer.h.