hdk-grid 0.0.1
Header-only foundational library for the Hollow Development Kit.
Loading...
Searching...
No Matches
Tap Class Reference

RAII handle for managing event subscription lifetime. More...

Detailed Description

RAII handle for managing event subscription lifetime.

Tap objects represent an active subscription to an event. They use move semantics and automatically unsubscribe when moved-from or destroyed. This ensures callbacks are properly cleaned up without manual management.

Features:

  • Move-only semantics (non-copyable)
  • Automatic unsubscription on destruction
  • Query subscription status with IsActive()
  • Manual unsubscription with Detach()

Example usage:

auto sub = event.Attach([](int value) { std::cout << value << std::endl; });
event.Trigger(42); // Prints: 42
sub.Detach();
event.Trigger(100); // No output - subscription removed
Generic event dispatcher template for publish-subscribe pattern.

The documentation for this class was generated from the following file: