EduArt Sensor Ring Library 3.0.0
Loading...
Searching...
No Matches
ComEndpoint.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 EduArt Robotik GmbH
2
9
10#pragma once
11
12#include <string>
13#include <unordered_set>
14
15#include "sensorring/platform/SensorringExport.hpp"
16
17namespace eduart {
18
19namespace com {
20
25class SENSORRING_EXPORT ComEndpoint {
26public:
31 ComEndpoint(const std::string& id);
32
34 ComEndpoint(const ComEndpoint& endpoint);
35
40 const std::string getId() const;
41
42 // Equality operator for ComEndpoint
43 bool operator==(const ComEndpoint& other) const;
44
45private:
46 const std::string _id;
47};
48
49} // namespace com
50
51} // namespace eduart
52
53namespace std {
54
59template <> struct hash<eduart::com::ComEndpoint> {
65 std::size_t operator()(const eduart::com::ComEndpoint& ep) const { return std::hash<std::string>{}(ep.getId()); }
66};
67
68} // namespace std
Uniquely identifies a communication endpoint by its string ID.
Definition ComEndpoint.hpp:25
const std::string getId() const
Get the endpoint ID.
ComEndpoint(const std::string &id)
Construct from endpoint ID string.
ComEndpoint(const ComEndpoint &endpoint)
Copy constructor.
std::size_t operator()(const eduart::com::ComEndpoint &ep) const
Compute hash value for a ComEndpoint.
Definition ComEndpoint.hpp:65