Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Array2< T > Class Template Reference

Expose a one-dimensional array as a two-dimensional array. More...

#include <Arrays.h>

List of all members.

Public Methods

 Array2 (int width, int height)
 Allocate a two-dimensional array.

 Array2 (int width, int height, T *data)
 Bind to an existing two-dimensional array.

 ~Array2 ()
 If previously allocated a two-dimensional array, free it.

T & operator() (int col, int row)
 Return m_data[row * m_width + col].

const T & operator() (int col, int row) const
 Return m_data[row * m_width + col].

int getWidth () const
 Retrieve the array width.

int getHeight () const
 Retrieve the array height.

const T * getData () const
 Retrieve the array contents.


Private Attributes

T * m_data
 The one-dimensional array of data.

int m_width
 Dimension of the one-dimensional array.

int m_height
 Dimension of the one-dimensional array.

bool m_managed
 Was the array of data allocated inside this class?


Detailed Description

template<class T>
class Array2< T >

Expose a one-dimensional array as a two-dimensional array.


Member Data Documentation

template<class T>
bool Array2< T >::m_managed [private]
 

Was the array of data allocated inside this class?

If true, the data should be deleted when this class is deleted; otherwise, do nothing: the lifetime of the array of data is governed externally.


The documentation for this class was generated from the following file:
Generated on Sat Mar 22 15:12:07 2003 for Bumpmap by doxygen1.3-rc2