From adfda73e1810973a40b7bedd9a8edc3e7ab89e3c Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 19 May 2018 12:05:57 +0800 Subject: =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=90=E7=B3=BB=E7=BB=9F=E5=9F=BA?= =?UTF-8?q?=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/common/subsystem.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/libjin/common/subsystem.h (limited to 'src/libjin/common/subsystem.h') diff --git a/src/libjin/common/subsystem.h b/src/libjin/common/subsystem.h new file mode 100644 index 0000000..a6c5099 --- /dev/null +++ b/src/libjin/common/subsystem.h @@ -0,0 +1,33 @@ +#ifndef __JIN_COMMON_SUBSYSTEM_H +#define __JIN_COMMON_SUBSYSTEM_H + +#include "../utils/macros.h" + +namespace jin +{ +namespace common +{ + + class Subsystem + { + public: + + struct Setting {}; + + bool init(const Setting* setting) + { + static bool result = _init(setting); + return result; + } + + typedef Subsystem::Setting SettingBase; + + private: + + virtual onlyonce bool _init(const Setting* setting) = 0; + }; + +} +} + +#endif \ No newline at end of file -- cgit v1.1-26-g67d0