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

Array3< T > Class Template Reference

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

#include <Arrays.h>

List of all members.

Public Member Functions

 Array3 (int width, int height, int depth)
 Allocate a three-dimensional array.

 Array3 (int width, int height, int depth, T *data)
 Bind to an existing three-dimensional array.

 ~Array3 ()
 If previously allocated a three-dimensional array, free it.

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

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

int getWidth () const
 Retrieve the array width.

int getHeight () const
 Retrieve the array height.

int getDepth () const
 Retrieve the array depth.

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.

int m_depth
 Dimension of the one-dimensional array.

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


Detailed Description

template<class T>
class Array3< T >

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


Member Data Documentation

template<class T>
bool Array3< 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 Mon Aug 25 23:40:58 2003 for Shadow by doxygen 1.3.2