Skip to content

OcaAgent#

This document describes the controller implementation of OcaAgent. This class is documented in the AES70 standard as:

Abstract base class for defining agents.


Overview#

Class Declaration#

namespace aes70::controller
{
  class OcaAgent : public OcaRoot
  {
  public:
    OcaAgent(std::shared_ptr<connection> connection,
            uin32_t object_number);
    OcaAgent(const OcaAgent &o);

    // Control Methods
    // Calls GetLabel and calls on_result or on_failure
    void GetLabel(auto on_result, failure_callback on_failure);
    // Calls SetLabel and calls on_result or on_failure
    void SetLabel(OcaString Label, auto on_result, failure_callback on_failure);
    // Calls SetLabel and does not wait for the response
    void SetLabel(OcaString Label);
    // Calls GetOwner and calls on_result or on_failure
    void GetOwner(auto on_result, failure_callback on_failure);
    // Calls GetPath and calls on_result or on_failure
    void GetPath(auto on_result, failure_callback on_failure);

    // Observing Properties
    subscription observeLabel(auto callback, failure_callback on_failure);

    // Property Changed Subscriptions
    subscription OnLabelChanged(auto callback, failure_callback on_failure);
  };
}

Methods#

GetLabel#

void GetLabel(auto on_result, failure_callback on_failure)

Calls the method GetLabel in the remote device.

Parameters:#

  • auto on_result: A callable (e.g. a lambda) with the following arguments:
    • OcaString Label
  • failure_callback on_failure: A callback which is called on error.

SetLabel#

void SetLabel(OcaString Label, auto on_result, failure_callback on_failure)

Calls the method SetLabel in the remote device. If no result and error callback is specified, the method will be called without requesting a response.

Parameters:#

  • OcaString Label
  • auto on_result: A callable (e.g. a lambda) with 0 arguments.
  • failure_callback on_failure: A callback which is called on error.

GetOwner#

void GetOwner(auto on_result, failure_callback on_failure)

Calls the method GetOwner in the remote device.

Parameters:#

  • auto on_result: A callable (e.g. a lambda) with the following arguments:
    • OcaONo Owner
  • failure_callback on_failure: A callback which is called on error.

GetPath#

void GetPath(auto on_result, failure_callback on_failure)

Calls the method GetPath in the remote device.

Parameters:#

  • auto on_result: A callable (e.g. a lambda) with the following arguments:
    • OcaRolePath RolePath
    • OcaONoPath ONoPath
  • failure_callback on_failure: A callback which is called on error.

observeLabel#

subscription observeLabel(auto callback, failure_callback on_failure)

Fetches the remote property Label and subscribes for modifications. The callback is called with the initial values of Label and whenever it changes.

Parameters:#

  • auto callback: A callable (e.g. a lambda) with one argument: OcaString Label
  • failure_callback on_failure: A callback which is called on error.

OnLabelChanged#

subscription OnLabelChanged(auto callback, failure_callback on_failure)

Parameters#

  • auto callback: A callable (e.g. a lambda) with one argument: OcaString Label
  • failure_callback on_failure: A callback which is called on error.