Belle II Software  release-05-01-25
CellHolder.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2017 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/utilities/IsApplicable.h>
13 
14 namespace Belle2 {
19  namespace TrackFindingCDC {
20  class AutomatonCell;
21 
23  struct GetAutomatonCell {
25  template<class T, class SFINAE = decltype(&T::getAutomatonCell)>
26  AutomatonCell & operator()(T& t)
27  {
28  return t.getAutomatonCell();
29  }
30  };
31 
38  template <class T>
39  constexpr bool isCellHolder()
40  {
41  return isApplicable<GetAutomatonCell, T&>();
42  }
43 
45  template <class T>
46  void static_assert_isCellHolder()
47  {
48  static_assert(isCellHolder<T>(), "Template argument must support the CellHolder concept, "
49  "i.e. it must support cellHolder.getAutomatonCell()");
50  }
51  }
53 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::GetAutomatonCell::operator()
AutomatonCell & operator()(T &t)
Returns the automaton cell of an object.
Definition: CellHolder.h:34