MiniEngine/include/SDLWrapper/__Plugin.h

40 lines
711 B
C++
Raw Normal View History

2017-07-01 16:29:04 +08:00
#pragma once
2018-03-04 15:10:49 +08:00
namespace MiniEngine {
2017-07-01 16:29:04 +08:00
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<typename T>
2017-07-01 17:21:35 +08:00
static decltype(auto) get(const T& obj)
2017-07-01 16:29:04 +08:00
{
return obj._get();
}
template<typename T,typename U>
2017-07-01 17:21:35 +08:00
static void set(T& obj,U&& value)
2017-07-01 16:29:04 +08:00
{
obj._set(value);
}
template<typename T>
2017-07-01 17:21:35 +08:00
static void clear(T& obj)
2017-07-01 16:29:04 +08:00
{
obj._clear();
}
template<typename T,typename U>
2017-07-01 17:21:35 +08:00
static void set_no_delete(T& obj,U&& value)
2017-07-01 16:29:04 +08:00
{
obj._set_no_delete(value);
}
};
}
2018-03-04 15:10:49 +08:00
} /// End of namespace MiniEngine