14 template <
typename F,
typename Ret,
typename A,
typename... Rest>
15 A helper(Ret (F::*)(
A, Rest...));
17 template <
typename F,
typename Ret,
typename A,
typename... Rest>
18 A helper(Ret (F::*)(
A, Rest...)
const);
22 template <
typename FuncT>
25 using type =
decltype(helper(&FuncT::operator()));
28 template <
typename FuncT>
29 using first_argument_t =
typename first_argument<FuncT>::type;
38 template <
class FunctionT,
class ChildT>
40 call(FunctionT&& func, ChildT&& child)
42 if constexpr (std::is_same_v<
decltype(func(child)),
bool>)
58 template <
class ContainerT,
class FunctionT>
62 for (
auto& child : container)
64 if (not
call(func, child))
73 template <
class ContainerT,
class FunctionT>
77 for (
auto& [_, child] : container)
79 if (not
call(func, child))
90 template <
class,
class =
void>
101 template <
class ContainerT,
class FunctionT>
115 template <
class FunctionT,
class ParentT,
class ChildT>
123 auto childFn = [&id, &func](
auto& child) {
return child.forEachInstanceIn(
id, func); };
126 return child ? childFn(*child) :
true;
130 return parent.forEachChild(childFn);
137 template <
class DerivedT>
145 template <
class InstanceFunctionT>
150 [&func](
auto& snapshot) ->
bool {
return snapshot.forEachInstance(func); });
156 template <
class InstanceFunctionT>
161 [&func](
const auto& snapshot) ->
bool {
return snapshot.forEachInstance(func); });
178 template <
class AronDtoFunctionT>
182 using AronDtoT =
typename std::remove_const_t<
183 std::remove_reference_t<first_argument_t<AronDtoFunctionT>>>;
186 [&func](
const auto& instance)
187 {
return func(instance.template dataAs<AronDtoT>()); });
212 template <
class EntityInstanceBaseAronDtoFunctionT>
216 using AronDtoT =
typename std::remove_reference_t<
217 first_argument_t<EntityInstanceBaseAronDtoFunctionT>>::DataT;
220 [&func](
const auto& instance)
221 {
return func(instance.template withDataAs<AronDtoT>()); });
225 template <
class DerivedT>
231 template <
class SnapshotFunctionT>
236 {
return entity.forEachSnapshot(func); });
242 template <
class SnapshotFunctionT>
247 {
return entity.forEachSnapshot(func); });
251 template <
class DerivedT>
257 template <
class FunctionT>
262 [&func](
auto& providerSegment) ->
bool
263 {
return providerSegment.forEachEntity(func); });
269 template <
class FunctionT>
274 [&func](
const auto& providerSegment) ->
bool
275 {
return providerSegment.forEachEntity(func); });
279 template <
class DerivedT>
285 template <
class FunctionT>
290 [&func](
auto& coreSegment) ->
bool
291 {
return coreSegment.forEachProviderSegment(func); });
297 template <
class FunctionT>
302 [&func](
const auto& coreSegment) ->
bool
303 {
return coreSegment.forEachProviderSegment(func); });
class A(deque< T, A >)) ARMARX_OVERLOAD_STD_HASH_FOR_ITERABLE((class T
Enables hashing of std::list.
bool forEachChildPair(ContainerT &container, FunctionT &&func)
DerivedT & derived(ThisT *t)
bool forEachChildSingle(ContainerT &container, FunctionT &&func)
bool call(FunctionT &&func, ChildT &&child)
bool forEachInstanceIn(const MemoryID &id, FunctionT &&func, ParentT &parent, bool single, ChildT *child)
bool forEachChild(ContainerT &container, FunctionT &&func)
bool forEachInstanceWithDataAs(EntityInstanceBaseAronDtoFunctionT &&func) const
Call func on each instance with its data converted to Aron DTO class.
bool forEachInstanceAs(AronDtoFunctionT &&func) const
Call func on the data of each instance converted to Aron DTO class.
bool forEachInstance(InstanceFunctionT &&func)
bool forEachInstance(InstanceFunctionT &&func) const
bool forEachEntity(FunctionT &&func)
bool forEachEntity(FunctionT &&func) const
bool forEachSnapshot(SnapshotFunctionT &&func)
bool forEachSnapshot(SnapshotFunctionT &&func) const
bool forEachProviderSegment(FunctionT &&func) const
bool forEachProviderSegment(FunctionT &&func)