Skip to content

Draft: Cleanup: Make Adapters functors fully composition-friendly

Tommaso Fulghesu requested to merge tfulghes-cleanup-functors-adapters into master

This MR is not ready and needs additional work to adapt the decay products functors to V2

Address #433, with the intent of removing cpp implementation of functors MIN, MAX and SUM from Adapters.h and define them using composition based on MIN_ELEMENT, MAX_ELEMENT, SUM_RANGE functors respectively.

A consideration has to be done with the ambivalence of functionalities for SUM functor receiving either a Functor or a Predicate as argument.

Following comment #433 (comment 6257699), it will change the logic also of the other functors belonging to Adapters namespace, in favor of composition logic, i.e. every functor that is implemented wrapping another functor could be simplified decomposing this nested structure (apart for few cases...).

Needs !3224 (merged), Moore!1953 (closed)

Will require changes on Moore, and probably other projects...

TODO:

  • MIN, MAX and SUM functors were already designed for v2 Particle, it would be nice to make them work for SOA collections also using composition -> Make BasicsFromComposite, DescendantsFromComposite, GenerationFromComposite also for v2
  • Fix TestFunctors

cc: @mvesteri, @poluekt, @pkoppenb, @erodrigu

Edited by Tommaso Fulghesu

Merge request reports