From f500a470f671cd07178111b6b921e4ae42af483c Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Sat, 1 Jul 2017 16:29:04 +0800 Subject: [PATCH] Add Plugin class --- SDLWrapper/__Plugin.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 SDLWrapper/__Plugin.h diff --git a/SDLWrapper/__Plugin.h b/SDLWrapper/__Plugin.h new file mode 100644 index 0000000..dd66522 --- /dev/null +++ b/SDLWrapper/__Plugin.h @@ -0,0 +1,36 @@ +#pragma once +#include "begin_code.h" +namespace _internal +{ + +/// This is just an empty class. +/// Most wrapper class regard this class as a friend class. +/// You can get/set raw pointers through this class. +class Plugin +{ +public: + template + decltype(auto) get(const T& obj) + { + return obj._get(); + } + template + void set(T& obj,U&& value) + { + obj._set(value); + } + template + void clear(T& obj) + { + obj._clear(); + } + + template + void set_no_delete(T& obj,U&& value) + { + obj._set_no_delete(value); + } +}; + +} +#include "end_code.h"