This library provides the foundation for hdk, including core data structures, utilities, and interfaces that other components of the grid will build upon. It serves as the backbone of the system, enabling efficient management of holographic data and interactions.
The SharedPtrWrapper class is a reference-counted wrapper for shared pointers to structures. It provides a mechanism to manage the lifetime of shared resources while allowing for efficient access and caching of shared pointers. The wrapper ensures that shared pointers are properly managed and that resources are released when no longer needed, preventing memory leaks and ensuring efficient memory usage.
The SharedPtrWrapper instances should be able to be used interchangeably with the underlying raw pointers in other C API calls, while still benefiting from the reference counting and caching mechanisms provided by the wrapper.
The PrimitiveWrapper class is a template wrapper for primitive types that provides a consistent interface for getting and setting properties. It allows for easy access to the underlying primitive value while also providing a layer of abstraction that can be useful for managing state and interactions within the grid system. The wrapper can be used to encapsulate primitive values and provide additional functionality, such as validation or transformation, while still allowing for direct access to the underlying value when needed.
hdk::grid::eps::Conduit<Args...> is a thread-safe, type-safe event dispatcher. Attach callbacks with Attach(...); each subscription returns a move-only Tap handle. Fire the event with Trigger(...) or operator(). Callbacks run in attachment order from a snapshot taken under lock, so dispatch happens outside the lock and is safe against callbacks that detach or pause other taps.
Tap supports IsActive(), Detach(), Pause(), Resume(), and IsPaused(). A tap becomes inactive after it is detached or if the underlying conduit is gone.
hdk::grid::eps::TapScope groups multiple taps for bulk management. Add taps with Add(...) or operator<<, pause/resume them together with PauseAll() and ResumeAll(), and disconnect everything with DetachAll(). Its destructor also calls DetachAll(), so any taps still owned by the scope are disconnected automatically. Clear() only forgets the stored taps; the subscriptions stay active until detached elsewhere or the scope is destroyed.
Example usage of hdk::grid::eps::Conduit and Tap:
Example usage of hdk::grid::eps::TapScope to manage multiple groups of taps:
hdk-grid currently has no examples, but it follows the same install-prefix conventions as the rest of HDK.
Under a common install prefix:
Other HDK modules that provide examples install shared assets to assets under the same prefix by default, so all HDK outputs remain co-located.