iceoryx2
C++ Language Bindings
Loading...
Searching...
No Matches
event_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_EVENT_ID_HPP
14#define IOX2_EVENT_ID_HPP
15
17
18#include <iostream>
19
20namespace iox2 {
22class EventId {
23 public:
24 EventId(const EventId&) = default;
25 EventId(EventId&&) = default;
26 auto operator=(const EventId&) -> EventId& = default;
27 auto operator=(EventId&&) -> EventId& = default;
28 ~EventId() = default;
29
31 explicit EventId(size_t value);
32
34 auto as_value() const -> size_t;
35
36 private:
37 template <ServiceType>
38 friend class Notifier;
39 template <ServiceType>
40 friend class PortFactoryNotifier;
41 template <ServiceType>
42 friend class Listener;
43 template <ServiceType, typename, typename>
44 friend class EntryHandle;
45 template <ServiceType, typename, typename>
46 friend class EntryHandleMut;
47 friend class EventActivation;
48
49 explicit EventId(iox2_event_id_t value);
50
51 friend auto operator<<(std::ostream& stream, const EventId& value) -> std::ostream&;
52 iox2_event_id_t m_value;
53};
54
55auto operator<<(std::ostream& stream, const EventId& value) -> std::ostream&;
56auto operator==(const EventId& lhs, const EventId& rhs) -> bool;
57auto operator!=(const EventId& lhs, const EventId& rhs) -> bool;
58auto operator<(const EventId& lhs, const EventId& rhs) -> bool;
59auto operator<=(const EventId& lhs, const EventId& rhs) -> bool;
60auto operator>(const EventId& lhs, const EventId& rhs) -> bool;
61auto operator>=(const EventId& lhs, const EventId& rhs) -> bool;
62} // namespace iox2
63
64#endif
A handle for direct write access to a specific blackboard value.
A handle for direct read access to a specific blackboard value.
Type that allows to identify an event uniquely.
Definition event_id.hpp:22
auto as_value() const -> size_t
Returns the value of the [EventId].
EventId(const EventId &)=default
EventId(size_t value)
Creates a new uint128_t [EventId] from the high bit and low bit part.
EventId(EventId &&)=default
~EventId()=default
auto operator=(EventId &&) -> EventId &=default
auto operator=(const EventId &) -> EventId &=default
Represents the receiving endpoint of an event based communication.
Definition listener.hpp:32
Represents the sending endpoint of an event based communication.
Definition notifier.hpp:28