1#ifndef DITTO_PRESENCE_GRAPH_H
2#define DITTO_PRESENCE_GRAPH_H
12using SiteId = uint64_t;
13using Pubkey = std::vector<uint8_t>;
28 DittoAddress(Pubkey pubkey, SiteId site_id);
29 void update_from_json(nlohmann::json j);
30 bool operator==(
const DittoAddress &b)
const;
46#pragma GCC diagnostic push
47#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
48 Connection(
const Connection &other) =
default;
49 Connection(Connection &&other) =
default;
50 Connection &operator=(
const Connection &other) =
default;
51 Connection &operator=(Connection &&other) =
default;
52 ~Connection() =
default;
53#pragma GCC diagnostic pop
64 DITTO_DEPRECATED_BECAUSE(
"Use `peer_key_string1` instead.")
70 DITTO_DEPRECATED_BECAUSE(
"Use `peer_key_string2` instead.")
113#pragma GCC diagnostic push
114#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
115 Peer(
const Peer &other) =
default;
116 Peer(Peer &&other) =
default;
117 Peer &operator=(
const Peer &other) =
default;
118 Peer &operator=(Peer &&other) =
default;
120#pragma GCC diagnostic pop
130 DITTO_DEPRECATED_BECAUSE(
"use `peer_key_string` instead")
157 DITTO_DEPRECATED_BECAUSE(
"Query overlap groups have been phased out, this "
158 "property always returns 0.")
220#pragma GCC diagnostic push
221#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
227#pragma GCC diagnostic pop
Represents a connection between two peers in a Ditto mesh network.
Definition PresenceGraph.hpp:40
std::string id
Unique identifier for the connection.
Definition PresenceGraph.hpp:59
std::string peer_key_string2
The peer key of the peer at the other end of the connection, as a string.
Definition PresenceGraph.hpp:88
std::string peer_key_string1
The peer key of the peer at one end of the connection, as a string.
Definition PresenceGraph.hpp:79
std::string connection_type
Type of transport enabling this connection.
Definition PresenceGraph.hpp:101
Pubkey peer1
The peer key of the peer at one end of the connection.
Definition PresenceGraph.hpp:65
float approximate_distance_in_meters
Estimate of distance to the remote peer.
Definition PresenceGraph.hpp:96
Pubkey peer2
The peer key of the peer at the other end of the connection.
Definition PresenceGraph.hpp:71
Information used to identify a peer.
Definition PresenceGraph.hpp:25
Represent a known peer in the Ditto network.
Definition PresenceGraph.hpp:107
nlohmann::json identity_service_metadata
Metadata associated with the peer by the identity service.
Definition PresenceGraph.hpp:203
std::string peer_key_string
The peer key is a unique identifier for a given peer, equal to or derived from the cryptographic publ...
Definition PresenceGraph.hpp:140
nlohmann::json peer_metadata
Metadata associated with the peer, or empty map by default.
Definition PresenceGraph.hpp:194
std::string os
Operating system of the remote peer.
Definition PresenceGraph.hpp:152
bool is_compatible
Indicates whether the peer is compatible with the current peer.
Definition PresenceGraph.hpp:169
std::string ditto_sdk_version
The Ditto SDK version the peer is running with.
Definition PresenceGraph.hpp:174
std::string device_name
The human-readable device name of the remote peer. This defaults to the hostname but can be manually ...
Definition PresenceGraph.hpp:147
std::vector< Connection > connections
Currently active connections of the peer.
Definition PresenceGraph.hpp:179
bool is_connected_to_ditto_cloud
Indicates whether the peer is connected to Ditto Cloud.
Definition PresenceGraph.hpp:164
uint8_t query_overlap_group
This field is no longer in use and will always be 0.
Definition PresenceGraph.hpp:159
std::vector< uint8_t > peer_key
Definition PresenceGraph.hpp:131
DittoAddress address
Address to contact this peer via Ditto Bus.
Definition PresenceGraph.hpp:125
Peer local_peer
Returns the local peer (usually the peer that is represented by the currently running Ditto instance)...
Definition PresenceGraph.hpp:235
std::vector< Peer > remote_peers
Returns all remote peers known by the local_peer, either directly or via other remote peers.
Definition PresenceGraph.hpp:241
PresenceGraph(nlohmann::json)
Construct a new Presence Graph object.
Namespace for the Ditto C++ SDK types and functions.
Definition AbstractDocumentPath.hpp:19