[mammoth] Move EndpointClient to move-only semantics.
This commit is contained in:
parent
2e89aee5a3
commit
90f33f31c5
15 changed files with 44 additions and 30 deletions
|
|
@ -1,13 +1,18 @@
|
|||
#pragma once
|
||||
|
||||
#include <glacier/container/pair.h>
|
||||
#include <glacier/memory/unique_ptr.h>
|
||||
#include <glacier/status/error_or.h>
|
||||
#include <zcall.h>
|
||||
#include <ztypes.h>
|
||||
|
||||
class EndpointClient {
|
||||
public:
|
||||
static EndpointClient AdoptEndpoint(z_cap_t cap);
|
||||
EndpointClient() = delete;
|
||||
EndpointClient(const EndpointClient&) = delete;
|
||||
EndpointClient& operator=(const EndpointClient&) = delete;
|
||||
|
||||
static glcr::UniquePtr<EndpointClient> AdoptEndpoint(z_cap_t cap);
|
||||
|
||||
template <typename Req, typename Resp>
|
||||
glcr::ErrorOr<glcr::Pair<Resp, z_cap_t>> CallEndpoint(const Req& req);
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class EndpointServer {
|
|||
static glcr::ErrorOr<glcr::UniquePtr<EndpointServer>> Create();
|
||||
static glcr::UniquePtr<EndpointServer> Adopt(z_cap_t endpoint_cap);
|
||||
|
||||
glcr::ErrorOr<EndpointClient> CreateClient();
|
||||
glcr::ErrorOr<glcr::UniquePtr<EndpointClient>> CreateClient();
|
||||
|
||||
// FIXME: Release Cap here.
|
||||
z_cap_t GetCap() { return endpoint_cap_; }
|
||||
|
|
|
|||
|
|
@ -5,5 +5,5 @@
|
|||
|
||||
#include "mammoth/endpoint_client.h"
|
||||
|
||||
glcr::ErrorCode SpawnProcessFromElfRegion(uint64_t program,
|
||||
EndpointClient client);
|
||||
glcr::ErrorCode SpawnProcessFromElfRegion(
|
||||
uint64_t program, glcr::UniquePtr<EndpointClient> client);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue