rotor
Event loop friendly C++ actor micro-framework
 
Loading...
Searching...
No Matches
default_stringifier.h
1#pragma once
2
3//
4// Copyright (c) 2019-2024 Ivan Baidakou (basiliscos) (the dot dmol at gmail dot com)
5//
6// Distributed under the MIT Software License
7//
8
9#include "../messages.hpp"
10#include "../message_stringifier.h"
11
12#if defined(_MSC_VER)
13#pragma warning(push)
14#pragma warning(disable : 4251)
15#endif
16
17namespace rotor {
18
19struct subscription_point_t;
20
21namespace misc {
22
36 protected message_visitor_t,
65 void stringify_to(std::ostream &, const message_base_t &) const override;
66 bool try_visit(const message_base_t &message, void *context) const override;
67
68 private:
69 void on(const message::unsubscription_t &, void *) override;
70 void on(const message::unsubscription_external_t &, void *) override;
71 void on(const message::subscription_t &, void *) override;
72 void on(const message::external_subscription_t &, void *) override;
73 void on(const message::commit_unsubscription_t &, void *) override;
74 void on(const message::handler_call_t &, void *) override;
75 void on(const message::init_request_t &, void *) override;
76 void on(const message::init_response_t &, void *) override;
77 void on(const message::start_trigger_t &, void *) override;
78 void on(const message::shutdown_trigger_t &, void *) override;
79 void on(const message::shutdown_request_t &, void *) override;
80 void on(const message::shutdown_response_t &, void *) override;
81 void on(const message::create_actor_t &, void *) override;
82 void on(const message::spawn_actor_t &, void *) override;
83 void on(const message::registration_request_t &, void *) override;
84 void on(const message::registration_response_t &, void *) override;
85 void on(const message::deregistration_notify_t &, void *) override;
86 void on(const message::deregistration_service_t &, void *) override;
87 void on(const message::discovery_request_t &, void *) override;
88 void on(const message::discovery_response_t &, void *) override;
89 void on(const message::discovery_promise_t &, void *) override;
90 void on(const message::discovery_future_t &, void *) override;
91 void on(const message::discovery_cancel_t &, void *) override;
92 void on(const message::link_request_t &, void *) override;
93 void on(const message::link_response_t &, void *) override;
94 void on(const message::unlink_notify_t &, void *) override;
95 void on(const message::unlink_request_t &, void *) override;
96 void on(const message::unlink_response_t &, void *) override;
97};
98
99} // namespace misc
100} // namespace rotor
101
102#if defined(_MSC_VER)
103#pragma warning(pop)
104#endif
Basic namespace for all rotor functionalities.
Definition rotor.hpp:21
Base class for rotor message.
Definition message.h:52
Abstract interface for making textual/string representation of a message.
Definition message_stringifier.h:36
struct visitor_t concrete message type visitor
Definition message.h:96
the generic message meant to hold user-specific payload
Definition message.h:83
Abstract message visitor interface.
Definition message.h:36
Default stringifier of rotor messages.
Definition default_stringifier.h:64
void stringify_to(std::ostream &, const message_base_t &) const override
dumps string representation of a message to output stream
bool try_visit(const message_base_t &message, void *context) const override
returns true if a message has been successfully processed