iceoryx2
C++ Language Bindings
Loading...
Searching...
No Matches
unique_node_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_NODE_ID_HPP
14#define IOX2_UNIQUE_NODE_ID_HPP
15
16#include "iox2/iceoryx2.h"
17#include "iox2/service_type.hpp"
18
19#include <cstdint>
20#include <ctime>
21#include <iostream>
22
23namespace iox2 {
24namespace internal {
25template <ServiceType>
26auto list_callback(
27 iox2_node_state_e, iox2_unique_node_id_ptr, const char*, iox2_node_name_ptr, iox2_config_ptr, iox2_callback_context)
28 -> iox2_callback_progression_e;
29}
30
33 public:
35 UniqueNodeId(UniqueNodeId&& rhs) noexcept;
36 auto operator=(const UniqueNodeId& rhs) -> UniqueNodeId&;
37 auto operator=(UniqueNodeId&& rhs) noexcept -> UniqueNodeId&;
39
41 auto value_high() const -> uint64_t;
42
44 auto value_low() const -> uint64_t;
45
47 auto pid() const -> int32_t;
48
50 auto creation_time() const -> timespec;
51
52 private:
53 template <ServiceType>
54 friend class Node;
55 template <ServiceType>
56 friend class DeadNodeView;
57 template <ServiceType>
58 friend auto internal::list_callback(iox2_node_state_e,
59 iox2_unique_node_id_ptr,
60 const char*,
61 iox2_node_name_ptr,
62 iox2_config_ptr,
63 iox2_callback_context) -> iox2_callback_progression_e;
64 friend class ClientDetailsView;
65 friend class ServerDetailsView;
66 friend class NotifierDetailsView;
67 friend class ListenerDetailsView;
69 friend class ReaderDetailsView;
71 friend class WriterDetailsView;
72
73 explicit UniqueNodeId(iox2_unique_node_id_h handle);
74 void drop();
75
76 iox2_unique_node_id_h m_handle = nullptr;
77};
78
79auto operator<<(std::ostream& stream, const UniqueNodeId& node) -> std::ostream&;
80auto operator==(const UniqueNodeId& lhs, const UniqueNodeId& rhs) -> bool;
81auto operator!=(const UniqueNodeId& lhs, const UniqueNodeId& rhs) -> bool;
82} // namespace iox2
83
84#endif
Contains the communication settings of the connected [Client].
Contains all details of a [Node] that is dead.
Contains the communication settings of the connected [Listener].
Contains the communication settings of the connected [Notifier].
Contains the communication settings of the connected [Publisher].
Contains the communication settings of the connected [Reader].
Contains the communication settings of the connected [Server].
Contains the communication settings of the connected [Subscriber].
The system-wide unique id of a [Node].
auto operator=(UniqueNodeId &&rhs) noexcept -> UniqueNodeId &
auto operator=(const UniqueNodeId &rhs) -> UniqueNodeId &
auto pid() const -> int32_t
Returns the [ProcessId] of the process that owns the [Node].
UniqueNodeId(const UniqueNodeId &rhs)
auto value_high() const -> uint64_t
Returns the high bits of the underlying value of the [NodeId].
UniqueNodeId(UniqueNodeId &&rhs) noexcept
auto value_low() const -> uint64_t
Returns the low bits of the underlying value of the [NodeId].
auto creation_time() const -> timespec
Returns the time the [Node] was created.
friend auto internal::list_callback(iox2_node_state_e, iox2_unique_node_id_ptr, const char *, iox2_node_name_ptr, iox2_config_ptr, iox2_callback_context) -> iox2_callback_progression_e
Contains the communication settings of the connected [Writer].
auto list_callback(iox2_node_state_e node_state, iox2_unique_node_id_ptr node_id_ptr, const char *executable, iox2_node_name_ptr node_name, iox2_config_ptr config, iox2_callback_context context) -> iox2_callback_progression_e