Reference documentation for deal.II version Git bd3320ea57 2020-10-28 09:57:54 +0100
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
internal::TableBaseAccessors::Accessor< N, T, C, 1 > Class Template Reference

#include <deal.II/base/table.h>

Public Types

using value_type = typename Types< N, T, C >::value_type
 
using iterator = typename Types< N, T, C >::iterator
 
using const_iterator = typename Types< N, T, C >::const_iterator
 
using reference = typename Types< N, T, C >::reference
 
using const_reference = typename Types< N, T, C >::const_reference
 
using size_type = size_t
 
using difference_type = ptrdiff_t
 
using TableType = typename Types< N, T, C >::TableType
 

Public Member Functions

 Accessor (const Accessor &a)
 
reference operator[] (const size_type) const
 
size_type size () const
 
iterator begin () const
 
iterator end () const
 

Private Member Functions

 Accessor (const TableType &table, const iterator data)
 

Private Attributes

const TableTypetable
 
const iterator data
 

Friends

template<int N1, typename T1 >
class ::Table
 
template<int N1, typename T1 , bool C1, unsigned int P1>
class Accessor
 
class ::Table< 2, T >
 
class Accessor< N, T, C, 2 >
 

Detailed Description

template<int N, typename T, bool C>
class internal::TableBaseAccessors::Accessor< N, T, C, 1 >

Definition at line 237 of file table.h.

Member Typedef Documentation

◆ value_type

template<int N, typename T , bool C>
using internal::TableBaseAccessors::Accessor< N, T, C, 1 >::value_type = typename Types<N, T, C>::value_type

Typedef constant and non-constant iterator types to the elements of this row, as well as all the other types usually required for the standard library algorithms.

Definition at line 245 of file table.h.

◆ iterator

template<int N, typename T , bool C>
using internal::TableBaseAccessors::Accessor< N, T, C, 1 >::iterator = typename Types<N, T, C>::iterator

Definition at line 247 of file table.h.

◆ const_iterator

template<int N, typename T , bool C>
using internal::TableBaseAccessors::Accessor< N, T, C, 1 >::const_iterator = typename Types<N, T, C>::const_iterator

Definition at line 248 of file table.h.

◆ reference

template<int N, typename T , bool C>
using internal::TableBaseAccessors::Accessor< N, T, C, 1 >::reference = typename Types<N, T, C>::reference

Definition at line 250 of file table.h.

◆ const_reference

template<int N, typename T , bool C>
using internal::TableBaseAccessors::Accessor< N, T, C, 1 >::const_reference = typename Types<N, T, C>::const_reference

Definition at line 251 of file table.h.

◆ size_type

template<int N, typename T , bool C>
using internal::TableBaseAccessors::Accessor< N, T, C, 1 >::size_type = size_t

Definition at line 253 of file table.h.

◆ difference_type

template<int N, typename T , bool C>
using internal::TableBaseAccessors::Accessor< N, T, C, 1 >::difference_type = ptrdiff_t

Definition at line 254 of file table.h.

◆ TableType

template<int N, typename T , bool C>
using internal::TableBaseAccessors::Accessor< N, T, C, 1 >::TableType = typename Types<N, T, C>::TableType

Import an alias from the switch class above.

Definition at line 259 of file table.h.

Constructor & Destructor Documentation

◆ Accessor() [1/2]

template<int N, typename T , bool C>
internal::TableBaseAccessors::Accessor< N, T, C, 1 >::Accessor ( const TableType table,
const iterator  data 
)
private

Constructor. Take an iterator to the table object to know about the sizes of the various dimensions, and a iterator to the subset of data we may access (which in this particular case is only one row).

The constructor is made private in order to prevent you having such objects around. The only way to create such objects is via the Table class, which only generates them as temporary objects. This guarantees that the accessor objects go out of scope earlier than the mother object, avoid problems with data consistency.

◆ Accessor() [2/2]

template<int N, typename T , bool C>
internal::TableBaseAccessors::Accessor< N, T, C, 1 >::Accessor ( const Accessor< N, T, C, 1 > &  a)

Copy constructor. This constructor is public so that one can pass sub-tables to functions as arguments, as in f(table[i]).

Using this constructor is risky if accessors are stored longer than the table it points to. Don't do this.

Member Function Documentation

◆ operator[]()

template<int N, typename T , bool C>
reference internal::TableBaseAccessors::Accessor< N, T, C, 1 >::operator[] ( const size_type  ) const

Index operator. Performs a range check.

◆ size()

template<int N, typename T , bool C>
size_type internal::TableBaseAccessors::Accessor< N, T, C, 1 >::size ( ) const

Return the length of one row, i.e. the number of elements corresponding to the last index of the table object.

◆ begin()

template<int N, typename T , bool C>
iterator internal::TableBaseAccessors::Accessor< N, T, C, 1 >::begin ( ) const

Return an iterator to the first element of this row.

◆ end()

template<int N, typename T , bool C>
iterator internal::TableBaseAccessors::Accessor< N, T, C, 1 >::end ( ) const

Return an iterator to the element past the end of this row.

Friends And Related Function Documentation

◆ ::Table

template<int N, typename T , bool C>
template<int N1, typename T1 >
friend class ::Table
friend

Definition at line 323 of file table.h.

◆ Accessor

template<int N, typename T , bool C>
template<int N1, typename T1 , bool C1, unsigned int P1>
friend class Accessor
friend

Definition at line 325 of file table.h.

◆ ::Table< 2, T >

template<int N, typename T , bool C>
friend class ::Table< 2, T >
friend

Definition at line 326 of file table.h.

◆ Accessor< N, T, C, 2 >

template<int N, typename T , bool C>
friend class Accessor< N, T, C, 2 >
friend

Definition at line 327 of file table.h.

Member Data Documentation

◆ table

template<int N, typename T , bool C>
const TableType& internal::TableBaseAccessors::Accessor< N, T, C, 1 >::table
private

Store the data given to the constructor. There are no non-const member functions of this class, so there is no reason not to make these elements constant.

Definition at line 315 of file table.h.

◆ data

template<int N, typename T , bool C>
const iterator internal::TableBaseAccessors::Accessor< N, T, C, 1 >::data
private

Definition at line 316 of file table.h.


The documentation for this class was generated from the following file: