Skip to content

OcaProgram#

This document describes the device side implementation of OcaProgram. This class is documented in the AES70 standard as:

A Program. Child of OcaDataset.

Execution:

A program executes in a task. Tasks may be explicitly created by OcaTaskManager2, or they may be implicitly created at execution time. The execution task may be explicitly specified, by giving its task ID, or automatically created by the device.

In either case, the given task ID parameter will be updated by the Run() or Schedule() method call to reflect the task actually assigned to the run.

Once a task is set up, subscribing controllers will receive notifications about changes in its status from OcaTaskManager2.

As well, running tasks can be controlled using OcaTaskManager2 methods.

Running and scheduling methods are as follows: Run(...) starts execution, then returns immediately., Schedule(...) schedules execution, then returns immediately., RunWait(...) starts execution, but does not return until execution terminates., ScheduleWait(...) schedules execution, but does not return until execution termiantes.

If execution is invoked via Run(...) or Schedule(...), OcaTaskManager2 will raise a CommandSetTerminated event when execution terminates. If execution is invoked via RunWait(...) or ScheduleWait(...), termination information is returned by the method, and no such event is raised.


Overview#

Class Declaration#

The device side implementation has the following signature.

namespace aes70::device
{
  template <class Implementation>
  class OcaProgram : public OcaDataset<Implementation>
  {

  };
}

The template argument Implementation may implement the following methods.

Note

The signatures given here are just one possibility and that most methods are optional. Implement only those methods which make sense in the context of your device. See the documentation in Implementing AES70 Classes for more details.

class MyOcaProgramImplementation
{
  // Methods defined by OcaProgram
  OcaList<OcaProgramRunMode> GetSupportedRunModes();
  void SetSupportedRunModes(OcaList<OcaProgramRunMode> RunModes);

  // Methods defined by OcaDataset
  std::tuple<OcaUint64,OcaIOSessionHandle> OpenRead(OcaLockState RequestedLockState);
  std::tuple<OcaUint64,OcaIOSessionHandle> OpenWrite(OcaLockState RequestedLockState);
  void Close(OcaIOSessionHandle Handle);
  std::tuple<OcaBoolean,OcaLongBlob> Read(OcaIOSessionHandle Handle, OcaUint64 Position, OcaUint64 PartSize);
  void Write(OcaIOSessionHandle Handle, OcaUint64 Position, OcaLongBlob Part);
  void Clear(OcaIOSessionHandle Handle);
  OcaONo GetOwner();
  OcaString GetName();
  void SetName(OcaString Name);
  OcaString GetType();
  void SetType(OcaString Type);
  OcaBoolean GetReadOnly();
  void SetReadOnly(OcaBoolean ReadOnly);
  OcaTime GetLastModificationTime();
  std::tuple<OcaUint64,OcaUint64> GetDatasetSizes();

  // Methods defined by OcaRoot
  OcaBoolean GetLockable();
  void SetLockNoReadWrite();
  void Unlock();
  OcaString GetRole();
  void SetLockNoWrite();
  OcaLockState GetLockState();

};

Events#