[mammoth] Update EndpointServer to have move-only semantics.
This commit is contained in:
parent
16c30d12fb
commit
2e89aee5a3
8 changed files with 40 additions and 29 deletions
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <glacier/memory/unique_ptr.h>
|
||||
#include <glacier/status/error_or.h>
|
||||
#include <ztypes.h>
|
||||
|
||||
|
|
@ -7,8 +8,12 @@
|
|||
|
||||
class EndpointServer {
|
||||
public:
|
||||
static glcr::ErrorOr<EndpointServer> Create();
|
||||
static EndpointServer Adopt(z_cap_t endpoint_cap);
|
||||
EndpointServer() = delete;
|
||||
EndpointServer(const EndpointServer&) = delete;
|
||||
EndpointServer& operator=(const EndpointServer&) = delete;
|
||||
|
||||
static glcr::ErrorOr<glcr::UniquePtr<EndpointServer>> Create();
|
||||
static glcr::UniquePtr<EndpointServer> Adopt(z_cap_t endpoint_cap);
|
||||
|
||||
glcr::ErrorOr<EndpointClient> CreateClient();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
#include "mammoth/endpoint_server.h"
|
||||
|
||||
glcr::ErrorOr<EndpointServer> EndpointServer::Create() {
|
||||
glcr::ErrorOr<glcr::UniquePtr<EndpointServer>> EndpointServer::Create() {
|
||||
uint64_t cap;
|
||||
RET_ERR(ZEndpointCreate(&cap));
|
||||
return EndpointServer(cap);
|
||||
return glcr::UniquePtr<EndpointServer>(new EndpointServer(cap));
|
||||
}
|
||||
|
||||
EndpointServer EndpointServer::Adopt(z_cap_t endpoint_cap) {
|
||||
return EndpointServer(endpoint_cap);
|
||||
glcr::UniquePtr<EndpointServer> EndpointServer::Adopt(z_cap_t endpoint_cap) {
|
||||
return glcr::UniquePtr<EndpointServer>(new EndpointServer(endpoint_cap));
|
||||
}
|
||||
|
||||
glcr::ErrorOr<EndpointClient> EndpointServer::CreateClient() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue