#pragma once #include #include namespace erebos { class Server { public: Server(const Identity &); ~Server(); class PeerList & peerList() const; struct Peer; private: struct Priv; const std::shared_ptr p; }; class Peer { public: struct Priv; Peer(const std::shared_ptr & p); ~Peer(); std::string name() const; std::optional identity() const; private: std::shared_ptr p; }; class PeerList { public: struct Priv; PeerList(); PeerList(const std::shared_ptr & p); ~PeerList(); size_t size() const; Peer at(size_t n) const; void onUpdate(std::function); private: friend Server; const std::shared_ptr p; }; }