diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-12-03 10:26:47 +0100 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-12-03 10:26:47 +0100 |
commit | 307fd830eb168005a3ba3d557343284814757eff (patch) | |
tree | eb14512492d58e33585bc5df3f3d9b23d7308934 /src/keeper.hpp | |
parent | ca7657e24549acb8a2dd45fa81c309b5bf9f61ee (diff) | |
download | lanes-307fd830eb168005a3ba3d557343284814757eff.tar.gz lanes-307fd830eb168005a3ba3d557343284814757eff.tar.bz2 lanes-307fd830eb168005a3ba3d557343284814757eff.zip |
New method linda:restrict()
Diffstat (limited to 'src/keeper.hpp')
-rw-r--r-- | src/keeper.hpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/keeper.hpp b/src/keeper.hpp index b77f1a9..e2ad445 100644 --- a/src/keeper.hpp +++ b/src/keeper.hpp | |||
@@ -13,6 +13,15 @@ DECLARE_UNIQUE_TYPE(KeeperIndex, int); | |||
13 | 13 | ||
14 | // ################################################################################################# | 14 | // ################################################################################################# |
15 | 15 | ||
16 | enum class LindaRestrict | ||
17 | { | ||
18 | None, | ||
19 | SetGet, | ||
20 | SendReceive | ||
21 | }; | ||
22 | |||
23 | // ################################################################################################# | ||
24 | |||
16 | struct Keeper | 25 | struct Keeper |
17 | { | 26 | { |
18 | std::mutex mutex; | 27 | std::mutex mutex; |
@@ -79,6 +88,9 @@ DECLARE_UNIQUE_TYPE(KeeperCallResult, std::optional<int>); | |||
79 | // xxh64 of string "kNilSentinel" generated at https://www.pelock.com/products/hash-calculator | 88 | // xxh64 of string "kNilSentinel" generated at https://www.pelock.com/products/hash-calculator |
80 | static constexpr UniqueKey kNilSentinel{ 0xC457D4EDDB05B5E4ull, "lanes.null" }; | 89 | static constexpr UniqueKey kNilSentinel{ 0xC457D4EDDB05B5E4ull, "lanes.null" }; |
81 | 90 | ||
91 | // xxh64 of string "kRestrictedChannel" generated at https://www.pelock.com/products/hash-calculator | ||
92 | static constexpr UniqueKey kRestrictedChannel{ 0x4C8B879ECDE110F7ull }; | ||
93 | |||
82 | using keeper_api_t = lua_CFunction; | 94 | using keeper_api_t = lua_CFunction; |
83 | #define KEEPER_API(_op) keepercall_##_op | 95 | #define KEEPER_API(_op) keepercall_##_op |
84 | 96 | ||
@@ -96,6 +108,8 @@ int keepercall_receive(lua_State* L_); | |||
96 | [[nodiscard]] | 108 | [[nodiscard]] |
97 | int keepercall_receive_batched(lua_State* L_); | 109 | int keepercall_receive_batched(lua_State* L_); |
98 | [[nodiscard]] | 110 | [[nodiscard]] |
111 | int keepercall_restrict(lua_State* L_); | ||
112 | [[nodiscard]] | ||
99 | int keepercall_send(lua_State* L_); | 113 | int keepercall_send(lua_State* L_); |
100 | [[nodiscard]] | 114 | [[nodiscard]] |
101 | int keepercall_set(lua_State* L_); | 115 | int keepercall_set(lua_State* L_); |