|
- #pragma once
-
- #include <ecs/config.h>
- #include <ecs/core/system/data_proxy/base.h>
-
- namespace ecs {
- namespace core {
- namespace system {
- namespace data_proxy {
-
- /**
- * data proxy to execute system non-parallel
- *
- * @tparam T_context context type of the ECS environment
- * @tparam T_instance system instance type
- */
- template<typename T_context, typename T_instance>
- struct single
- : public base<T_context, T_instance>
- {
- private:
- using context_type = T_context;
- using instance_type = T_instance;
- using base_type = base<context_type, instance_type>;
-
- public:
- using base_type::base_type;
-
- /**
- * execute the given function for all entities handled by this data proxy
- *
- * @tparam T_func function type to execute
- *
- * @param func function to execute
- */
- template<typename T_func>
- inline void for_entities(T_func&& func) const;
-
- /**
- * execute the given function for all entities not handled by this data proxy
- *
- * @tparam T_func function type to execute
- *
- * @param func function to execute
- */
- template<typename T_func>
- inline void for_other_entities(T_func&& func) const;
-
- /**
- * execute the given function for all entities
- *
- * @tparam T_func function type to execute
- *
- * @param func function to execute
- */
- template<typename T_func>
- inline void for_all_entities(T_func&& func) const;
-
- /**
- * get the number of entities handled by this data proxy
- *
- * @return number of entities handle by this data proxy
- */
- inline size_t entity_count() const;
-
- /**
- * get the number of entities not handled by this data proxy
- *
- * @return number of entities not handle by this data proxy
- */
- inline size_t other_entity_count() const;
-
- /**
- * get the number of all entities
- *
- * @return number of all entities
- */
- inline size_t all_entity_count() const;
- };
-
- /**
- * create a single data proxy (data proxy that does not execute in parallel)
- *
- * @tparam T_context context type
- * @tparam T_instance instance type
- *
- * @param context context
- * @param instance instance
- *
- * @return single data proxy
- */
- template<typename T_context, typename T_instance>
- constexpr decltype(auto) make_single(T_context&& context, T_instance&& instance);
-
- } } } }
|