iceoryx2
C++ Language Bindings
Loading...
Searching...
No Matches
service_builder.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_SERVICE_BUILDER_HPP
14#define IOX2_SERVICE_BUILDER_HPP
15
20#include "iox2/service_type.hpp"
21
22namespace iox2 {
23
25template <ServiceType S>
27 public:
31 auto operator=(const ServiceBuilder&) -> ServiceBuilder& = delete;
32 ~ServiceBuilder() = default;
33
36 template <typename Payload>
38
41 auto event() && -> ServiceBuilderEvent<S>;
42
45 template <typename RequestPayload, typename ResponsePayload>
47
50 template <typename KeyType>
52
55 template <typename KeyType>
57
58 private:
59 template <ServiceType>
60 friend class Node;
61 ServiceBuilder(iox2_node_h_ref node_handle, iox2_service_name_ptr service_name_ptr);
62
63 iox2_service_builder_h m_handle = nullptr;
64};
65
66template <ServiceType S>
67inline ServiceBuilder<S>::ServiceBuilder(iox2_node_h_ref node_handle, iox2_service_name_ptr service_name_ptr)
68 : m_handle { iox2_node_service_builder(node_handle, nullptr, service_name_ptr) } {
69}
70
71template <ServiceType S>
73 return ServiceBuilderEvent<S> { m_handle };
74}
75
76template <ServiceType S>
77template <typename Payload>
81
82template <ServiceType S>
83template <typename RequestPayload, typename ResponsePayload>
84inline auto ServiceBuilder<
88
89template <ServiceType S>
90template <typename KeyType>
94
95template <ServiceType S>
96template <typename KeyType>
100} // namespace iox2
101#endif
Builder to create new [MessagingPattern::Blackboard] based [Service]s.
Builder to create new [MessagingPattern::Event] based [Service]s.
Builder to create new [MessagingPattern::PublishSubscribe] based [Service]s.
Builder to create or open [Service]s.
auto blackboard_creator() &&-> ServiceBuilderBlackboardCreator< KeyType, S >
~ServiceBuilder()=default
ServiceBuilder(const ServiceBuilder &)=delete
auto blackboard_opener() &&-> ServiceBuilderBlackboardOpener< KeyType, S >
auto operator=(ServiceBuilder &&) -> ServiceBuilder &=default
auto request_response() &&-> ServiceBuilderRequestResponse< RequestPayload, void, ResponsePayload, void, S >
auto event() &&-> ServiceBuilderEvent< S >
auto publish_subscribe() &&-> ServiceBuilderPublishSubscribe< Payload, void, S >
auto operator=(const ServiceBuilder &) -> ServiceBuilder &=delete
ServiceBuilder(ServiceBuilder &&)=default