rutz::static_block< T, N > Struct Template Reference

A simple wrapper around a C-style array. More...

#include <rutz/arrays.h>

Collaboration diagram for rutz::static_block< T, N >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef T value_type
 STL value type.
typedef T * pointer
 STL pointer type.
typedef const T * const_pointer
 STL const pointer type.
typedef T & reference
 STL reference type.
typedef const T & const_reference
 STL const reference type.
typedef pointer iterator
 STL iterator type.
typedef const_pointer const_iterator
 STL const iterator type.
typedef size_t size_type
 STL size type.
typedef ptrdiff_t difference_type
 STL iterator difference type.

Public Member Functions

iterator begin ()
 Iterator to array start.
iterator end ()
 Iterator to array one-past-the-end.
const_iterator begin () const
 Const iterator to array start.
const_iterator end () const
 Const iterator to array one-past-the-end.
reference operator[] (size_type n)
 Unchecked non-const array index.
const_reference operator[] (size_type n) const
 Unchecked const array index.
reference at (size_type n)
 Checked non-const array index (rutz::out_of_range on bounds error).
const_reference at (size_type n) const
 Checked const array index (rutz::out_of_range on bounds error).
size_type size () const
 Size of array.
size_type max_size () const
 Maximum size of array type.
bool is_empty () const
 Query whether size is zero.
void swap (static_block &other)
 Swap data with another array.

Public Attributes

data [N]

Detailed Description

template<class T, size_t N>
struct rutz::static_block< T, N >

A simple wrapper around a C-style array.

static_block provides an STL-style container interface, including both checked and unchecked access, as well as access to the container's size with the size() member function.

Definition at line 87 of file arrays.h.


Member Typedef Documentation

template<class T , size_t N>
typedef const_pointer rutz::static_block< T, N >::const_iterator

STL const iterator type.

Definition at line 97 of file arrays.h.

template<class T , size_t N>
typedef const T* rutz::static_block< T, N >::const_pointer

STL const pointer type.

Definition at line 92 of file arrays.h.

template<class T , size_t N>
typedef const T& rutz::static_block< T, N >::const_reference

STL const reference type.

Definition at line 94 of file arrays.h.

template<class T , size_t N>
typedef ptrdiff_t rutz::static_block< T, N >::difference_type

STL iterator difference type.

Definition at line 100 of file arrays.h.

template<class T , size_t N>
typedef pointer rutz::static_block< T, N >::iterator

STL iterator type.

Definition at line 96 of file arrays.h.

template<class T , size_t N>
typedef T* rutz::static_block< T, N >::pointer

STL pointer type.

Definition at line 91 of file arrays.h.

template<class T , size_t N>
typedef T& rutz::static_block< T, N >::reference

STL reference type.

Definition at line 93 of file arrays.h.

template<class T , size_t N>
typedef size_t rutz::static_block< T, N >::size_type

STL size type.

Definition at line 99 of file arrays.h.

template<class T , size_t N>
typedef T rutz::static_block< T, N >::value_type

STL value type.

Definition at line 89 of file arrays.h.


Member Function Documentation

template<class T , size_t N>
const_reference rutz::static_block< T, N >::at ( size_type  n  )  const [inline]

Checked const array index (rutz::out_of_range on bounds error).

Definition at line 123 of file arrays.h.

template<class T , size_t N>
reference rutz::static_block< T, N >::at ( size_type  n  )  [inline]

Checked non-const array index (rutz::out_of_range on bounds error).

Definition at line 115 of file arrays.h.

template<class T , size_t N>
const_iterator rutz::static_block< T, N >::begin (  )  const [inline]

Const iterator to array start.

Definition at line 105 of file arrays.h.

template<class T , size_t N>
iterator rutz::static_block< T, N >::begin (  )  [inline]

Iterator to array start.

Definition at line 102 of file arrays.h.

template<class T , size_t N>
const_iterator rutz::static_block< T, N >::end (  )  const [inline]

Const iterator to array one-past-the-end.

Definition at line 106 of file arrays.h.

template<class T , size_t N>
iterator rutz::static_block< T, N >::end (  )  [inline]

Iterator to array one-past-the-end.

Definition at line 103 of file arrays.h.

template<class T , size_t N>
bool rutz::static_block< T, N >::is_empty (  )  const [inline]

Query whether size is zero.

Definition at line 137 of file arrays.h.

template<class T , size_t N>
size_type rutz::static_block< T, N >::max_size (  )  const [inline]

Maximum size of array type.

Definition at line 134 of file arrays.h.

template<class T , size_t N>
const_reference rutz::static_block< T, N >::operator[] ( size_type  n  )  const [inline]

Unchecked const array index.

Definition at line 112 of file arrays.h.

template<class T , size_t N>
reference rutz::static_block< T, N >::operator[] ( size_type  n  )  [inline]

Unchecked non-const array index.

Definition at line 109 of file arrays.h.

template<class T , size_t N>
size_type rutz::static_block< T, N >::size (  )  const [inline]

Size of array.

Definition at line 131 of file arrays.h.

template<class T , size_t N>
void rutz::static_block< T, N >::swap ( static_block< T, N > &  other  )  [inline]

Swap data with another array.

This requires an element-by-element swap.

Definition at line 141 of file arrays.h.


The documentation for this struct was generated from the following file:
Generated on Sun May 8 08:44:43 2011 for iLab Neuromorphic Vision Toolkit by  doxygen 1.6.3