Array2d Class Template Reference

Inheritance diagram for Array2d:

Torus List of all members.

Detailed Description

template<class T>
class Array2d< T >

Author:
Bill Smart

Version:
1.0
Date:
May 2005

Definition at line 136 of file Array.H.

STL integration

typedef T value_type
typedef value_typepointer
typedef const value_typeconst_pointer
typedef value_typereference
typedef const value_typeconst_reference
typedef ptrdiff_t difference_type
typedef size_t size_type
typedef pointer iterator
typedef const_pointer const_iterator
typedef std::reverse_iterator<
iterator
reverse_iterator
typedef std::reverse_iterator<
const_iterator
const_reverse_iterator
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
reverse_iterator rbegin ()
reverse_iterator rend ()
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const

Public Member Functions

 Array2d (const int rows, const int columns)
 Array2d (const int rows, const int columns, const T &value)
 Array2d (const Array2d< T > &array)
 ~Array2d ()
Assignment
Array2d< T > & operator= (const Array2d< T > &array)
 Assign one array to another.
Array2d< T > & operator= (const T &value)
 Assign a value to all elements of the array.
Element access
reference operator() (const size_type row, const size_type column)
const_reference operator() (const size_type row, const size_type column) const
Sizes
size_type size () const
size_type rows () const
size_type columns () const

Private Attributes

size_type m_rows
size_type m_columns
T * m_data


Member Typedef Documentation

typedef T value_type

Reimplemented in Torus.

Definition at line 177 of file Array.H.

typedef value_type* pointer

Reimplemented in Torus.

Definition at line 179 of file Array.H.

typedef const value_type* const_pointer

Reimplemented in Torus.

Definition at line 180 of file Array.H.

typedef value_type& reference

Reimplemented in Torus.

Definition at line 181 of file Array.H.

typedef const value_type& const_reference

Reimplemented in Torus.

Definition at line 182 of file Array.H.

typedef ptrdiff_t difference_type

Reimplemented in Torus.

Definition at line 184 of file Array.H.

typedef size_t size_type

Reimplemented in Torus.

Definition at line 185 of file Array.H.

typedef pointer iterator

Reimplemented in Torus.

Definition at line 187 of file Array.H.

typedef const_pointer const_iterator

Reimplemented in Torus.

Definition at line 188 of file Array.H.

typedef std::reverse_iterator<iterator> reverse_iterator

Reimplemented in Torus.

Definition at line 196 of file Array.H.

typedef std::reverse_iterator<const_iterator> const_reverse_iterator

Reimplemented in Torus.

Definition at line 197 of file Array.H.


Constructor & Destructor Documentation

Array2d ( const int  rows,
const int  columns 
) [inline]

Allocate an array with the given sizes.

Parameters:
[in] rows The number of rows in the array.
[in] columns The number of columns in the array.

Definition at line 141 of file Array.H.

References m_data.

Array2d ( const int  rows,
const int  columns,
const T &  value 
) [inline]

Allocate an array with the given sizes, and initialize each element to a particular value.

Parameters:
[in] rows The number of rows in the array.
[in] columns The number of columns in the array.
[in] value The initial value for each element.

Definition at line 147 of file Array.H.

References m_data.

Array2d ( const Array2d< T > &  array  )  [inline]

Definition at line 150 of file Array.H.

References m_columns, m_data, and m_rows.

~Array2d (  )  [inline]

Definition at line 153 of file Array.H.

References invalidate_pointer, and m_data.


Member Function Documentation

Array2d<T>& operator= ( const Array2d< T > &  array  )  [inline]

Assign one array to another.

If the array being assigned from is larger than the array being assigned to, data block holding the array will be deleted and reallocated.

Parameters:
[in] array The array to be assigned from.
Returns:
A reference to the modified array.

Definition at line 162 of file Array.H.

References m_columns, m_data, and m_rows.

Array2d<T>& operator= ( const T &  value  )  [inline]

Assign a value to all elements of the array.

Parameters:
[in] value The value to be assigned.
Returns:
A reference to the modified array.

Definition at line 170 of file Array.H.

References m_columns, m_data, and m_rows.

iterator begin (  )  [inline]

Definition at line 190 of file Array.H.

References m_data.

Referenced by rend().

iterator end (  )  [inline]

Definition at line 191 of file Array.H.

References m_columns, m_data, and m_rows.

Referenced by rbegin().

const_iterator begin (  )  const [inline]

Definition at line 193 of file Array.H.

References m_data.

const_iterator end (  )  const [inline]

Definition at line 194 of file Array.H.

References m_columns, m_data, and m_rows.

reverse_iterator rbegin (  )  [inline]

Definition at line 199 of file Array.H.

References end().

reverse_iterator rend (  )  [inline]

Definition at line 200 of file Array.H.

References begin().

const_reverse_iterator rbegin (  )  const [inline]

Definition at line 202 of file Array.H.

References end().

const_reverse_iterator rend (  )  const [inline]

Definition at line 203 of file Array.H.

References begin().

reference operator() ( const size_type  row,
const size_type  column 
) [inline]

Reimplemented in Torus.

Definition at line 208 of file Array.H.

References assert_range, m_columns, m_data, and m_rows.

const_reference operator() ( const size_type  row,
const size_type  column 
) const [inline]

Reimplemented in Torus.

Definition at line 210 of file Array.H.

References assert_range, m_columns, m_data, and m_rows.

size_type size (  )  const [inline]

Definition at line 216 of file Array.H.

References m_columns, and m_rows.

size_type rows (  )  const [inline]

Definition at line 217 of file Array.H.

References m_rows.

Referenced by Torus::operator()().

size_type columns (  )  const [inline]

Definition at line 218 of file Array.H.

References m_columns.

Referenced by Torus::operator()().


Member Data Documentation

size_type m_rows [private]

Definition at line 222 of file Array.H.

Referenced by Array2d(), end(), operator()(), operator=(), rows(), and size().

size_type m_columns [private]

Definition at line 223 of file Array.H.

Referenced by Array2d(), columns(), end(), operator()(), operator=(), and size().

T* m_data [private]

Definition at line 224 of file Array.H.

Referenced by Array2d(), begin(), end(), operator()(), operator=(), and ~Array2d().


The documentation for this class was generated from the following file:
Generated on Thu Feb 1 15:31:55 2007 for WURDE by  doxygen 1.5.1