template<typename Connection>
aes70::device::response_generator_tmpl struct

Contents

This class is used generate responses to AES70 commands (i.e. RPC calls). It is optionally passed to callees.

Public functions

auto get_target_ono() const -> uint32_t
auto get_handle() const -> uint32_t
auto requires_response() const -> bool
auto get_device() const -> decltype(connection.get_device())&
auto allocate(size_t len, OcaStatus status, uint8_t parameterCount = 0) const -> uint8_t*
void send() const
template<typename Encoder, typename T>
auto send_success(uint8_t parameterCount, T&& x) const -> bool
auto send_status(OcaStatus status) const -> bool
void failure(OcaStatus status) const
void success() const
template<typename Encoder, typename T>
void send_property_changed(const OcaPropertyID& prop, const T& val, OcaPropertyChangeType type = OcaPropertyChangeType::CurrentChanged) const

Public variables

Connection& connection

Function documentation

template<typenameConnection>
uint32_t aes70::device::response_generator_tmpl<Connection>::get_target_ono() const

Returns the object number this command is targeted at.

template<typenameConnection>
uint32_t aes70::device::response_generator_tmpl<Connection>::get_handle() const

Returns command handle of this request.

template<typenameConnection>
bool aes70::device::response_generator_tmpl<Connection>::requires_response() const

True if the command expects a response.

template<typenameConnection>
decltype(connection.get_device())& aes70::device::response_generator_tmpl<Connection>::get_device() const

Returns the device.

template<typenameConnection>
uint8_t* aes70::device::response_generator_tmpl<Connection>::allocate(size_t len, OcaStatus status, uint8_t parameterCount = 0) const

Low level method for allocating a buffer for the given response.

template<typenameConnection>
void aes70::device::response_generator_tmpl<Connection>::send() const

Send the response previously allocated.

template<typenameConnection> template<typename Encoder, typename T>
bool aes70::device::response_generator_tmpl<Connection>::send_success(uint8_t parameterCount, T&& x) const

Template parameters
Encoder - The OCP1 encoder to use, e.g. OCP1::OcaString.
T - The type of the return values. Has to be compatible with Encoder.
Parameters
parameterCount - The number of return values.
x - The return value(s).

Send a response.

template<typenameConnection>
bool aes70::device::response_generator_tmpl<Connection>::send_status(OcaStatus status) const

Respond with the given status and no return values.

template<typenameConnection>
void aes70::device::response_generator_tmpl<Connection>::failure(OcaStatus status) const

An alias for send_status().

template<typenameConnection>
void aes70::device::response_generator_tmpl<Connection>::success() const

Respond with OcaStatus::OK and no return values.

template<typenameConnection> template<typename Encoder, typename T>
void aes70::device::response_generator_tmpl<Connection>::send_property_changed(const OcaPropertyID& prop, const T& val, OcaPropertyChangeType type = OcaPropertyChangeType::CurrentChanged) const

Template parameters
Encoder - The OCP1 encoder for the property.
T - The type of the value. Has to be supported with Encoder.
Parameters
prop - The property which changed.
val - The value of the property.
type - The type of what changed, defaults to OcaPropertyChangeType::CurrentChanged.

Send a property changed event, usually in response to a setter having been called.

Variable documentation

template<typenameConnection>
Connection& aes70::device::response_generator_tmpl<Connection>::connection

The connection which initiated the call and on which the response will be sent.