9#include "plugin_base.h"
14#pragma warning(disable : 4251)
17namespace rotor::plugin {
19using resource_id_t = std::size_t;
40 using plugin_base_t::plugin_base_t;
45 const std::type_index &
identity() const noexcept override;
48 bool handle_init(message::init_request_t *message) noexcept override;
49 bool handle_shutdown(message::shutdown_request_t *message) noexcept override;
56 virtual
void acquire(resource_id_t = 0) noexcept;
64 virtual
bool release(resource_id_t = 0) noexcept;
71 virtual std::uint32_t has(resource_id_t = 0) noexcept;
74 virtual
bool has_any() noexcept;
77 template <typename T> auto &access() noexcept;
80 using Resources = std::vector<std::uint32_t>;
82 bool configured = false;
universal primitive of concurrent computation
Definition actor_base.h:47
base class for all actor plugins
Definition plugin_base.h:23
"lock" for external resources
Definition resources.h:39
static const std::type_index class_identity
Definition resources.h:43
const std::type_index & identity() const noexcept override
returns pointer, which uniquely identifiess plugin type