20#ifndef ORES_EVENTING_SERVICE_EVENT_CHANNEL_REGISTRY_HPP
21#define ORES_EVENTING_SERVICE_EVENT_CHANNEL_REGISTRY_HPP
26#include <unordered_map>
27#include "ores.eventing/domain/event_channel_info.hpp"
28#include "ores.eventing/domain/event_traits.hpp"
72 template<domain::has_event_traits Event>
84 void register_channel(
const std::string& name,
const std::string& description);
91 [[nodiscard]] std::vector<domain::event_channel_info>
get_channels()
const;
99 [[nodiscard]]
bool is_registered(
const std::string& name)
const;
106 [[nodiscard]] std::size_t
size()
const;
109 mutable std::mutex mutex_;
110 std::unordered_map<std::string, domain::event_channel_info> channels_;
Event bus and related services.
Definition event_bus.hpp:33
Traits template for mapping event types to their logical names.
Definition event_traits.hpp:44
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
std::size_t size() const
Get the number of registered channels.
Definition event_channel_registry.cpp:53
bool is_registered(const std::string &name) const
Check if a channel is registered.
Definition event_channel_registry.cpp:48