13#ifndef IOX2_PORTFACTORY_REQUEST_RESPONSE_HPP
14#define IOX2_PORTFACTORY_REQUEST_RESPONSE_HPP
38 typename RequestPayload,
39 typename RequestUserHeader,
40 typename ResponsePayload,
41 typename ResponseUserHeader>
101 template <typename, typename, typename, typename,
ServiceType>
107 iox2_port_factory_request_response_h m_handle =
nullptr;
111 typename RequestPayload,
112 typename RequestUserHeader,
113 typename ResponsePayload,
114 typename ResponseUserHeader>
117 *
this = std::move(rhs);
121 typename RequestPayload,
122 typename RequestUserHeader,
123 typename ResponsePayload,
124 typename ResponseUserHeader>
130 m_handle = rhs.m_handle;
131 rhs.m_handle =
nullptr;
138 typename RequestPayload,
139 typename RequestUserHeader,
140 typename ResponsePayload,
141 typename ResponseUserHeader>
148 typename RequestPayload,
149 typename RequestUserHeader,
150 typename ResponsePayload,
151 typename ResponseUserHeader>
155 const auto* service_name_ptr = iox2_port_factory_request_response_service_name(&m_handle);
160 typename RequestPayload,
161 typename RequestUserHeader,
162 typename ResponsePayload,
163 typename ResponseUserHeader>
169 iox2_port_factory_request_response_service_hash(&m_handle, &buffer[0], IOX2_SERVICE_HASH_LENGTH);
174 IOX2_SERVICE_HASH_LENGTH));
178 typename RequestPayload,
179 typename RequestUserHeader,
180 typename ResponsePayload,
181 typename ResponseUserHeader>
185 return AttributeSetView(iox2_port_factory_request_response_attributes(&m_handle));
189 typename RequestPayload,
190 typename RequestUserHeader,
191 typename ResponsePayload,
192 typename ResponseUserHeader>
197 iox2_port_factory_request_response_static_config(&m_handle, &
static_config);
203 typename RequestPayload,
204 typename RequestUserHeader,
205 typename ResponsePayload,
206 typename ResponseUserHeader>
214 typename RequestPayload,
215 typename RequestUserHeader,
216 typename ResponsePayload,
217 typename ResponseUserHeader>
225 iox2_port_factory_request_response_nodes(&m_handle, internal::list_callback<Service>,
static_cast<void*
>(&ctx));
227 if (ret_val == IOX2_OK) {
231 return bb::err(bb::into<NodeListFailure>(ret_val));
235 typename RequestPayload,
236 typename RequestUserHeader,
237 typename ResponsePayload,
238 typename ResponseUserHeader>
241 iox2_cleanup_state_t cleanup_state {};
243 iox2_port_factory_request_response_try_cleanup_dead_nodes(&m_handle, &cleanup_state);
246 ret_val.
cleanups = cleanup_state.cleanups;
247 ret_val.failed_cleanups = cleanup_state.failed_cleanups;
252 typename RequestPayload,
253 typename RequestUserHeader,
254 typename ResponsePayload,
255 typename ResponseUserHeader>
258 iox2_cleanup_state_t cleanup_state {};
260 iox2_port_factory_request_response_blocking_cleanup_dead_nodes(
261 &m_handle, &cleanup_state, timeout.as_secs(), timeout.subsec_nanos());
264 ret_val.
cleanups = cleanup_state.cleanups;
265 ret_val.failed_cleanups = cleanup_state.failed_cleanups;
270 typename RequestPayload,
271 typename RequestUserHeader,
272 typename ResponsePayload,
273 typename ResponseUserHeader>
279 iox2_port_factory_request_response_client_builder(&m_handle,
nullptr));
283 typename RequestPayload,
284 typename RequestUserHeader,
285 typename ResponsePayload,
286 typename ResponseUserHeader>
292 iox2_port_factory_request_response_server_builder(&m_handle,
nullptr));
296 typename RequestPayload,
297 typename RequestUserHeader,
298 typename ResponsePayload,
299 typename ResponseUserHeader>
302 : m_handle { handle } {
306 typename RequestPayload,
307 typename RequestUserHeader,
308 typename ResponsePayload,
309 typename ResponseUserHeader>
311PortFactoryRequestResponse<Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader>::drop() {
312 if (m_handle !=
nullptr) {
313 iox2_port_factory_request_response_drop(m_handle);
Describes the state of a [Node].
auto service_hash() const -> ServiceHash
Returns the [ServiceHash] of the [Service].
auto operator=(const PortFactoryRequestResponse &) -> PortFactoryRequestResponse &=delete
auto attributes() const -> AttributeSetView
Returns the attributes defined in the [Service].
auto server_builder() const -> PortFactoryServer< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >
PortFactoryRequestResponse(PortFactoryRequestResponse &&rhs) noexcept
auto operator=(PortFactoryRequestResponse &&rhs) noexcept -> PortFactoryRequestResponse &
auto blocking_cleanup_dead_nodes(iox2::bb::Duration timeout) const -> CleanupState
PortFactoryRequestResponse(const PortFactoryRequestResponse &)=delete
auto name() const -> ServiceNameView
Returns the [ServiceName] of the service.
auto static_config() const -> StaticConfigRequestResponse
~PortFactoryRequestResponse()
auto client_builder() const -> PortFactoryClient< Service, RequestPayload, RequestUserHeader, ResponsePayload, ResponseUserHeader >
auto try_cleanup_dead_nodes() const -> CleanupState
auto nodes(const iox2::bb::StaticFunction< CallbackProgression(NodeState< Service >)> &callback) const -> bb::Expected< void, NodeListFailure >
auto dynamic_config() const -> DynamicConfigRequestResponse
Represents the unique if of a [Service].
Non-owning view of a [ServiceName].
Wrapper class for a C-style array of type ElementType and size Capacity. Per default it is uninitiali...
constexpr auto err(const E &error) -> Unexpected< E >
iox2::bb::variation::Expected< T, E > Expected
auto ctx(const T &ptr) -> CallbackContext< T >
NodeListFailure
All failures that can occur in [Node::list()].
uint64_t cleanups
The number of successful dead node cleanups.