SessionBase
↳ extends Closeable
Declaration
abstract class SessionBase<T : SessionBase<T>>Summary
Base class of NSDK's feature sessions: a reference-counted handle on one native feature.
Threading: call [acquire] and [close] on the main thread. Each feature's native creation
method is annotated @MainThread, but the annotation is on a private member, so lint does not
check callers of [acquire]; NSDK is only tested with acquisition on the main thread. A
feature's other methods can be called from any thread, and its Flows deliver values in the
collector's own context.
Properties
| Name | Type | Summary |
|---|---|---|
| isAlive | Boolean | True while this session has been acquired and not yet fully closed. |
Functions
| Name | Type | Summary |
|---|---|---|
| acquire | T | - |
| close | void | - |
| abstract onDestroy | void | Subclasses implement cleanup |
| abstract onInit | void | - |
| onStopBeforeDestroy | void | Stops the native feature, for a session that can be started. Called before [onDestroy]: NSDK's core aborts the process when it destroys a feature that is still started, as when an app calls close() on a started session without stop(). Stopping a feature that is not started does nothing. |
Relationships
derived: SceneSegmentationSession
derived: DashcamSession
derived: DepthSession
derived: DeviceMappingSession
derived: MappingStorageSession
derived: MeshDownloaderSession
derived: MeshingSession
derived: PlaybackCacheSession
derived: RecordingExporter
derived: ScanningSession
derived: SitesSession
derived: Vps2Session