conduit 0.6.0
Modern C++23 header-only event-dispatching / event-transport library
Loading...
Searching...
No Matches
Public Member Functions | List of all members
conduit::EventTypeRegistry Class Reference

Catalog of conduit event types. More...

#include <event_type_registry.hpp>

Public Member Functions

 EventTypeRegistry ()=default
 
template<typename T >
EventTypeRegistryadd ()
 Register the descriptor for event type T (derived from conduit::Event<T, Name>, hence an ICell-derived cell).
 
std::vector< EventTypeInfotypes () const
 All registered event types (descriptors whose kind starts with event_kind_prefix; parcel builtins are filtered out).
 
std::optional< EventTypeInfofind (const std::string_view name_or_kind) const
 Look up a type by bare name ("order.created") or full kind ("conduit:event:order.created").
 
bool contains (const std::string_view name_or_kind) const
 Whether a type with the given name or kind is registered.
 
parcel::json_t schema (const std::string_view name_or_kind) const
 Per-type JSON schema for the given name or kind.
 

Detailed Description

Catalog of conduit event types.

Wraps a parcel::ParcelRegistry (default constructed, so the builtin field/primitive kinds are present and schema work resolves) behind a std::shared_mutex — shared lock for reads, unique lock for add. Standalone-usable; the process-wide instance is global_event_types().

Constructor & Destructor Documentation

◆ EventTypeRegistry()

conduit::EventTypeRegistry::EventTypeRegistry ( )
default

Member Function Documentation

◆ add()

template<typename T >
EventTypeRegistry & conduit::EventTypeRegistry::add ( )
inline

Register the descriptor for event type T (derived from conduit::Event<T, Name>, hence an ICell-derived cell).

◆ contains()

bool conduit::EventTypeRegistry::contains ( const std::string_view  name_or_kind) const
inline

Whether a type with the given name or kind is registered.

◆ find()

std::optional< EventTypeInfo > conduit::EventTypeRegistry::find ( const std::string_view  name_or_kind) const
inline

Look up a type by bare name ("order.created") or full kind ("conduit:event:order.created").

Returns std::nullopt if unknown.

◆ schema()

parcel::json_t conduit::EventTypeRegistry::schema ( const std::string_view  name_or_kind) const
inline

Per-type JSON schema for the given name or kind.

Exceptions
conduit::UnknownEventTypeErrorif the type is not registered.

◆ types()

std::vector< EventTypeInfo > conduit::EventTypeRegistry::types ( ) const
inline

All registered event types (descriptors whose kind starts with event_kind_prefix; parcel builtins are filtered out).


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