Reference documentation for deal.II version 9.6.1
 
\(\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\}}\)
Loading...
Searching...
No Matches
internal::TableBaseAccessors::Accessor< N, T, C, 1 > Class Template Reference

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

Inheritance diagram for internal::TableBaseAccessors::Accessor< N, T, C, 1 >:

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
 
using TableType
 
using iterator
 
using const_iterator
 
using size_type
 
using difference_type
 

Public Member Functions

 Accessor (const Accessor &a)
 
reference operator[] (const size_type) const
 
size_type size () const
 
iterator begin () const
 
iterator end () const
 
 Accessor (const Accessor &a)
 
Accessor< N, T, C, P - 1 > operator[] (const size_type i) const
 

Static Public Member Functions

static ::ExceptionBaseExcIndexRange (size_type arg1, size_type arg2, size_type arg3)
 

Private Member Functions

 Accessor (const TableType &table, const iterator data)
 
 Accessor (const TableType &table, const iterator data)
 

Private Attributes

const TableTypetable
 
const iterator data
 
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 >
 
class ::Table
 
class Accessor
 
class ::Table< N, T >
 
class Accessor< N, T, C, P+1 >
 

Detailed Description

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

Definition at line 238 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 246 of file table.h.

◆ iterator [1/2]

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 248 of file table.h.

◆ const_iterator [1/2]

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 249 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 251 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 252 of file table.h.

◆ size_type [1/2]

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

Definition at line 254 of file table.h.

◆ difference_type [1/2]

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

Definition at line 255 of file table.h.

◆ TableType [1/2]

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 260 of file table.h.

◆ TableType [2/2]

using internal::TableBaseAccessors::Accessor< N, T, C, P >::TableType

Definition at line 163 of file table.h.

◆ iterator [2/2]

using internal::TableBaseAccessors::Accessor< N, T, C, P >::iterator

Definition at line 165 of file table.h.

◆ const_iterator [2/2]

using internal::TableBaseAccessors::Accessor< N, T, C, P >::const_iterator

Definition at line 166 of file table.h.

◆ size_type [2/2]

using internal::TableBaseAccessors::Accessor< N, T, C, P >::size_type

Definition at line 168 of file table.h.

◆ difference_type [2/2]

using internal::TableBaseAccessors::Accessor< N, T, C, P >::difference_type

Definition at line 169 of file table.h.

Constructor & Destructor Documentation

◆ Accessor() [1/4]

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/4]

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.

◆ Accessor() [3/4]

internal::TableBaseAccessors::Accessor< N, T, C, P >::Accessor ( const TableType & table,
const iterator data )
private

Constructor. Take a pointer to the table object to know about the sizes of the various dimensions, and a pointer to the subset of data we may access.

◆ Accessor() [4/4]

internal::TableBaseAccessors::Accessor< N, T, C, P >::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[]() [1/2]

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.

◆ operator[]() [2/2]

Accessor< N, T, C, P - 1 > internal::TableBaseAccessors::Accessor< N, T, C, P >::operator[] ( const size_type i) const

Index operator. Performs a range check.

◆ ExcIndexRange()

static ::ExceptionBase & internal::TableBaseAccessors::Accessor< N, T, C, P >::ExcIndexRange ( size_type arg1,
size_type arg2,
size_type arg3 )
static

Exception for range check. Do not use global exception since this way we can output which index is the wrong one.

Note
The message that will be printed by this exception reads:
<< "Index " << N - P + 1 << "has a value of " << arg1 << " but needs to be in the range [" << arg2 << ',' << arg3 << "[."

Friends And Related Symbol Documentation

◆ ::Table [1/2]

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

Definition at line 325 of file table.h.

◆ Accessor [1/2]

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

Definition at line 327 of file table.h.

◆ ::Table< 2, T >

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

Definition at line 327 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.

◆ ::Table [2/2]

friend class ::Table
friend

Definition at line 221 of file table.h.

◆ Accessor [2/2]

friend class Accessor
friend

Definition at line 223 of file table.h.

◆ ::Table< N, T >

friend class ::Table< N, T >
friend

Definition at line 223 of file table.h.

◆ Accessor< N, T, C, P+1 >

friend class Accessor< N, T, C, P+1 >
friend

Definition at line 223 of file table.h.

Member Data Documentation

◆ table [1/2]

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 317 of file table.h.

◆ data [1/2]

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

Definition at line 318 of file table.h.

◆ table [2/2]

const TableType& internal::TableBaseAccessors::Accessor< N, T, C, P >::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 213 of file table.h.

◆ data [2/2]

const iterator internal::TableBaseAccessors::Accessor< N, T, C, P >::data
private

Definition at line 214 of file table.h.


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