NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links

arr2b< T > Class Template Reference
[Array classes]

#include <arr.h>

Collaboration diagram for arr2b< T >:

List of all members.

Public Member Functions

 arr2b ()
 arr2b (long sz1, long sz2)
 arr2b (const arr2b &orig)
 ~arr2b ()
long size1 () const
long size2 () const
long size () const
void alloc (long sz1, long sz2)
void dealloc ()
void fill (const T &val)
arr2boperator= (const arr2b &orig)
template<typename T2>
T * operator[] (T2 n)
template<typename T2>
const T * operator[] (T2 n) const
T ** p0 ()


Detailed Description

template<typename T>
class arr2b< T >

Two-dimensional array type. An entry is located by double dereferencing, i.e. via an array of pointers. The indices start at zero.

Definition at line 291 of file arr.h.


Constructor & Destructor Documentation

template<typename T>
arr2b< T >::arr2b (  )  [inline]

Creates a zero-sized array.

Definition at line 312 of file arr.h.

template<typename T>
arr2b< T >::arr2b ( long  sz1,
long  sz2 
) [inline]

Creates an array with the dimensions sz1 and sz2.

Definition at line 314 of file arr.h.

template<typename T>
arr2b< T >::arr2b ( const arr2b< T > &  orig  )  [inline]

Creates the array as a copy of orig.

Definition at line 318 of file arr.h.

template<typename T>
arr2b< T >::~arr2b (  )  [inline]

Frees the memory associated with the array.

Definition at line 322 of file arr.h.


Member Function Documentation

template<typename T>
long arr2b< T >::size1 (  )  const [inline]

Returns the first array dimension.

Definition at line 325 of file arr.h.

template<typename T>
long arr2b< T >::size2 (  )  const [inline]

Returns the second array dimension.

Definition at line 327 of file arr.h.

template<typename T>
long arr2b< T >::size (  )  const [inline]

Returns the total array size, i.e. the product of both dimensions.

Definition at line 329 of file arr.h.

template<typename T>
void arr2b< T >::alloc ( long  sz1,
long  sz2 
) [inline]

Allocates space for an array with sz1*sz2 elements. The content of the array is undefined on exit.

Definition at line 333 of file arr.h.

template<typename T>
void arr2b< T >::dealloc (  )  [inline]

Deallocates the space and makes the array zero-sized.

Definition at line 342 of file arr.h.

template<typename T>
void arr2b< T >::fill ( const T &  val  )  [inline]

Sets all array elements to val.

Definition at line 345 of file arr.h.

template<typename T>
arr2b& arr2b< T >::operator= ( const arr2b< T > &  orig  )  [inline]

Changes the array to be a copy of orig.

Definition at line 349 of file arr.h.

template<typename T>
template<typename T2>
T* arr2b< T >::operator[] ( T2  n  )  [inline]

Returns a pointer to the beginning of slice n.

Definition at line 363 of file arr.h.

template<typename T>
template<typename T2>
const T* arr2b< T >::operator[] ( T2  n  )  const [inline]

Returns a constant pointer to the beginning of slice n.

Definition at line 365 of file arr.h.

template<typename T>
T** arr2b< T >::p0 (  )  [inline]

Returns a pointer to the beginning of the pointer array.

Definition at line 368 of file arr.h.


The documentation for this class was generated from the following file:

Generated on Fri Jun 18 16:12:29 2010 for LevelS C++ support library
Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650