dune-geometry 3.0-git
codimtable.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
4#ifndef DUNE_GEOMETRY_GENERICGEOMETRY_CODIMTABLE_HH
5#define DUNE_GEOMETRY_GENERICGEOMETRY_CODIMTABLE_HH
6
7#include <dune/common/typetraits.hh>
8#include <dune/common/tupleutility.hh>
9#include <dune/common/unused.hh>
10
11namespace Dune
12{
13
14 namespace GenericGeometry
15 {
16
17 template< template< int > class Element, int dim >
19 {
20 friend class CodimTable< Element, dim+1 >;
21
22 typedef typename PushBackTuple<
23 typename CodimTable< Element, dim-1 >::ElementTuple,
24 Element< dim > >::type ElementTuple;
25
26 ElementTuple map_;
27
28 public:
29
30 template< int codim >
31 const Element< codim > &
32 operator[] ( const std::integral_constant< int, codim > codimVariable ) const
33 {
34 DUNE_UNUSED_PARAMETER(codimVariable);
35 return std::get<codim>(map_);
36 }
37
38 template< int codim >
39 Element< codim > &
40 operator[] ( const std::integral_constant< int, codim > codimVariable )
41 {
42 DUNE_UNUSED_PARAMETER(codimVariable);
43 return std::get<codim>(map_);
44 }
45 };
46
47
48 template< template< int > class Element>
49 class CodimTable< Element, -1 >
50 {
51 friend class CodimTable< Element, 0 >;
52 typedef typename std::tuple<> ElementTuple;
53 };
54
55 }
56
57}
58
59#endif // #ifndef DUNE_GEOMETRY_GENERICGEOMETRY_CODIMTABLE_HH
Definition affinegeometry.hh:19
Definition codimtable.hh:19
const Element< codim > & operator[](const std::integral_constant< int, codim > codimVariable) const
Definition codimtable.hh:32