conduit 0.6.0
Modern C++23 header-only event-dispatching / event-transport library
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Functions
event_type_registry.hpp File Reference

Process-wide catalog of conduit event types — name, shape, and display info per type, plus a JSON schema derived from the underlying parcel descriptor. More...

#include <conduit/event.hpp>
#include <conduit/exception.hpp>
#include <concepts>
#include <optional>
#include <shared_mutex>
#include <string>
#include <string_view>
#include <vector>
#include <parcel/parcel.h>
Include dependency graph for event_type_registry.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  conduit::EventTypeInfo
 Identity + shape for one registered event type. More...
 
class  conduit::EventTypeRegistry
 Catalog of conduit event types. More...
 
struct  conduit::EventTypeRegistrar< T >
 Self-registering object: constructing one registers T into global_event_types(). More...
 

Namespaces

namespace  conduit
 

Macros

#define CONDUIT_REGISTER_EVENT(Ident)    inline const ::conduit::EventTypeRegistrar<Ident> conduit_event_type_registrar_##Ident {}
 Register event type Ident into the program-wide global_event_types().
 

Functions

EventTypeRegistryconduit::global_event_types ()
 Program-wide event type catalog.
 
std::vector< EventTypeInfoconduit::registered_event_types ()
 Snapshot of every type registered in the program-wide catalog.
 

Detailed Description

Process-wide catalog of conduit event types — name, shape, and display info per type, plus a JSON schema derived from the underlying parcel descriptor.

This is an introspection facility, distinct from the per-Bus conduit::EventRegistry (serialization.hpp), which is a decode registry. The type registry never decodes wire bytes; it only answers "what event types exist and what do they look like?". It is fully decoupled from Bus: it is populated solely by CONDUIT_REGISTER_EVENT(T) and explicit add<T>(), never by bus register_event/listen/publish.

Mirrors the flag machinery (comms::GlobalFlagRegistry / FlagRegistrar / COMMONS_REGISTER_FLAG): a standalone-usable EventTypeRegistry plus a program-wide singleton reachable via global_event_types().

Macro Definition Documentation

◆ CONDUIT_REGISTER_EVENT

#define CONDUIT_REGISTER_EVENT (   Ident)     inline const ::conduit::EventTypeRegistrar<Ident> conduit_event_type_registrar_##Ident {}

Register event type Ident into the program-wide global_event_types().

Use at namespace scope after the event type is fully defined. Static-init safe (the catalog is a Meyers singleton, built on first use). As with the flag macro, a header-only registrar may be stripped if the type is only ever referenced from headers — pair the macro with a translation unit that uses the type to guarantee the registrar survives.