diff options
Diffstat (limited to 'src/linda.h')
-rw-r--r-- | src/linda.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/linda.h b/src/linda.h index c05fb14..02b0514 100644 --- a/src/linda.h +++ b/src/linda.h | |||
@@ -40,7 +40,15 @@ class Linda | |||
40 | } | 40 | } |
41 | }; | 41 | }; |
42 | 42 | ||
43 | enum class Status | ||
44 | { | ||
45 | Active, | ||
46 | Cancelled | ||
47 | }; | ||
48 | using enum Status; | ||
49 | |||
43 | private: | 50 | private: |
51 | |||
44 | static constexpr size_t kEmbeddedNameLength = 24; | 52 | static constexpr size_t kEmbeddedNameLength = 24; |
45 | using EmbeddedName = std::array<char, kEmbeddedNameLength>; | 53 | using EmbeddedName = std::array<char, kEmbeddedNameLength>; |
46 | // depending on the name length, it is either embedded inside the Linda, or allocated separately | 54 | // depending on the name length, it is either embedded inside the Linda, or allocated separately |
@@ -53,7 +61,7 @@ class Linda | |||
53 | std::condition_variable writeHappened{}; | 61 | std::condition_variable writeHappened{}; |
54 | Universe* const U{ nullptr }; // the universe this linda belongs to | 62 | Universe* const U{ nullptr }; // the universe this linda belongs to |
55 | KeeperIndex const keeperIndex{ -1 }; // the keeper associated to this linda | 63 | KeeperIndex const keeperIndex{ -1 }; // the keeper associated to this linda |
56 | CancelRequest cancelRequest{ CancelRequest::None }; | 64 | Status cancelStatus{ Status::Active }; |
57 | 65 | ||
58 | public: | 66 | public: |
59 | [[nodiscard]] static void* operator new(size_t size_, Universe* U_) noexcept { return U_->internalAllocator.alloc(size_); } | 67 | [[nodiscard]] static void* operator new(size_t size_, Universe* U_) noexcept { return U_->internalAllocator.alloc(size_); } |
@@ -89,6 +97,7 @@ class Linda | |||
89 | }; | 97 | }; |
90 | void releaseKeeper(Keeper* keeper_) const; | 98 | void releaseKeeper(Keeper* keeper_) const; |
91 | [[nodiscard]] static int ProtectedCall(lua_State* L_, lua_CFunction f_); | 99 | [[nodiscard]] static int ProtectedCall(lua_State* L_, lua_CFunction f_); |
100 | void pushCancelString(lua_State* L_) const; | ||
92 | [[nodiscard]] KeeperOperationInProgress startKeeperOperation(lua_State* const L_) { return KeeperOperationInProgress{ *this, L_ }; }; | 101 | [[nodiscard]] KeeperOperationInProgress startKeeperOperation(lua_State* const L_) { return KeeperOperationInProgress{ *this, L_ }; }; |
93 | [[nodiscard]] Keeper* whichKeeper() const { return U->keepers.getKeeper(keeperIndex); } | 102 | [[nodiscard]] Keeper* whichKeeper() const { return U->keepers.getKeeper(keeperIndex); } |
94 | }; | 103 | }; |