API referenceVetraGlove ProC++

Lifecycle and resource cleanup

General reference

Current version · 2.0.0

Lifecycle and scope

ObjectMethodScope and behavior
Sdkstart()Connects and starts all enabled devices and capabilities that are not yet closed, in configuration order; states that are already satisfied can be called again
Sdkupdate()Performs one manual update of the entire SDK and returns a one-shot wait result
Sdkrun_forever() / run_background()Runs the entire SDK in foreground or background mode; both modes are mutually exclusive with manual update
Sdkrequest_stop() / join()Requests the current run loop to stop; join() waits for the background run to finish and reports background errors
Sdkstop()Stops all started capabilities and data streams, then disconnects all connected devices; start() can be called again afterwards
Sdkhealth()Returns the aggregated health status of all devices and capabilities that are not closed
Sdkclose()Requests stop, waits for the run to finish, cleans up subscriptions, and releases all SDK resources; after complete cleanup, repeated calls are a no-op
Glovestart() / stop()Acts only on all enabled gloves that are not yet closed
Gloveupdate() / run_forever() / run_background()Handles glove data only; the run mode rules are the same as for Sdk
Gloverequest_stop() / join() / health()Stops or observes the glove run state without affecting other SDK capabilities
Gloveclose()Stops and closes all configured gloves; the Sdk itself can still be used for other capabilities that are not closed
GloveDevicestart() / stop()Acts only on the selected physical glove; does not change the state of other devices
GloveDevicepush_frame()Only allows an external connection to submit one input frame while connected and started

Closing and resource cleanup

Lifecycle failures report LifecycleError, while features unavailable for the current device or configuration report UnavailableFeatureError; do not catch only WorkflowError.

An explicit close() is the primary cleanup method; destruction only provides a non-throwing last resort.

Glove::close() reclaims subscriptions that are still valid. The application only needs to keep the corresponding Subscription objects alive; there is no need to unsubscribe them one by one before the final close. Call subscription.unsubscribe() explicitly only when the owning object keeps running but a single callback needs to be stopped early.

Do not synchronously call unsubscribe() on, or destroy, that subscription from inside its own callback.

Finite tasks call Glove::close() when the normal path ends; background mode calls request_stop() and join() first. Glove::close() stops and closes all configured gloves, and Sdk::close() closes the remaining capabilities and releases the entire SDK. After a successful close, repeated calls are a no-op.

The destructors of Subscription, Glove, and Sdk still provide an RAII fallback, but they cannot replace an explicit close(), because destruction cannot reliably report cleanup failures. Also do not destroy the last Sdk object inside a callback; leave cleanup to the application control path outside the callback.

Sdk, Glove, and GloveDevice still provide connect() and disconnect(). connect() is kept only for compatibility with old code and does not open devices; disconnect() is equivalent to stop(). New code should use start() and stop() directly.