Skip to content

Commit

Permalink
meta: Update chatty
Browse files Browse the repository at this point in the history
  • Loading branch information
sleepy-monax committed Mar 10, 2024
1 parent 1e335f3 commit 0245c61
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
22 changes: 11 additions & 11 deletions src/srvs/grund-device/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct IClient {
template <typename T>
struct _Client;

auto _dispatch(auto, auto, auto);
auto _dispatch(auto &);

virtual ~IClient() = default;

Expand All @@ -26,7 +26,7 @@ struct IHost {
template <typename T>
struct _Client;

auto _dispatch(auto, auto, auto);
auto _dispatch(auto &);

virtual ~IHost() = default;

Expand Down Expand Up @@ -63,34 +63,34 @@ struct IHost::_Client : public IHost {
}
};

auto IClient::_dispatch(auto mid, auto call, auto error) {
switch (mid) {
auto IClient::_dispatch(auto &o) {
switch (o.mid) {

case event_UID:
return call<ClientEvent()>([&]<typename... Args>(Args &&...args) {
return o.template call<ClientEvent>([&]<typename... Args>(Args &&...args) {
return event(std::forward<Args>(args)...);
});

default:
return error();
return o.error();
}
}

auto IHost::_dispatch(auto mid, auto call, auto error) {
switch (mid) {
auto IHost::_dispatch(auto &o) {
switch (o.mid) {

case bubble_UID:
return call<HostEvent()>([&]<typename... Args>(Args &&...args) {
return o.template call<HostEvent>([&]<typename... Args>(Args &&...args) {
return bubble(std::forward<Args>(args)...);
});

case flip_UID:
return call<Vec<Math::Recti>()>([&]<typename... Args>(Args &&...args) {
return o.template call<Vec<Math::Recti>>([&]<typename... Args>(Args &&...args) {
return flip(std::forward<Args>(args)...);
});

default:
return error();
return o.error();
}
}

Expand Down
10 changes: 5 additions & 5 deletions src/srvs/grund-system/api.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct IBus {
template <typename T>
struct _Client;

auto _dispatch(auto, auto, auto);
auto _dispatch(auto &);

virtual ~IBus() = default;

Expand All @@ -30,16 +30,16 @@ struct IBus::_Client : public IBus {
}
};

auto IBus::_dispatch(auto mid, auto call, auto error) {
switch (mid) {
auto IBus::_dispatch(auto &o) {
switch (o.mid) {

case broadcast_UID:
return call<>([&]<typename... Args>(Args &&...args) {
return o.template call<>([&]<typename... Args>(Args &&...args) {
return broadcast(std::forward<Args>(args)...);
});

default:
return error();
return o.error();
}
}

Expand Down

0 comments on commit 0245c61

Please sign in to comment.