remote_key_builder.h
1 
5 #pragma once
6 
7 #include <memory>
8 #include <utility>
9 
10 #include <ucxx/typedefs.h>
11 
12 namespace ucxx {
13 
14 class Endpoint;
15 class MemoryHandle;
16 class RemoteKey;
17 
25 class RemoteKeyBuilder final {
26  public:
32  explicit RemoteKeyBuilder(std::shared_ptr<MemoryHandle> memoryHandle);
33 
40  RemoteKeyBuilder(std::shared_ptr<Endpoint> endpoint, SerializedRemoteKey serializedRemoteKey);
41 
44 
52  RemoteKeyBuilder& operator=(RemoteKeyBuilder&&) noexcept;
53 
59  operator std::shared_ptr<RemoteKey>();
60 
68  [[nodiscard]] std::shared_ptr<RemoteKey> build();
69 
70  private:
71  struct Impl;
72  std::unique_ptr<Impl> _impl;
73 };
74 
75 } // namespace ucxx
Builder class for constructing std::shared_ptr<ucxx::RemoteKey> objects.
Definition: remote_key_builder.h:25
RemoteKeyBuilder(std::shared_ptr< MemoryHandle > memoryHandle)
Constructor for RemoteKeyBuilder from a local memory handle.
RemoteKeyBuilder & operator=(const RemoteKeyBuilder &other)
Copy assignment operator (deep-copies internal state).
RemoteKeyBuilder(const RemoteKeyBuilder &other)
Copy constructor (deep-copies internal state).
RemoteKeyBuilder(RemoteKeyBuilder &&) noexcept
Move constructor.
RemoteKeyBuilder(std::shared_ptr< Endpoint > endpoint, SerializedRemoteKey serializedRemoteKey)
Constructor for RemoteKeyBuilder from a serialized remote key.
~RemoteKeyBuilder()
RemoteKeyBuilder destructor.
std::shared_ptr< RemoteKey > build()
Build and return the RemoteKey.
Component holding a UCP rkey (remote key).
Definition: remote_key.h:39
Definition: address.h:16
const std::string SerializedRemoteKey
Serialized form of a remote key.
Definition: typedefs.h:304