Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
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

Public Types

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

Public Member Functions

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

Private Member Functions

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

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

Member Typedef Documentation

template<int N, typename T , bool C>
typedef Types<N,T,C>::value_type internal::TableBaseAccessors::Accessor< N, T, C, 1 >::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 265 of file table.h.

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

Import a typedef from the switch class above.

Definition at line 280 of file table.h.

Constructor & Destructor Documentation

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.

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

Default constructor. Not needed, so private.

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

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

Index operator. Performs a range check.

template<int N, typename T , bool C>
unsigned int 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.

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.

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

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

Member Data Documentation

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


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