diff options
author | chai <chaifix@163.com> | 2018-05-19 12:05:57 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-05-19 12:05:57 +0800 |
commit | adfda73e1810973a40b7bedd9a8edc3e7ab89e3c (patch) | |
tree | 3ee6b9ad4f3c71b5cefc719c694e7a80f3df7088 /src/libjin/common/subsystem.h | |
parent | 3ce3b10167a98f45614408a8042a10c686f3a9cc (diff) |
增加子系统基类
Diffstat (limited to 'src/libjin/common/subsystem.h')
-rw-r--r-- | src/libjin/common/subsystem.h | 33 |
1 files changed, 33 insertions, 0 deletions
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 |