From a280246c3043fc2ea1f50fa695539ac0bec44be1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 8 May 2021 20:16:54 -0400 Subject: Put events in a namespace and simplify their names --- src/event_to_string.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/event_to_string.cpp') diff --git a/src/event_to_string.cpp b/src/event_to_string.cpp index 43c4eb6..4b23875 100644 --- a/src/event_to_string.cpp +++ b/src/event_to_string.cpp @@ -56,22 +56,22 @@ struct EventPrinter { PATCHAGE_UNREACHABLE(); } - std::string operator()(const DriverAttachmentEvent& event) + std::string operator()(const event::DriverAttached& event) { return fmt::format("Attached to {}", (*this)(event.type)); } - std::string operator()(const DriverDetachmentEvent& event) + std::string operator()(const event::DriverDetached& event) { return fmt::format("Detached from {}", (*this)(event.type)); } - std::string operator()(const ClientCreationEvent& event) + std::string operator()(const event::ClientCreated& event) { return fmt::format(R"(Add client "{}" ("{}"))", event.id, event.info.label); } - std::string operator()(const ClientDestructionEvent& event) + std::string operator()(const event::ClientDestroyed& event) { return fmt::format(R"(Remove client "{}")", event.id); } @@ -108,7 +108,7 @@ struct EventPrinter { PATCHAGE_UNREACHABLE(); } - std::string operator()(const PortCreationEvent& event) + std::string operator()(const event::PortCreated& event) { auto result = fmt::format(R"(Add{} {} {} port "{}" ("{}"))", event.info.is_terminal ? " terminal" : "", @@ -124,17 +124,17 @@ struct EventPrinter { return result; } - std::string operator()(const PortDestructionEvent& event) + std::string operator()(const event::PortDestroyed& event) { return fmt::format(R"("Remove port "{}")", event.id); } - std::string operator()(const ConnectionEvent& event) + std::string operator()(const event::PortsConnected& event) { return fmt::format(R"(Connect "{}" to "{}")", event.tail, event.head); } - std::string operator()(const DisconnectionEvent& event) + std::string operator()(const event::PortsDisconnected& event) { return fmt::format(R"(Disconnect "{}" from "{}")", event.tail, event.head); } -- cgit v1.2.1