@@ -509,98 +509,95 @@ static void setGroupedCombination(C& comb, TG& grouping, std::tuple<Ts...>& asso
509509 }
510510}
511511
512- } // namespace analysis_task_parsers
512+ // / Preslice handling
513+ template <typename T>
514+ bool registerCache (T&, std::vector<StringPair>&, std::vector<StringPair>&)
515+ {
516+ return false ;
517+ }
513518
514- template <typename ANY>
515- struct UpdateProcessSwitches {
516- static bool set (std::pair<std::string, bool >, ANY&)
517- {
518- return false ;
519- }
520- };
521-
522- template <typename R, typename T, typename ... As>
523- struct UpdateProcessSwitches <ProcessConfigurable<R, T, As...>> {
524- static bool set (std::pair<std::string, bool > setting, ProcessConfigurable<R, T, As...>& what)
525- {
526- if (what.name == setting.first ) {
527- what.value = setting.second ;
519+ template <is_preslice T>
520+ requires std::same_as<typename T::policy_t , framework::PreslicePolicySorted>
521+ bool registerCache (T& preslice, std::vector<StringPair>& bsks, std::vector<StringPair>&)
522+ {
523+ if constexpr (T::optional) {
524+ if (preslice.binding == " [MISSING]" ) {
528525 return true ;
529526 }
530- return false ;
531527 }
532- };
533-
534- // / Manager template to handle slice caching
535- template <typename T>
536- struct PresliceManager {
537- static bool registerCache (T&, std::vector<StringPair>&, std::vector<StringPair>&)
538- {
539- return false ;
528+ auto locate = std::find_if (bsks.begin (), bsks.end (), [&](auto const & entry) { return (entry.first == preslice.bindingKey .first ) && (entry.second == preslice.bindingKey .second ); });
529+ if (locate == bsks.end ()) {
530+ bsks.emplace_back (preslice.getBindingKey ());
540531 }
532+ return true ;
533+ }
541534
542- static bool updateSliceInfo (T&, ArrowTableSlicingCache&)
543- {
544- return false ;
545- }
546- };
547-
548- template <typename T, typename Policy, bool OPT>
549- struct PresliceManager <PresliceBase<T, Policy, OPT>> {
550- static bool registerCache (PresliceBase<T, Policy, OPT>& container, std::vector<StringPair>& bsks, std::vector<StringPair>&)
551- requires std::same_as<Policy, framework::PreslicePolicySorted>
552- {
553- if constexpr (OPT) {
554- if (container.binding == " [MISSING]" ) {
555- return true ;
556- }
557- }
558- auto locate = std::find_if (bsks.begin (), bsks.end (), [&](auto const & entry) { return (entry.first == container.bindingKey .first ) && (entry.second == container.bindingKey .second ); });
559- if (locate == bsks.end ()) {
560- bsks.emplace_back (container.getBindingKey ());
535+ template <is_preslice T>
536+ requires std::same_as<typename T::policy_t , framework::PreslicePolicyGeneral>
537+ bool registerCache (T& preslice, std::vector<StringPair>&, std::vector<StringPair>& bsksU)
538+ {
539+ if constexpr (T::optional) {
540+ if (preslice.binding == " [MISSING]" ) {
541+ return true ;
561542 }
562- return true ;
563543 }
544+ auto locate = std::find_if (bsksU.begin (), bsksU.end (), [&](auto const & entry) { return (entry.first == preslice.bindingKey .first ) && (entry.second == preslice.bindingKey .second ); });
545+ if (locate == bsksU.end ()) {
546+ bsksU.emplace_back (preslice.getBindingKey ());
547+ }
548+ return true ;
549+ }
564550
565- static bool registerCache (PresliceBase<T, Policy, OPT>& container, std::vector<StringPair>&, std::vector<StringPair>& bsksU)
566- requires std::same_as<Policy, framework::PreslicePolicyGeneral>
567- {
568- if constexpr (OPT) {
569- if (container.binding == " [MISSING]" ) {
570- return true ;
571- }
572- }
573- auto locate = std::find_if (bsksU.begin (), bsksU.end (), [&](auto const & entry) { return (entry.first == container.bindingKey .first ) && (entry.second == container.bindingKey .second ); });
574- if (locate == bsksU.end ()) {
575- bsksU.emplace_back (container.getBindingKey ());
551+ template <typename T>
552+ bool updateSliceInfo (T&, ArrowTableSlicingCache&)
553+ {
554+ return false ;
555+ }
556+
557+ template <is_preslice T>
558+ static bool updateSliceInfo (T& preslice, ArrowTableSlicingCache& cache)
559+ requires std::same_as<typename T::policy_t, framework::PreslicePolicySorted>
560+ {
561+ if constexpr (T::optional) {
562+ if (preslice.binding == " [MISSING]" ) {
563+ return true ;
576564 }
577- return true ;
578565 }
566+ preslice.updateSliceInfo (cache.getCacheFor (preslice.getBindingKey ()));
567+ return true ;
568+ }
579569
580- static bool updateSliceInfo (PresliceBase<T, Policy, OPT>& container, ArrowTableSlicingCache& cache)
581- requires std::same_as<Policy, framework::PreslicePolicySorted>
582- {
583- if constexpr (OPT) {
584- if (container. binding == " [MISSING] " ) {
585- return true ;
586- }
570+ template <is_preslice T>
571+ static bool updateSliceInfo (T& preslice, ArrowTableSlicingCache& cache)
572+ requires std::same_as<typename T::policy_t, framework::PreslicePolicyGeneral>
573+ {
574+ if constexpr (T::optional ) {
575+ if (preslice. binding == " [MISSING] " ) {
576+ return true ;
587577 }
588- container.updateSliceInfo (cache.getCacheFor (container.getBindingKey ()));
589- return true ;
590578 }
579+ preslice.updateSliceInfo (cache.getCacheUnsortedFor (preslice.getBindingKey ()));
580+ return true ;
581+ }
591582
592- static bool updateSliceInfo (PresliceBase<T, Policy, OPT>& container, ArrowTableSlicingCache& cache)
593- requires std::same_as<Policy, framework::PreslicePolicyGeneral>
594- {
595- if constexpr (OPT) {
596- if (container.binding == " [MISSING]" ) {
597- return true ;
598- }
599- }
600- container.updateSliceInfo (cache.getCacheUnsortedFor (container.getBindingKey ()));
583+ // / Process switches handling
584+ template <typename T>
585+ static bool setProcessSwitch (std::pair<std::string, bool >, T&)
586+ {
587+ return false ;
588+ }
589+
590+ template <is_process_configurable T>
591+ static bool setProcessSwitch (std::pair<std::string, bool > setting, T& pc)
592+ {
593+ if (pc.name == setting.first ) {
594+ pc.value = setting.second ;
601595 return true ;
602596 }
603- };
597+ return false ;
598+ }
599+
600+ } // namespace analysis_task_parsers
604601} // namespace o2::framework
605602
606603#endif // ANALYSISMANAGERS_H
0 commit comments