From 240edf7494745dc4df2128644fe5c1a73ec2d513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 29 Feb 2020 20:38:38 +0100 Subject: Network: service interface and handling --- include/erebos/service.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 include/erebos/service.h (limited to 'include/erebos/service.h') diff --git a/include/erebos/service.h b/include/erebos/service.h new file mode 100644 index 0000000..7a6f646 --- /dev/null +++ b/include/erebos/service.h @@ -0,0 +1,31 @@ +#pragma once + +#include + +namespace erebos { + +class Service +{ +public: + Service(); + virtual ~Service(); + + class Context + { + public: + struct Priv; + Context(Priv *); + Priv & priv(); + + const Ref & ref() const; + const class Peer & peer() const; + + private: + std::unique_ptr p; + }; + + virtual UUID uuid() const = 0; + virtual void handle(Context &) const = 0; +}; + +} -- cgit v1.2.3