Main Page   Class Hierarchy   Compound List   File List   Compound Members   Related Pages   Examples  

OptppArray Class Template Reference

#include <OptppArray.h>

List of all members.

Public Methods

 OptppArray ()
 OptppArray (int n)
 OptppArray (int n, const T *cOptppArray)
 OptppArray (int n, const T &t)
 ~OptppArray ()
 explicit copy destructor needed to prevent memory corruption.

 OptppArray (const OptppArray< T > &other)
 explicit copy constructor needed to prevent memory corruption.

const OptppArray< T > & operator= (const OptppArray< T > &other)
 explicit assignment needed to prevent memory corruption.

void resize (int newN)
 resize the OptppArray.

void reserve (int n)
 reserve n slots in OptppArray.

int reserve () const
 return numbered of reserved slots in OptppArray.

OptppArray< T > & append (const T &rhs)
 add a new entry.

T & operator[] (int i)
const T & operator[] (int i) const
bool get (int i, T &value) const
bool put (int i, const T &value)
int length () const
bool bcast (int sender)
bool send (int tag, int dest)
bool recv (int tag, int src)


Detailed Description

template<class T>
class OptppArray< T >

Simple array class.

Bounds checking is ON by default. To turn it off (for optimal performance) do -DNOBOUNDSCHECK on the compilation command line.

Parallel support for primitive types relies on template specialization. If your compiler supports template specialization, define TEMPLATE_SPECIALIZATION and use the code here. Otherwise, use the workaround routines in BadCompilerHacks.[cpp,h]. IRIX CC 7.2 and egcs both support specialization. IRIX CC 7.1 appears not to (though the documentation says otherwise).


Constructor & Destructor Documentation

template<class T>
OptppArray< T >::OptppArray [inline]
 

Default Constructor

See also:
OptppArray(int n) , OptppArray(int n, const T* cOptppArray) , OptppArray(int n, const T& t)

template<class T>
OptppArray< T >::OptppArray int n [inline]
 

Parameters:
n   an integer argument

template<class T>
OptppArray< T >::OptppArray int n,
const T * cOptppArray
[inline]
 

Parameters:
n   an integer argument
cOptppArray   a pointer to class T

template<class T>
OptppArray< T >::OptppArray int n,
const T & t
[inline]
 

Parameters:
n   an integer argument
t   a reference to class T


Member Function Documentation

template<class T>
bool OptppArray< T >::bcast int sender
 

accessors that return error codes if there are problems with parallel processing

Returns:
1 OK 0 error

template<class T>
bool OptppArray< T >::get int i,
T & value
const [inline]
 

accessors that return error codes upon bounds violations (if NOBOUNDSCHECK is not set):

Returns:
1 OK 0 error

template<class T>
int OptppArray< T >::length const [inline]
 

Returns:
Length of array

template<class T>
T & OptppArray< T >::operator[] int i [inline]
 

simple accessors. If NOBOUNDSCHECK is not set and a bounds error occurs, crash. In cases where error handling is to be used, and exceptions are not supported, use get and put instead.


The documentation for this class was generated from the following file:
Copyright Information
GNU Lesser General Public License

Contact:
Juan Meza meza@ca.sandia.gov



Documentation generated by