summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2024-07-25 14:39:16 +0200
committerFelix Morgner <felix.morgner@gmail.com>2024-07-25 14:39:16 +0200
commit2b9ad3fbcbea86bd2cf702ff4c6e603c33492e45 (patch)
tree762f3a71b3b7f212c7167e49d370cb297d33d45d /core/include
parent9ec62f964df0070cb13df4e1de3d52dc7f27189b (diff)
downloadturns-2b9ad3fbcbea86bd2cf702ff4c6e603c33492e45.tar.xz
turns-2b9ad3fbcbea86bd2cf702ff4c6e603c33492e45.zip
core/participant: implement basic serialization
Diffstat (limited to 'core/include')
-rw-r--r--core/include/turns/core/participant.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/include/turns/core/participant.hpp b/core/include/turns/core/participant.hpp
index 8568b03..cd99fbb 100644
--- a/core/include/turns/core/participant.hpp
+++ b/core/include/turns/core/participant.hpp
@@ -8,6 +8,8 @@
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
+#include <nlohmann/json_fwd.hpp>
+
#include <compare>
namespace turns::core
@@ -15,6 +17,7 @@ namespace turns::core
struct participant : Glib::Object
{
auto static create(Glib::ustring name, float priority, disposition disposition) -> Glib::RefPtr<participant>;
+ auto static create(nlohmann::json const & serialized) -> Glib::RefPtr<participant>;
participant();
participant(Glib::ustring name, float priority, disposition disposition);
@@ -45,6 +48,8 @@ namespace turns::core
return self.m_priority.get_proxy();
}
+ auto serialize() -> nlohmann::json;
+
private:
Glib::Property<core::disposition> m_disposition{*this, "disposition", core::disposition::neutral};
Glib::Property<bool> m_is_active{*this, "active", false};