1#ifndef _DITTO_PRESENCE_MANAGER_
2#define _DITTO_PRESENCE_MANAGER_
4#include "DittoHandleWrapper.hpp"
5#include "PresenceGraph.hpp"
11class DittoHandleWrapper;
17typedef std::function<void(PresenceGraph)> PresenceCallback;
19typedef std::weak_ptr<PresenceCallback> PresenceObserverInternal;
20typedef std::shared_ptr<PresenceCallback> PresenceObserver;
44 Presence(std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper);
50 static void on_event(
void *ctx,
const char *
graph);
59 std::shared_ptr<DittoHandleWrapper> ditto_handle_wrapper;
60 std::vector<PresenceObserverInternal> observers;
The entrypoint to the Ditto SDK.
Definition Ditto.hpp:32
Represents local peer and local peers.
Definition PresenceGraph.hpp:63
Definition Presence.hpp:25
PresenceGraph exec()
Return an immediate representation of known peers.
Definition Presence.cpp:63
PresenceObserver observe(PresenceCallback presence_cb)
This will run the provided callback when peers are updated.
Definition Presence.cpp:41