From 7b3b5a76c396cfdc087bfb11194691cbc356e905 Mon Sep 17 00:00:00 2001 From: csoler Date: Wed, 1 Feb 2012 20:27:25 +0000 Subject: [PATCH] added RsPQIService to allow plugins based on peer-to-peer services git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4871 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- .../{pluginclasses.h => rscacheservice.h} | 0 libretroshare/src/plugins/rspqiservice.h | 25 +++++++++++++++++++ 2 files changed, 25 insertions(+) rename libretroshare/src/plugins/{pluginclasses.h => rscacheservice.h} (100%) create mode 100644 libretroshare/src/plugins/rspqiservice.h diff --git a/libretroshare/src/plugins/pluginclasses.h b/libretroshare/src/plugins/rscacheservice.h similarity index 100% rename from libretroshare/src/plugins/pluginclasses.h rename to libretroshare/src/plugins/rscacheservice.h diff --git a/libretroshare/src/plugins/rspqiservice.h b/libretroshare/src/plugins/rspqiservice.h new file mode 100644 index 000000000..00a3d2948 --- /dev/null +++ b/libretroshare/src/plugins/rspqiservice.h @@ -0,0 +1,25 @@ +#pragma once + +#include "plugins/pluginmanager.h" + +// The following class abstracts the construction of a peer-to-peer service. The user only has to +// supply RS with a type ID. If the ID is already in use, RS will complain. +// +class RsPQIService: public p3Config +{ + public: + RsPQIService(uint16_t type,uint32_t config_type,uint32_t tick_delay_in_seconds, RsPluginHandler* pgHandler) ; + + uint32_t tickDelay() const { return _tick_delay_in_seconds ; } + virtual void tick() {} + + // Functions from p3config + // + virtual RsSerialiser *setupSerialiser() { return NULL ; } + virtual bool saveList(bool&, std::list&) { return false ;} + virtual bool loadList(std::list&) { return false ;} + + private: + uint32_t _tick_delay_in_seconds ; +}; +