aes70::device::connection class

Pure virtual connection base class.

Public functions

auto get_id() const -> size_t
void set_id(size_t id)
auto has_subscription(const OcaEvent& id) const -> bool pure virtual
auto add_subscription(const OcaEvent& id, const OcaMethod& method) -> bool pure virtual
void remove_subscription(const OcaEvent& id) pure virtual
auto allocate_response(uint32_t handle, size_t len, OcaStatus status, uint8_t parameterCount) -> uint8_t*
auto allocate_notification(const OcaEvent& event, size_t len, uint8_t parameterCount) -> uint8_t*

Protected functions

auto find_subscription(const OcaEvent& id) const -> const Subscription* pure virtual

Function documentation

size_t aes70::device::connection::get_id() const

Returns the (unique) identifier of this connection.

void aes70::device::connection::set_id(size_t id)

Sets the connection identifier.

bool aes70::device::connection::has_subscription(const OcaEvent& id) const pure virtual

Returns true if this connection has a subscription for the given event.

bool aes70::device::connection::add_subscription(const OcaEvent& id, const OcaMethod& method) pure virtual

Add a subscription.

void aes70::device::connection::remove_subscription(const OcaEvent& id) pure virtual

Remove a subscription.

uint8_t* aes70::device::connection::allocate_response(uint32_t handle, size_t len, OcaStatus status, uint8_t parameterCount)

Allocate a response packet. Either returns a pointer to the position in the allocated buffer space where the arguments should be written to OR nullptr on allocation failure.

uint8_t* aes70::device::connection::allocate_notification(const OcaEvent& event, size_t len, uint8_t parameterCount)

Allocate a notification packet. Either returns a pointer to the position in the allocated buffer space where the arguments should be written to OR nullptr. If the return value is nullptr, either this connection has not subscribed the given event OR there was an allocation failure.

\fixme this makes no sense, remove the find_subscription check.

const Subscription* aes70::device::connection::find_subscription(const OcaEvent& id) const pure virtual protected

Returns a subscription for the given OcaEvent, or nullptr if no subscription exists.