rotor
Event loop friendly C++ actor micro-framework
 
Loading...
Searching...
No Matches
supervisor_config_wx.h
1#pragma once
2
3//
4// Copyright (c) 2019-2022 Ivan Baidakou (basiliscos) (the dot dmol at gmail dot com)
5//
6// Distributed under the MIT Software License
7//
8
9#include "rotor/supervisor_config.h"
10#include <wx/event.h>
11
12namespace rotor {
13namespace wx {
14
31 wxEvtHandler *handler;
32
33 using supervisor_config_t::supervisor_config_t;
34};
35
37template <typename Supervisor> struct supervisor_config_wx_builder_t : supervisor_config_builder_t<Supervisor> {
39 using builder_t = typename Supervisor::template config_builder_t<Supervisor>;
40
44
46 constexpr static const std::uint32_t EVT_LOOP = 1 << 2;
47
49 constexpr static const std::uint32_t requirements_mask = parent_t::requirements_mask | EVT_LOOP;
50
52 builder_t &&handler(wxEvtHandler *handler_) && {
53 parent_t::config.handler = handler_;
54 parent_t::mask = (parent_t::mask & ~EVT_LOOP);
55 return std::move(*static_cast<builder_t *>(this));
56 }
57};
58
59} // namespace wx
60} // namespace rotor
Basic namespace for all rotor functionalities.
Definition rotor.hpp:21
config_t config
the currently build config
Definition actor_config.h:128
static constexpr const std::uint32_t requirements_mask
bit mask for all required fields
Definition actor_config.h:116
std::uint32_t mask
required fields mask (used for validation)
Definition actor_config.h:131
CRTP supervisor config builder.
Definition supervisor_config.h:72
base supervisor config, which holds shutdown timeout value
Definition supervisor_config.h:23
config builder for wx supervisor
Definition supervisor_config_wx.h:37
static constexpr const std::uint32_t requirements_mask
bit mask for all required fields
Definition supervisor_config_wx.h:49
static constexpr const std::uint32_t EVT_LOOP
bit mask for event handler validation
Definition supervisor_config_wx.h:46
typename Supervisor::template config_builder_t< Supervisor > builder_t
final builder class
Definition supervisor_config_wx.h:39
builder_t && handler(wxEvtHandler *handler_) &&
sets event handler
Definition supervisor_config_wx.h:52
wx supervisor config, which holds a pointer to the "context window".
Definition supervisor_config_wx.h:18
wxEvtHandler * handler
the wx context, responsible for messages delivery
Definition supervisor_config_wx.h:31