iceoryx2
C++ Language Bindings
Loading...
Searching...
No Matches
service_builder_event.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_EVENT_BUILDER_HPP
14#define IOX2_SERVICE_EVENT_BUILDER_HPP
15
19#include "iox2/bb/expected.hpp"
20#include "iox2/bb/optional.hpp"
21#include "iox2/event_id.hpp"
25#include "iox2/service_type.hpp"
26
27#include <cstdint>
28
29namespace iox2 {
31template <ServiceType S>
33 public:
37#ifdef DOXYGEN_MACRO_FIX
38 auto max_nodes(const uint64_t value) -> decltype(auto);
39#else
41#endif
42
46#ifdef DOXYGEN_MACRO_FIX
47 auto event_id_max_value(const uint64_t value) -> decltype(auto);
48#else
50#endif
51
55#ifdef DOXYGEN_MACRO_FIX
56 auto max_notifiers(const uint64_t value) -> decltype(auto);
57#else
59#endif
60
64#ifdef DOXYGEN_MACRO_FIX
65 auto max_listeners(const uint64_t value) -> decltype(auto);
66#else
68#endif
69
70 public:
75
79
84
88
91
94
98
102
106
113
116
120 const AttributeVerifier& required_attributes) && -> bb::Expected<PortFactoryEvent<S>, EventOpenError>;
121
124
128
129 private:
130 template <ServiceType>
131 friend class ServiceBuilder;
132
133 explicit ServiceBuilderEvent(iox2_service_builder_h handle);
134
135 void set_parameters();
136
137 iox2_service_builder_event_h m_handle = nullptr;
138
139 bb::Optional<EventId> m_notifier_dead_event;
140 bb::Optional<EventId> m_notifier_created_event;
141 bb::Optional<EventId> m_notifier_dropped_event;
143 bool m_verify_notifier_dead_event = false;
144 bool m_verify_notifier_created_event = false;
145 bool m_verify_notifier_dropped_event = false;
146 bool m_verify_deadline = false;
147};
148} // namespace iox2
149
150#endif
#define IOX2_BUILDER_OPTIONAL(type, name)
Definition builder.hpp:47
Type that allows to identify an event uniquely.
Definition event_id.hpp:22
Builder to create new [MessagingPattern::Event] based [Service]s.
auto max_listeners(const uint64_t value) -> decltype(auto)
auto notifier_created_event(EventId event_id) &&-> ServiceBuilderEvent &&
auto create_with_attributes(const AttributeSpecifier &attributes) &&-> bb::Expected< PortFactoryEvent< S >, EventCreateError >
Creates a new [Service] with a set of attributes.
auto disable_notifier_dropped_event() &&-> ServiceBuilderEvent &&
If the [Service] is created it disables sending an event when a notifier was dropped.
auto notifier_dead_event(EventId event_id) &&-> ServiceBuilderEvent &&
auto max_notifiers(const uint64_t value) -> decltype(auto)
auto open() &&-> bb::Expected< PortFactoryEvent< S >, EventOpenError >
Opens an existing [Service].
auto create() &&-> bb::Expected< PortFactoryEvent< S >, EventCreateError >
Creates a new [Service].
auto open_with_attributes(const AttributeVerifier &required_attributes) &&-> bb::Expected< PortFactoryEvent< S >, EventOpenError >
auto event_id_max_value(const uint64_t value) -> decltype(auto)
auto notifier_dropped_event(EventId event_id) &&-> ServiceBuilderEvent &&
auto max_nodes(const uint64_t value) -> decltype(auto)
auto disable_deadline() &&-> ServiceBuilderEvent &&
auto open_or_create_with_attributes(const AttributeVerifier &required_attributes) &&-> bb::Expected< PortFactoryEvent< S >, EventOpenOrCreateError >
auto deadline(iox2::bb::Duration deadline) &&-> ServiceBuilderEvent &&
auto disable_notifier_created_event() &&-> ServiceBuilderEvent &&
If the [Service] is created it disables sending an event when a new notifier was created.
auto disable_notifier_dead_event() &&-> ServiceBuilderEvent &&
auto open_or_create() &&-> bb::Expected< PortFactoryEvent< S >, EventOpenOrCreateError >
Builder to create or open [Service]s.
iox2::bb::variation::Optional< T > Optional
Definition optional.hpp:25
iox2::bb::variation::Expected< T, E > Expected
Definition expected.hpp:22
EventCreateError
Failures that can occur when a new [MessagingPattern::Event] [Service] shall be created.
EventOpenError
Failures that can occur when an existing [MessagingPattern::Event] [Service] shall be opened.