removed namespace interface

This commit is contained in:
Sascha Kühl
2025-08-11 16:59:16 +02:00
parent 2e2fcd01b6
commit 789be1174b
12 changed files with 247 additions and 101 deletions
+5 -2
View File
@@ -14,7 +14,7 @@ std::type_index message::type() const {
return type_;
}
const void * message::msg_ptr() const {
const void * message::raw_ptr() const {
return owner_ ? owner_.get() : ptr_;
}
@@ -49,6 +49,9 @@ bool subscription::valid() const {
return bus_ != nullptr;
}
message_bus::message_bus()
: next_id_{1} {}
void message_bus::unsubscribe(const std::type_index type, HandlerId id) {
std::unique_lock writeLock(mutex_);
const auto it = handlers_.find(type);
@@ -89,7 +92,7 @@ void message_bus::publish(const message &msg) const {
}
snapshot = it->second;
}
const void* p = msg.msg_ptr();
const void* p = msg.raw_ptr();
for (const auto &e : snapshot) {
if (!e.filter || e.filter(p)) e.handler(p);
}