Classes | |
class | ExcIndexRange |
Public Types | |
typedef Types< N, T, C > ::value_type | value_type |
typedef value_type * | pointer |
typedef const value_type * | const_pointer |
typedef value_type * | iterator |
typedef const value_type * | const_iterator |
typedef value_type & | reference |
typedef const value_type & | 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 pointer data) | |
Accessor () | |
Private Attributes | |
const TableType & | table |
const pointer | data |
Friends | |
class | ::Table |
class | Accessor |
class | ::Table< 2, T > |
class | Accessor< N, T, C, 2 > |
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.
typedef value_type* internal::TableBaseAccessors::Accessor< N, T, C, 1 >::pointer |
typedef const value_type* internal::TableBaseAccessors::Accessor< N, T, C, 1 >::const_pointer |
typedef value_type* internal::TableBaseAccessors::Accessor< N, T, C, 1 >::iterator |
typedef const value_type* internal::TableBaseAccessors::Accessor< N, T, C, 1 >::const_iterator |
typedef value_type& internal::TableBaseAccessors::Accessor< N, T, C, 1 >::reference |
typedef const value_type& internal::TableBaseAccessors::Accessor< N, T, C, 1 >::const_reference |
typedef size_t internal::TableBaseAccessors::Accessor< N, T, C, 1 >::size_type |
typedef ptrdiff_t internal::TableBaseAccessors::Accessor< N, T, C, 1 >::difference_type |
typedef Types<N,T,C>::TableType internal::TableBaseAccessors::Accessor< N, T, C, 1 >::TableType |
Import a typedef from the switch class above.
internal::TableBaseAccessors::Accessor< N, T, C, 1 >::Accessor | ( | const TableType & | table, | |
const pointer | 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 (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.
internal::TableBaseAccessors::Accessor< N, T, C, 1 >::Accessor | ( | ) | [private] |
Default constructor. Not needed, so private.
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.
reference internal::TableBaseAccessors::Accessor< N, T, C, 1 >::operator[] | ( | const unsigned | int | ) | const |
Index operator. Performs a range check.
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.
iterator internal::TableBaseAccessors::Accessor< N, T, C, 1 >::begin | ( | ) | const |
Return an iterator to the first element of this row.
iterator internal::TableBaseAccessors::Accessor< N, T, C, 1 >::end | ( | ) | const |
Return an interator to the element past the end of this row.
friend class ::Table [friend] |
friend class Accessor [friend] |
friend class ::Table< 2, T > [friend] |
friend class Accessor< N, T, C, 2 > [friend] |
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.
const pointer internal::TableBaseAccessors::Accessor< N, T, C, 1 >::data [private] |