iceoryx2
C++ Language Bindings
Loading...
Searching...
No Matches
unique_port_id.hpp
Go to the documentation of this file.
1// Copyright (c) 2024 Contributors to the Eclipse Foundation
2//
3// See the NOTICE file(s) distributed with this work for additional
4// information regarding copyright ownership.
5//
6// This program and the accompanying materials are made available under the
7// terms of the Apache Software License 2.0 which is available at
8// https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
9// which is available at https://opensource.org/licenses/MIT.
10//
11// SPDX-License-Identifier: Apache-2.0 OR MIT
12
13#ifndef IOX2_UNIQUE_PORT_ID_HPP
14#define IOX2_UNIQUE_PORT_ID_HPP
15
16#include "iox2/bb/optional.hpp"
19
20namespace iox2 {
21
22constexpr uint64_t UNIQUE_PORT_ID_LENGTH = 16;
24
27 public:
30 auto operator=(const UniquePublisherId& rhs) -> UniquePublisherId& = delete;
33
34 auto bytes() const -> const bb::Optional<RawIdType>&;
35
36 private:
37 template <ServiceType, typename, typename>
38 friend class Publisher;
41 friend auto operator==(const UniquePublisherId&, const UniquePublisherId&) -> bool;
42 friend auto operator<(const UniquePublisherId&, const UniquePublisherId&) -> bool;
43
44 explicit UniquePublisherId(iox2_unique_publisher_id_h handle);
45 void drop();
46
47 iox2_unique_publisher_id_h m_handle = nullptr;
48 mutable bb::Optional<RawIdType> m_raw_id;
49};
50
53 public:
56 auto operator=(const UniqueSubscriberId& rhs) -> UniqueSubscriberId& = delete;
59
60 auto bytes() const -> const bb::Optional<RawIdType>&;
61
62 private:
63 template <ServiceType, typename, typename>
64 friend class Subscriber;
65 friend auto operator==(const UniqueSubscriberId&, const UniqueSubscriberId&) -> bool;
66 friend auto operator<(const UniqueSubscriberId&, const UniqueSubscriberId&) -> bool;
68
69 explicit UniqueSubscriberId(iox2_unique_subscriber_id_h handle);
70 void drop();
71
72 iox2_unique_subscriber_id_h m_handle = nullptr;
73 mutable bb::Optional<RawIdType> m_raw_id;
74};
75
78 public:
81 auto operator=(const UniqueNotifierId& rhs) -> UniqueNotifierId& = delete;
84
85 auto bytes() const -> const bb::Optional<RawIdType>&;
86
87 private:
88 template <ServiceType>
89 friend class Notifier;
90 friend auto operator==(const UniqueNotifierId&, const UniqueNotifierId&) -> bool;
91 friend auto operator<(const UniqueNotifierId&, const UniqueNotifierId&) -> bool;
92 friend class NotifierDetailsView;
93
94 explicit UniqueNotifierId(iox2_unique_notifier_id_h handle);
95 void drop();
96
97 iox2_unique_notifier_id_h m_handle = nullptr;
98 mutable bb::Optional<RawIdType> m_raw_id;
99};
100
103 public:
106 auto operator=(const UniqueListenerId& rhs) -> UniqueListenerId& = delete;
109
110 auto bytes() const -> const bb::Optional<RawIdType>&;
111
112 private:
113 template <ServiceType>
114 friend class Listener;
115 friend auto operator==(const UniqueListenerId&, const UniqueListenerId&) -> bool;
116 friend auto operator<(const UniqueListenerId&, const UniqueListenerId&) -> bool;
118
119 explicit UniqueListenerId(iox2_unique_listener_id_h handle);
120 void drop();
121
122 iox2_unique_listener_id_h m_handle = nullptr;
123 mutable bb::Optional<RawIdType> m_raw_id;
124};
125
128 public:
131 auto operator=(const UniqueClientId& rhs) -> UniqueClientId& = delete;
132 auto operator=(UniqueClientId&& rhs) noexcept -> UniqueClientId&;
134
135 auto bytes() const -> const bb::Optional<RawIdType>&;
136
137 private:
138 template <ServiceType, typename, typename, typename, typename>
139 friend class Client;
140 friend class RequestHeader;
141 friend auto operator==(const UniqueClientId&, const UniqueClientId&) -> bool;
142 friend auto operator<(const UniqueClientId&, const UniqueClientId&) -> bool;
143 friend class ClientDetailsView;
144
145 explicit UniqueClientId(iox2_unique_client_id_h handle);
146 void drop();
147
148 iox2_unique_client_id_h m_handle = nullptr;
149 mutable bb::Optional<RawIdType> m_raw_id;
150};
151
154 public:
157 auto operator=(const UniqueServerId& rhs) -> UniqueServerId& = delete;
158 auto operator=(UniqueServerId&& rhs) noexcept -> UniqueServerId&;
160
161 auto bytes() const -> const bb::Optional<RawIdType>&;
162
163 private:
164 template <ServiceType, typename, typename, typename, typename>
165 friend class Server;
166 friend class ResponseHeader;
167 friend auto operator==(const UniqueServerId&, const UniqueServerId&) -> bool;
168 friend auto operator<(const UniqueServerId&, const UniqueServerId&) -> bool;
169 friend class ServerDetailsView;
170
171 explicit UniqueServerId(iox2_unique_server_id_h handle);
172 void drop();
173
174 iox2_unique_server_id_h m_handle = nullptr;
175 mutable bb::Optional<RawIdType> m_raw_id;
176};
177
180 public:
183 auto operator=(const UniqueReaderId& rhs) -> UniqueReaderId& = delete;
184 auto operator=(UniqueReaderId&& rhs) noexcept -> UniqueReaderId&;
186
187 auto bytes() const -> const bb::Optional<RawIdType>&;
188
189 private:
190 template <ServiceType, typename>
191 friend class Reader;
192 friend auto operator==(const UniqueReaderId&, const UniqueReaderId&) -> bool;
193 friend auto operator<(const UniqueReaderId&, const UniqueReaderId&) -> bool;
194 friend class ReaderDetailsView;
195
196 explicit UniqueReaderId(iox2_unique_reader_id_h handle);
197 void drop();
198
199 iox2_unique_reader_id_h m_handle = nullptr;
200 mutable bb::Optional<RawIdType> m_raw_id;
201};
202
205 public:
208 auto operator=(const UniqueWriterId& rhs) -> UniqueWriterId& = delete;
209 auto operator=(UniqueWriterId&& rhs) noexcept -> UniqueWriterId&;
211
212 auto bytes() const -> const bb::Optional<RawIdType>&;
213
214 private:
215 template <ServiceType, typename>
216 friend class Writer;
217 friend auto operator==(const UniqueWriterId&, const UniqueWriterId&) -> bool;
218 friend auto operator<(const UniqueWriterId&, const UniqueWriterId&) -> bool;
219 friend class WriterDetailsView;
220
221 explicit UniqueWriterId(iox2_unique_writer_id_h handle);
222 void drop();
223
224 iox2_unique_writer_id_h m_handle = nullptr;
225 mutable bb::Optional<RawIdType> m_raw_id;
226};
227
228auto operator==(const UniquePublisherId& lhs, const UniquePublisherId& rhs) -> bool;
229auto operator<(const UniquePublisherId& lhs, const UniquePublisherId& rhs) -> bool;
230auto operator==(const UniqueSubscriberId& lhs, const UniqueSubscriberId& rhs) -> bool;
231auto operator<(const UniqueSubscriberId& lhs, const UniqueSubscriberId& rhs) -> bool;
232auto operator==(const UniqueNotifierId& lhs, const UniqueNotifierId& rhs) -> bool;
233auto operator<(const UniqueNotifierId& lhs, const UniqueNotifierId& rhs) -> bool;
234auto operator==(const UniqueListenerId& lhs, const UniqueListenerId& rhs) -> bool;
235auto operator<(const UniqueListenerId& lhs, const UniqueListenerId& rhs) -> bool;
236auto operator==(const UniqueClientId& lhs, const UniqueClientId& rhs) -> bool;
237auto operator<(const UniqueClientId& lhs, const UniqueClientId& rhs) -> bool;
238auto operator==(const UniqueServerId& lhs, const UniqueServerId& rhs) -> bool;
239auto operator<(const UniqueServerId& lhs, const UniqueServerId& rhs) -> bool;
240auto operator==(const UniqueReaderId& lhs, const UniqueReaderId& rhs) -> bool;
241auto operator<(const UniqueReaderId& lhs, const UniqueReaderId& rhs) -> bool;
242auto operator==(const UniqueWriterId& lhs, const UniqueWriterId& rhs) -> bool;
243auto operator<(const UniqueWriterId& lhs, const UniqueWriterId& rhs) -> bool;
244
245} // namespace iox2
246
247#endif
Contains the communication settings of the connected [Client].
Sends [RequestMut]s to a [Server] in a request-response based communication.
Definition client.hpp:31
Sample header used by [MessagingPattern::PublishSubscribe].
Contains the communication settings of the connected [Listener].
Represents the receiving endpoint of an event based communication.
Definition listener.hpp:32
Contains the communication settings of the connected [Notifier].
Represents the sending endpoint of an event based communication.
Definition notifier.hpp:28
Contains the communication settings of the connected [Publisher].
Sending endpoint of a publish-subscriber based communication.
Definition publisher.hpp:34
Contains the communication settings of the connected [Reader].
Reading endpoint of a blackboard based communication.
Definition reader.hpp:27
Request header used by [MessagingPattern::RequestResponse].
Response header used by [MessagingPattern::RequestResponse].
Contains the communication settings of the connected [Server].
Contains the communication settings of the connected [Subscriber].
The receiving endpoint of a publish-subscribe communication.
The system-wide unique id of a [Client].
UniqueClientId(const UniqueClientId &)=delete
auto bytes() const -> const bb::Optional< RawIdType > &
auto operator=(UniqueClientId &&rhs) noexcept -> UniqueClientId &
UniqueClientId(UniqueClientId &&rhs) noexcept
auto operator=(const UniqueClientId &rhs) -> UniqueClientId &=delete
The system-wide unique id of a [Listener].
auto operator=(const UniqueListenerId &rhs) -> UniqueListenerId &=delete
UniqueListenerId(const UniqueListenerId &)=delete
auto operator=(UniqueListenerId &&rhs) noexcept -> UniqueListenerId &
auto bytes() const -> const bb::Optional< RawIdType > &
UniqueListenerId(UniqueListenerId &&rhs) noexcept
The system-wide unique id of a [Notifier].
auto operator=(UniqueNotifierId &&rhs) noexcept -> UniqueNotifierId &
UniqueNotifierId(const UniqueNotifierId &)=delete
auto operator=(const UniqueNotifierId &rhs) -> UniqueNotifierId &=delete
UniqueNotifierId(UniqueNotifierId &&rhs) noexcept
auto bytes() const -> const bb::Optional< RawIdType > &
The system-wide unique id of a [Publisher].
UniquePublisherId(UniquePublisherId &&rhs) noexcept
auto bytes() const -> const bb::Optional< RawIdType > &
auto operator=(const UniquePublisherId &rhs) -> UniquePublisherId &=delete
UniquePublisherId(const UniquePublisherId &)=delete
auto operator=(UniquePublisherId &&rhs) noexcept -> UniquePublisherId &
The system-wide unique id of a [Reader].
UniqueReaderId(const UniqueReaderId &)=delete
auto bytes() const -> const bb::Optional< RawIdType > &
UniqueReaderId(UniqueReaderId &&rhs) noexcept
auto operator=(const UniqueReaderId &rhs) -> UniqueReaderId &=delete
auto operator=(UniqueReaderId &&rhs) noexcept -> UniqueReaderId &
The system-wide unique id of a [Server].
UniqueServerId(UniqueServerId &&rhs) noexcept
auto bytes() const -> const bb::Optional< RawIdType > &
auto operator=(UniqueServerId &&rhs) noexcept -> UniqueServerId &
UniqueServerId(const UniqueServerId &)=delete
auto operator=(const UniqueServerId &rhs) -> UniqueServerId &=delete
The system-wide unique id of a [Subscriber].
auto operator=(const UniqueSubscriberId &rhs) -> UniqueSubscriberId &=delete
auto bytes() const -> const bb::Optional< RawIdType > &
UniqueSubscriberId(UniqueSubscriberId &&rhs) noexcept
UniqueSubscriberId(const UniqueSubscriberId &)=delete
auto operator=(UniqueSubscriberId &&rhs) noexcept -> UniqueSubscriberId &
The system-wide unique id of a [Writer].
auto operator=(const UniqueWriterId &rhs) -> UniqueWriterId &=delete
UniqueWriterId(const UniqueWriterId &)=delete
auto bytes() const -> const bb::Optional< RawIdType > &
UniqueWriterId(UniqueWriterId &&rhs) noexcept
auto operator=(UniqueWriterId &&rhs) noexcept -> UniqueWriterId &
Contains the communication settings of the connected [Writer].
Producing endpoint of a blackboard based communication.
Definition writer.hpp:26
A resizable container with compile-time fixed static capacity and contiguous inplace storage.
constexpr uint64_t UNIQUE_PORT_ID_LENGTH