From 1573a8c4cde1cd9528b422b2dcc598e37ffe94a7 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Thu, 2 May 2024 19:12:26 +1000 Subject: WIP merge cyclically dependent components into one big component --- src/tangara/lua/lua_registry.hpp | 51 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/tangara/lua/lua_registry.hpp (limited to 'src/tangara/lua/lua_registry.hpp') diff --git a/src/tangara/lua/lua_registry.hpp b/src/tangara/lua/lua_registry.hpp new file mode 100644 index 00000000..abc5063e --- /dev/null +++ b/src/tangara/lua/lua_registry.hpp @@ -0,0 +1,51 @@ +/* + * Copyright 2023 jacqueline + * + * SPDX-License-Identifier: GPL-3.0-only + */ + +#pragma once + +#include +#include + +#include "lua.hpp" + +#include "bridge.hpp" +#include "lua_thread.hpp" +#include "service_locator.hpp" + +namespace lua { + +class Registry { + public: + static auto instance(system_fsm::ServiceLocator&) -> Registry&; + + auto uiThread() -> std::shared_ptr; + auto newThread() -> std::shared_ptr; + + auto AddPropertyModule( + const std::string&, + std::vector>>) + -> void; + + Registry(const Registry&) = delete; + Registry& operator=(const Registry&) = delete; + + private: + Registry(system_fsm::ServiceLocator&); + + system_fsm::ServiceLocator& services_; + std::unique_ptr bridge_; + + std::shared_ptr ui_thread_; + std::list> threads_; + + std::vector< + std::pair>>>> + modules_; +}; + +} // namespace lua -- cgit v1.2.3