MultiEventSink.hpp

1. Overview

The MultiEventSink.hpp header declares a simple fan-out sink that forwards each RootGuard event to multiple downstream IEventSink instances.

The file integrates the following components, APIs, or runtime concepts:

  • IEventSink – common sink interface
  • std::reference_wrapper – non-owning downstream sink storage

2. Sink Registration

add(IEventSink&) stores a non-owning reference to a sink. The caller must ensure every registered sink outlives the MultiEventSink.


3. Event Fan-Out

onEvent() iterates the registered sinks in insertion order and forwards the same immutable event to each one.


4. Runtime and Security Considerations

  • Failure isolation: the source implementation catches exceptions from each individual sink so one broken output does not prevent other outputs.
  • Non-owning composition: lifetime management remains explicit in the daemon entry point.