ORE Studio 0.0.4
Loading...
Searching...
No Matches
Public Member Functions | List of all members
event_channel_registry Class Referencefinal

Registry of available event channels. More...

#include <event_channel_registry.hpp>

Collaboration diagram for event_channel_registry:
Collaboration graph

Public Member Functions

 event_channel_registry (const event_channel_registry &)=delete
 
event_channel_registryoperator= (const event_channel_registry &)=delete
 
 event_channel_registry (event_channel_registry &&)=delete
 
event_channel_registryoperator= (event_channel_registry &&)=delete
 
template<domain::has_event_traits Event>
void register_channel (const std::string &description)
 Register a channel for a typed event.
 
void register_channel (const std::string &name, const std::string &description)
 Register a channel by name.
 
std::vector< domain::event_channel_infoget_channels () const
 Get all registered channels.
 
bool is_registered (const std::string &name) const
 Check if a channel is registered.
 
std::size_t size () const
 Get the number of registered channels.
 

Detailed Description

Registry of available event channels.

Tracks all event channels that clients can subscribe to, along with their descriptions. Channels are registered during application initialization when entity-to-event mappings are configured.

Thread Safety:

Usage:

// Register channels during initialization
registry.register_channel<currency_changed_event>("Currency data modified");
// Later, query available channels
auto channels = registry.get_channels();
Registry of available event channels.
Definition event_channel_registry.hpp:54
void register_channel(const std::string &description)
Register a channel for a typed event.
Definition event_channel_registry.hpp:73
std::vector< domain::event_channel_info > get_channels() const
Get all registered channels.
Definition event_channel_registry.cpp:32

Member Function Documentation

◆ register_channel() [1/2]

template<domain::has_event_traits Event>
void register_channel ( const std::string &  description)

Register a channel for a typed event.

Uses event_traits to get the channel name automatically.

Template Parameters
EventThe domain event type (must have event_traits specialization).
Parameters
descriptionHuman-readable description of the channel.
Here is the caller graph for this function:

◆ register_channel() [2/2]

void register_channel ( const std::string &  name,
const std::string &  description 
)

Register a channel by name.

Parameters
nameThe channel name (e.g., "ores.refdata.currency_changed").
descriptionHuman-readable description of the channel.

◆ get_channels()

std::vector< domain::event_channel_info > get_channels ( ) const

Get all registered channels.

Returns
Vector of event channel info, sorted by name.

◆ is_registered()

bool is_registered ( const std::string &  name) const

Check if a channel is registered.

Parameters
nameThe channel name to check.
Returns
true if the channel is registered.

◆ size()

std::size_t size ( ) const

Get the number of registered channels.

Returns
The count of registered channels.