1#ifndef DUNE_GEOMETRY_TYPEMAP_HH
2#define DUNE_GEOMETRY_TYPEMAP_HH
7#include <dune/geometry/type.hh>
45 template<
class T,
class TypeIndexSet >
47 :
private TypeIndexSet
50 typedef std::array< T, TypeIndexSet::size() > Container;
52 using TypeIndexSet::index;
62 typedef typename Container::pointer
pointer;
127 static constexpr Size size () noexcept {
return TypeIndexSet::size(); }
131 static constexpr bool empty () noexcept {
return (
size() > 0); }
147 const Value &
at (
const GeometryType &
type )
const {
return container_.at( index(
type ) ); }
157 const Value &
back ()
const {
return container_.back(); }
162 const Value *
data () const noexcept {
return container_.data(); }
171 void fill (
const Value &value ) { container_.fill( value ); }
174 void swap (
This &other )
noexcept(
noexcept(
swap(std::declval<Value &>(), std::declval<Value &>())))
176 container_.swap( other.container_ );
182 Container container_;
198 template<
class T,
int dim,
bool regular = false >
200 :
public GeometryTypeMap< T, LocalGeometryTypeIndexSet< dim, regular > >
216 template<
class T,
int maxdim,
bool regular = false >
218 :
public GeometryTypeMap< T, GlobalGeometryTypeIndexSet< maxdim, regular > >
Definition: bindguard.hh:11
associative container assigning values to each GeometryType
Definition: typemap.hh:48
Container::value_type value_type
value type
Definition: typemap.hh:56
static constexpr Size max_size() noexcept
return maximum size
Definition: typemap.hh:129
const Value * data() const noexcept
get pointer to data
Definition: typemap.hh:162
static constexpr Size size() noexcept
return size
Definition: typemap.hh:127
void fill(const Value &value)
fill container with value
Definition: typemap.hh:171
Container::const_pointer const_pointer
const pointer type
Definition: typemap.hh:64
GeometryType type(ConstIterator iterator) const
return geometry type from given iterator
Definition: typemap.hh:115
Container::iterator iterator
iterator type
Definition: typemap.hh:66
size_type Size
size type
Definition: typemap.hh:81
ConstIterator begin() const noexcept
return iterator to beginning
Definition: typemap.hh:92
Container::size_type size_type
size type
Definition: typemap.hh:70
Value & back()
access last element
Definition: typemap.hh:155
Container::const_iterator const_iterator
const iterator type
Definition: typemap.hh:68
void swap(This &other) noexcept(noexcept(swap(std::declval< Value & >(), std::declval< Value & >())))
swap content
Definition: typemap.hh:174
Iterator end() noexcept
return iterator to end
Definition: typemap.hh:90
Container::pointer pointer
pointer type
Definition: typemap.hh:62
Value * data() noexcept
get pointer to data
Definition: typemap.hh:160
iterator Iterator
iterator type
Definition: typemap.hh:77
const Value & front() const
access first element
Definition: typemap.hh:152
const Value & at(const GeometryType &type) const
access element
Definition: typemap.hh:147
Iterator begin() noexcept
return iterator to beginning
Definition: typemap.hh:88
GeometryType type(Iterator iterator) const
return geometry type from given iterator
Definition: typemap.hh:109
Container::const_reference const_reference
const reference type
Definition: typemap.hh:60
Value & operator[](const GeometryType &type)
access element
Definition: typemap.hh:140
Value & front()
access first element
Definition: typemap.hh:150
value_type Value
value type
Definition: typemap.hh:75
static constexpr bool empty() noexcept
test whether container is empty
Definition: typemap.hh:131
ConstIterator cbegin() const noexcept
return const_iterator to beginning
Definition: typemap.hh:97
Container::reference reference
reference type
Definition: typemap.hh:58
Container::difference_type difference_type
difference type
Definition: typemap.hh:72
Value & at(const GeometryType &type)
access element
Definition: typemap.hh:145
const Value & back() const
access last element
Definition: typemap.hh:157
ConstIterator end() const noexcept
return iterator to end
Definition: typemap.hh:94
ConstIterator cend() const noexcept
return const_iterator to end
Definition: typemap.hh:99
const_iterator ConstIterator
iterator type
Definition: typemap.hh:79
Please doc me.
Definition: typemap.hh:201
Please doc me.
Definition: typemap.hh:219