dune-istl  2.6-git
combinedfunctor.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_AMG_COMBINEDFUNCTOR_HH
4 #define DUNE_AMG_COMBINEDFUNCTOR_HH
5 
6 #include <tuple>
7 
8 #include <dune/common/unused.hh>
9 
10 namespace Dune
11 {
12  namespace Amg
13  {
14 
15  template<std::size_t i>
16  struct ApplyHelper
17  {
18  template<class TT, class T>
19  static void apply(TT tuple, const T& t)
20  {
21  std::get<i-1>(tuple) (t);
22  ApplyHelper<i-1>::apply(tuple, t);
23  }
24  };
25  template<>
26  struct ApplyHelper<0>
27  {
28  template<class TT, class T>
29  static void apply(TT tuple, const T& t)
30  {
31  DUNE_UNUSED_PARAMETER(tuple);
32  DUNE_UNUSED_PARAMETER(t);
33  }
34  };
35 
36  template<typename T>
38  public T
39  {
40  public:
41  CombinedFunctor(const T& tuple)
42  : T(tuple)
43  {}
44 
45  template<class T1>
46  void operator()(const T1& t)
47  {
48  ApplyHelper<std::tuple_size<T>::value>::apply(*this, t);
49  }
50  };
51 
52 
53  } //namespace Amg
54 } // namespace Dune
55 #endif
Dune::Amg::ApplyHelper::apply
static void apply(TT tuple, const T &t)
Definition: combinedfunctor.hh:19
Dune::Amg::ApplyHelper< 0 >::apply
static void apply(TT tuple, const T &t)
Definition: combinedfunctor.hh:29
Dune::Amg::CombinedFunctor
Definition: combinedfunctor.hh:37
Dune::Amg::ApplyHelper
Definition: combinedfunctor.hh:16
Dune::Amg::CombinedFunctor::CombinedFunctor
CombinedFunctor(const T &tuple)
Definition: combinedfunctor.hh:41
Dune::Amg::CombinedFunctor::operator()
void operator()(const T1 &t)
Definition: combinedfunctor.hh:46
Dune::get
PropertyMapTypeSelector< Amg::VertexVisitedTag, Amg::PropertiesGraph< G, Amg::VertexProperties, EP, VM, EM > >::Type get(const Amg::VertexVisitedTag &tag, Amg::PropertiesGraph< G, Amg::VertexProperties, EP, VM, EM > &graph)
Definition: dependency.hh:292
Dune
Definition: allocator.hh:7