#pragma once #include #include namespace saw { namespace rmt { struct File {}; } template<> class remote_address { private: std::filesystem::path path_; public: remote_address(const std::filesystem::path& path__): path_{path__} {} std::string get_path_string() const { return path_.string(); } const std::filesystem::path& get_path() const { return path_; } }; template<> class remote { private: SAW_FORBID_COPY(remote); SAW_FORBID_MOVE(remote); std::map>> registered_data_servers_; public: error_or>> parse_address(const std::string_view& path_v){ return heap>(path_v); } template error_or>> data_listen(ref> addr){ auto insert_res = registered_data_servers_.emplace(std::make_pair(addr.get_path_string(),{})); if(!insert_res.second){ return make_error(); } auto dat_srv = heap>(*this, addr); insert_res.first->second = {dat_srv}; return dat_srv; } }; }