Toast Engine
Loading...
Searching...
No Matches
signal_proxy.hpp
1#pragma once
2
3#include "toast/reflect/reflect.hpp"
5
6#include <string_view>
7
8struct lua_State;
9
10namespace scripting {
11class SignalProxy {
12public:
13 SignalProxy(toast::Box<toast::Node> source, const toast::SignalInfo& info) : m_source(std::move(source)), m_info(&info) { }
14
15 [[nodiscard]]
16 auto connect(NodeProxy target, std::string_view function, signals::ConnectionSource source, bool forwards_args = true) -> bool;
17
18 [[nodiscard]]
19 auto disconnect(NodeProxy target, signals::ConnectionSource source, std::string_view function) -> bool;
20
21 [[nodiscard]]
22 auto connectSelf(std::string_view function, signals::ConnectionSource source, bool forwards_args = true) -> bool;
23
24 [[nodiscard]]
25 auto disconnectSelf(signals::ConnectionSource source, std::string_view function) -> bool;
26
27 void clear(signals::ConnectionSource source);
28
29 [[nodiscard]]
30 auto fire(lua_State* state) -> bool;
31
32private:
34 const toast::SignalInfo* m_info;
35};
36}
Definition node_proxy.hpp:55
Intrusive reference-counted handle to a Node.
Definition box.hpp:35
Lua-side proxy for a toast::Node.
Definition reflect.hpp:52