From a2f713193ecbc888a1adad7784386e6f54386d4d Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Thu, 27 Jun 2024 14:40:15 +0200 Subject: Preparing to build better thread remotes --- modules/thread/c++/remote.hpp | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 modules/thread/c++/remote.hpp (limited to 'modules/thread/c++') diff --git a/modules/thread/c++/remote.hpp b/modules/thread/c++/remote.hpp new file mode 100644 index 0000000..83dca4c --- /dev/null +++ b/modules/thread/c++/remote.hpp @@ -0,0 +1,47 @@ +#pragma once + +#include + +namespace saw { +namespace rmt { +struct Thread {}; +} + +template<> +class device final { +private: + event_loop ev_loop_; + std::thread thread_; + bool keep_running_; + + void run(){ + wait_scope wait{ev_loop_}; + + while(keep_running_){ + wait.wait(std::chrono::seconds{4u}); + } + } +public: + device(): + ev_loop_{}, + thread_{&device::run, this}, + keep_running_{true} + { + } +}; + +template<> +class remote final { + private: +public: + remote() = default; + + conveyor>> resolve_address(){ + return heap>(*this); + } + + device connect_device(const remote_address& ){ + return {}; + } +}; +} -- cgit v1.2.3