Class PrimaryPackage

Inheritance Relationships

Base Type

Derived Types

Class Documentation

class PrimaryPackage : public urcl::comm::URPackage<PackageHeader>

The PrimaryPackage is solely an abstraction level. It inherits form the URPackage and is also a parent class for primary_interface::RobotMessage, primary_interface::RobotState.

Subclassed by urcl::primary_interface::RobotMessage, urcl::primary_interface::RobotState

Public Functions

inline PrimaryPackage()

Creates a new PrimaryPackage object.

virtual ~PrimaryPackage() = default
virtual bool parseWith(comm::BinParser &bp)

Sets the attributes of the package by parsing a serialized representation of the package.

Parameters:

bp – A parser containing a serialized version of the package

Returns:

True, if the package was parsed successfully, false otherwise

virtual bool consumeWith(AbstractPrimaryConsumer &consumer) = 0

Consume this package with a specific consumer. This should be overwritten in inherited packages.

Parameters:

consumer – Placeholder for the consumer calling this

Returns:

true on success

virtual std::string toString() const

Produces a human readable representation of the package object.

Returns:

A string representing the object

Protected Attributes

std::unique_ptr<uint8_t[]> buffer_
size_t buffer_length_