Belle II Software  release-08-01-10
Findlet.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #pragma once
9 
10 #include <tracking/trackFindingCDC/utilities/CompositeProcessingSignalListener.h>
11 
12 #include <vector>
13 #include <tuple>
14 #include <string>
15 
16 namespace Belle2 {
21  class ModuleParamList;
22 
23  namespace TrackFindingCDC {
25  template<class ... AIOTypes>
27 
28  public:
30  using IOTypes = std::tuple<AIOTypes...>;
31 
32  protected:
34  template<class T>
35  struct ToVectorImpl {
37  using Type = std::vector<typename std::remove_reference<T>::type>;
38  };
39 
41  template<class T>
42  struct ToVectorImpl<const T> {
44  using Type = const std::vector<typename std::remove_reference<T>::type>;
45  };
46 
48  template<class T>
49  using ToVector = typename ToVectorImpl<T>::Type;
50 
51  public:
53  using IOVectors = std::tuple< std::vector<AIOTypes>... >;
54 
56  virtual ~Findlet() = default;
57 
58  public:
60  virtual std::string getDescription()
61  {
62  return "(no description)";
63  }
64 
69  virtual void exposeParameters(ModuleParamList* moduleParamList __attribute__((unused)),
70  const std::string& prefix __attribute__((unused)))
71  {
72  }
73 
75  virtual void apply(ToVector<AIOTypes>& ... ioVectors) = 0;
76  };
77  }
79 }
The Module parameter list class.
Partial implemenation for an algorithm part that wants to dispatch processing signals to subobjects.
Interface for a minimal algorithm part that wants to expose some parameters to a module.
Definition: Findlet.h:26
virtual void apply(ToVector< AIOTypes > &... ioVectors)=0
Main function executing the algorithm.
std::tuple< std::vector< AIOTypes >... > IOVectors
Vector types that should be served to apply on invokation.
Definition: Findlet.h:53
virtual ~Findlet()=default
Make destructor of interface virtual.
std::tuple< AIOTypes... > IOTypes
Types that should be served to apply on invokation.
Definition: Findlet.h:30
virtual std::string getDescription()
Brief description of the purpose of the concret findlet.
Definition: Findlet.h:60
virtual void exposeParameters(ModuleParamList *moduleParamList, const std::string &prefix)
Forward prefixed parameters of this findlet to the module parameter list.
Definition: Findlet.h:69
typename ToVectorImpl< T >::Type ToVector
Short hand for ToRangeImpl.
Definition: Findlet.h:49
Abstract base class for different kinds of events.
const std::vector< typename std::remove_reference< T >::type > Type
An immutable range of Ts.
Definition: Findlet.h:44
Forward a range of mutable objects.
Definition: Findlet.h:35
std::vector< typename std::remove_reference< T >::type > Type
A mutable range of Ts.
Definition: Findlet.h:37