rotor
Event loop friendly C++ actor micro-framework
 
Loading...
Searching...
No Matches
init_shutdown.h
1#pragma once
2
3//
4// Copyright (c) 2019-2023 Ivan Baidakou (basiliscos) (the dot dmol at gmail dot com)
5//
6// Distributed under the MIT Software License
7//
8
9#include "plugin_base.h"
10
11namespace rotor::plugin {
12
22struct ROTOR_API init_shutdown_plugin_t : public plugin_base_t {
23 using plugin_base_t::plugin_base_t;
24
26 static const std::type_index class_identity;
27
28 const std::type_index &identity() const noexcept override;
29
30 void activate(actor_base_t *actor) noexcept override;
31
33 void on_init(message::init_request_t &message) noexcept;
34
36 void on_shutdown(message::shutdown_request_t &message) noexcept;
37
38 bool handle_shutdown(message::shutdown_request_t *message) noexcept override;
39 bool handle_init(message::init_request_t *message) noexcept override;
40};
41
42} // namespace rotor::plugin
universal primitive of concurrent computation
Definition actor_base.h:47
manages actors init and shutdown procedures
Definition init_shutdown.h:22
static const std::type_index class_identity
Definition init_shutdown.h:26
const std::type_index & identity() const noexcept override
returns pointer, which uniquely identifiess plugin type
base class for all actor plugins
Definition plugin_base.h:23