OPTPP::OptppArray< T > Class Template Reference

Simple array class. More...

List of all members.

Public Member Functions

OptppArray< T > & append (const T &rhs)
 add a new entry.
bool bcast (int sender)
 accessors that return error codes if there are problems with parallel processing
bool get (int i, T &value) const
 accessors that return error codes upon bounds violations (if NOBOUNDSCHECK is not set):
int length () const
const OptppArray< T > & operator= (const OptppArray< T > &other)
 explicit assignment needed to prevent memory corruption
const T & operator[] (int i) const
T & operator[] (int i)
 simple accessors.
 OptppArray (const OptppArray< T > &other)
 explicit copy constructor needed to prevent memory corruption
 OptppArray (int n, const T &t)
 OptppArray (int n, const T *cOptppArray)
 OptppArray (int n)
 OptppArray ()
 Default Constructor.
bool put (int i, const T &value)
bool recv (int tag, int src)
int reserve () const
 return numbered of reserved slots in OptppArray
void reserve (int n)
 reserve n slots in OptppArray
void resize (int newN)
 resize the OptppArray
bool send (int tag, int dest)
 ~OptppArray ()
 explicit copy destructor needed to prevent memory corruption

Detailed Description

template<class T>
class OPTPP::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).

Definition at line 29 of file OptppArray.h.


Constructor & Destructor Documentation

template<class T >
OPTPP::OptppArray< T >::OptppArray (  )  [inline]
template<class T >
OPTPP::OptppArray< T >::OptppArray ( int  n  )  [inline]
Parameters:
n an integer argument

Definition at line 227 of file OptppArray.h.

template<class T>
OPTPP::OptppArray< T >::OptppArray ( int  n,
const T *  cOptppArray 
) [inline]
Parameters:
n an integer argument
cOptppArray a pointer to class T

Definition at line 242 of file OptppArray.h.

template<class T>
OPTPP::OptppArray< T >::OptppArray ( int  n,
const T &  t 
) [inline]
Parameters:
n an integer argument
t a reference to class T

Definition at line 258 of file OptppArray.h.

template<class T >
OPTPP::OptppArray< T >::~OptppArray (  )  [inline]

explicit copy destructor needed to prevent memory corruption

Definition at line 291 of file OptppArray.h.

template<class T>
OPTPP::OptppArray< T >::OptppArray ( const OptppArray< T > &  other  )  [inline]

explicit copy constructor needed to prevent memory corruption

Definition at line 276 of file OptppArray.h.


Member Function Documentation

template<class T>
OptppArray< T > & OPTPP::OptppArray< T >::append ( const T &  rhs  )  [inline]

add a new entry.

Definition at line 297 of file OptppArray.h.

References OPTPP::OptppArray< T >::resize().

template<class T>
bool OPTPP::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 OPTPP::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

Definition at line 398 of file OptppArray.h.

template<class T >
int OPTPP::OptppArray< T >::length (  )  const [inline]
Returns:
Length of array

Definition at line 339 of file OptppArray.h.

template<class T>
const OptppArray< T > & OPTPP::OptppArray< T >::operator= ( const OptppArray< T > &  other  )  [inline]

explicit assignment needed to prevent memory corruption

Definition at line 305 of file OptppArray.h.

template<class T >
T & OPTPP::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.

Definition at line 368 of file OptppArray.h.

template<class T >
int OPTPP::OptppArray< T >::reserve (  )  const [inline]

return numbered of reserved slots in OptppArray

Definition at line 363 of file OptppArray.h.

Referenced by OPTPP::OptppArray< T >::resize().

template<class T >
void OPTPP::OptppArray< T >::reserve ( int  n  )  [inline]

reserve n slots in OptppArray

Definition at line 344 of file OptppArray.h.

template<class T >
void OPTPP::OptppArray< T >::resize ( int  newN  )  [inline]

resize the OptppArray

Definition at line 328 of file OptppArray.h.

References OPTPP::OptppArray< T >::reserve().

Referenced by OPTPP::OptppArray< T >::append().


The documentation for this class was generated from the following file:
Generated on Mon Jan 24 12:04:41 2011 for FASTlib by  doxygen 1.6.3