Home /Modules/os-level-support/SLOsRuntimeStatus.sleela

SLOsRuntimeStatus.sleela

lib/os-level-support/SLOsRuntimeStatus.sleela · 85 line(s) · sleela

<< SLeeLa Standard Library Definition.
  Definition: Status values for the in-process OS-support runtime (event-hook
  registry and cooperative task queue). These numeric values match the
  slosh_status enum in lib/os-level-support/include/sleela_os_support.h and the
  osls_runtime_status enum in os-level-support/runtime/osls_runtime.h. This is a
  distinct status space from the core osls_* ABI (see SLOsSupportStatus): the
  runtime adds OUT_OF_MEMORY, CAPACITY, BUSY and CALLBACK_FAILED and has no
  BUFFER_TOO_SMALL, SYSTEM_ERROR or UNSUPPORTED value. >>
#sleela 2.5
material;

class SLOsRuntimeStatus {
  < ---- Descriptive metadata (version 1.11 nested-friendly accessors) ---- >
  << Eleven catalogued attributes with getter/setter pairs, so a GUI, loader,
     or catalog can read and (where appropriate) override each record.
     Values are faithful to the subject's real origin where publicly known. >>
  String metaVersion = "1.0.0";
  int metaId = 0;
  String metaAuthor = "mearvk";
  String metaDate = "2026-11-05";
  String metaCopyright = "Copyright mearvk LLC";
  String metaTrademark = "none";
  String metaCorporation = "mearvk LLC";
  < metaOrigin: National | <nation> | International | Galactic >
  String metaOrigin = "International";
  String metaBirthDate = "2026-11-05";
  < metaScienceRating: maturity/robustness on a 1..10 scale >
  int metaScienceRating = 8;
  < metaNationalSchedule: a real, citable instrument or "none" >
  String metaNationalSchedule = "none";

  String getMetaVersion() { return metaVersion; }
  void setMetaVersion(String value) { metaVersion = value; }
  int getMetaId() { return metaId; }
  void setMetaId(int value) { metaId = value; }
  String getMetaAuthor() { return metaAuthor; }
  void setMetaAuthor(String value) { metaAuthor = value; }
  String getMetaDate() { return metaDate; }
  void setMetaDate(String value) { metaDate = value; }
  String getMetaCopyright() { return metaCopyright; }
  void setMetaCopyright(String value) { metaCopyright = value; }
  String getMetaTrademark() { return metaTrademark; }
  void setMetaTrademark(String value) { metaTrademark = value; }
  String getMetaCorporation() { return metaCorporation; }
  void setMetaCorporation(String value) { metaCorporation = value; }
  String getMetaOrigin() { return metaOrigin; }
  void setMetaOrigin(String value) { metaOrigin = value; }
  String getMetaBirthDate() { return metaBirthDate; }
  void setMetaBirthDate(String value) { metaBirthDate = value; }
  int getMetaScienceRating() { return metaScienceRating; }
  void setMetaScienceRating(int value) { metaScienceRating = value; }
  String getMetaNationalSchedule() { return metaNationalSchedule; }
  void setMetaNationalSchedule(String value) { metaNationalSchedule = value; }

  < Runtime status values (slosh_status / osls_runtime_status). >
  int OK = 0;
  int INVALID_ARGUMENT = 1;
  int OUT_OF_MEMORY = 2;
  int CAPACITY = 3;
  int NOT_FOUND = 4;
  int BUSY = 5;
  int CALLBACK_FAILED = 6;

  int getOK() { return OK; }
  int getInvalidArgument() { return INVALID_ARGUMENT; }
  int getOutOfMemory() { return OUT_OF_MEMORY; }
  int getCapacity() { return CAPACITY; }
  int getNotFound() { return NOT_FOUND; }
  int getBusy() { return BUSY; }
  int getCallbackFailed() { return CALLBACK_FAILED; }

  boolean isOK(int status) { return status == OK; }

  String describe(int status) {
    if (status == OK) { return "SLOSH_OK"; }
    if (status == INVALID_ARGUMENT) { return "SLOSH_INVALID_ARGUMENT"; }
    if (status == OUT_OF_MEMORY) { return "SLOSH_OUT_OF_MEMORY"; }
    if (status == CAPACITY) { return "SLOSH_CAPACITY"; }
    if (status == NOT_FOUND) { return "SLOSH_NOT_FOUND"; }
    if (status == BUSY) { return "SLOSH_BUSY"; }
    if (status == CALLBACK_FAILED) { return "SLOSH_CALLBACK_FAILED"; }
    return "SLOSH_UNKNOWN";
  }
}