25개 이상의 토픽을 선택하실 수 없습니다.
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #pragma once
-
- #include <ecs/config.h>
- #include <ecs/core/utils/scope_guard.h>
-
- #include "./step_proxy.h"
-
- beg_namespace_ecs_context
- {
-
- namespace __impl
- {
- template<typename T_settings>
- struct context_t
- : public step_proxy_t<T_settings>
- {
- private:
- using settings_type = T_settings;
- using step_proxy_type = step_proxy_t<settings_type>;
-
- private:
- void refresh()
- {
-
- }
-
- public:
- template<typename T_step_func>
- inline decltype(auto) step(T_step_func&& step_func)
- {
- ecs_make_scope_guard([this]{
- this->refresh();
- });
-
- std::forward<T_step_func>(step_func)(static_cast<step_proxy_type&>(*this));
- }
- };
-
- struct make_t
- {
- template<typename T_settings>
- constexpr decltype(auto) operator()(T_settings) const noexcept
- { return context_t<T_settings> { }; }
- };
-
- struct make_uptr_t
- {
- template<typename T_settings>
- constexpr decltype(auto) operator()(T_settings) const noexcept
- { return std::make_unique<context_t<T_settings>>(); }
- };
- }
-
- constexpr decltype(auto) make = __impl::make_t { };
-
- constexpr decltype(auto) make_uptr = __impl::make_uptr_t { };
-
- }
- end_namespace_ecs_context
|