Skip to main content
Version: Dev (main)

Library class

Process-wide library state. Library.Init comes first, before any other call of this API; then Runtime.Create, then Runtime.Onboard for a Session.

Namespace: Quaternar.Qaros · Assembly: Quaternar.Qaros.dll

public static class Library

Methods​

MemberDescription
Init(LibraryOptions?)Loads the QAROS runtime (InstalledRuntime: beside the binding, else the runtime of the instance QAR_INSTANCE names, else the installed QAROS, else on PATH) and initializes the library once per process, from a single thread. Calling it again without a Library.Destroy in between may fail. Fails with a "QAROS is not installed" result when no runtime is found, instead of a DllNotFoundException.
Destroy()Frees process-wide state. No other call of this API is allowed afterwards until the next Library.Init.
GetRuntimeInfo()Version, flavor and C API generation of the loaded runtime. Loads the installed runtime first if needed; works before Library.Init.

Init​

Loads the QAROS runtime (InstalledRuntime: beside the binding, else the runtime of the instance QAR_INSTANCE names, else the installed QAROS, else on PATH) and initializes the library once per process, from a single thread. Calling it again without a Library.Destroy in between may fail. Fails with a "QAROS is not installed" result when no runtime is found, instead of a DllNotFoundException.

public static Result<Unit> Init(LibraryOptions? options = null)

Parameters

NameTypeDescription
optionsLibraryOptions

Returns: Result<Unit>

Destroy​

Frees process-wide state. No other call of this API is allowed afterwards until the next Library.Init.

public static Result<Unit> Destroy()

Returns: Result<Unit>

Remarks

It ends every session and subscription still alive, waiting for a subscription handler running on another thread. Dispose your sessions and the runtime first, and never call it from a QAROS callback, event handler or progress report.

GetRuntimeInfo​

Version, flavor and C API generation of the loaded runtime. Loads the installed runtime first if needed; works before Library.Init.

public static Result<RuntimeInfo> GetRuntimeInfo()

Returns: Result<RuntimeInfo>