From 6c58f1e095f7dbe1e7e1654c1807a76276a2f3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 5 Jun 2021 23:10:24 +0200 Subject: Contact list in shared state --- include/erebos/contact.h | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 include/erebos/contact.h (limited to 'include/erebos/contact.h') diff --git a/include/erebos/contact.h b/include/erebos/contact.h new file mode 100644 index 0000000..e56346a --- /dev/null +++ b/include/erebos/contact.h @@ -0,0 +1,47 @@ +#pragma once + +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace erebos { + +using std::optional; +using std::shared_ptr; +using std::string; +using std::vector; + +class Contact +{ +public: + Contact(const Contact &) = default; + Contact(Contact &&) = default; + Contact & operator=(const Contact &) = default; + Contact & operator=(Contact &&) = default; + + static List prepend(const Storage &, Identity, List); + + Identity identity() const; + optional name() const; + + bool operator==(const Contact &) const; + bool operator!=(const Contact &) const; + + static List loadList(const vector &); + vector refs() const; + +private: + struct Priv; + shared_ptr p; + Contact(shared_ptr p): p(p) {} +}; + +DECLARE_SHARED_TYPE(List) + +} -- cgit v1.2.3