17 using IBase = IBuilder<Base, Components ...>;
25 if (name !=
nullptr) {
27 entity_desc.
name = name;
28 entity_desc.
sep =
"::";
35 : IBase(&desc_, f.term_index_)
42 :
node_builder<T, TDesc, Base, IBuilder, Components...>(f) { }
44 template <
typename Func>
47 typename std::decay<Func>::type>;
49 auto ctx = FLECS_NEW(Delegate)(FLECS_FWD(func));
50 desc_.run = Delegate::run;
52 desc_.run_ctx_free = _::free_obj<Delegate>;
53 return T(world_, &desc_);
56 template <
typename Func,
typename EachFunc>
57 T run(Func&& func, EachFunc&& each_func) {
59 typename std::decay<Func>::type>;
61 auto ctx = FLECS_NEW(Delegate)(FLECS_FWD(func));
62 desc_.run = Delegate::run;
64 desc_.run_ctx_free = _::free_obj<Delegate>;
65 return each(FLECS_FWD(each_func));
68 template <
typename Func>
71 typename std::decay<Func>::type, Components...>;
72 auto ctx = FLECS_NEW(Delegate)(FLECS_FWD(func));
73 desc_.callback = Delegate::run;
74 desc_.callback_ctx = ctx;
75 desc_.callback_ctx_free = _::free_obj<Delegate>;
76 return T(world_, &desc_);
79 template <
typename Func>
80 T run_each(Func&& func) {
82 typename std::decay<Func>::type, Components...>;
83 auto ctx = FLECS_NEW(Delegate)(FLECS_FWD(func));
84 desc_.run = Delegate::run_each;
86 desc_.run_ctx_free = _::free_obj<Delegate>;
87 return T(world_, &desc_);