#include <OptppArray.h>
Public Member Functions | |
| 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) |
Private Member Functions | |
| void | indexCheckCrash (int i) const |
| bool | indexCheckNoCrash (int i) const |
Private Attributes | |
| T * | data_ |
| T class pointer to the data. | |
| int | len_ |
| Length of array. | |
| int | reserve_ |
| Amount of reserved space. | |
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).
|
|||||||||
|
Default Constructor |
|
||||||||||
|
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|||||||||
|
explicit copy destructor needed to prevent memory corruption
|
|
||||||||||
|
explicit copy constructor needed to prevent memory corruption
|
|
||||||||||
|
add a new entry.
|
|
||||||||||
|
accessors that return error codes if there are problems with parallel processing
|
|
||||||||||||||||
|
accessors that return error codes upon bounds violations (if NOBOUNDSCHECK is not set):
|
|
||||||||||
|
|
|
||||||||||
|
|
|
|||||||||
|
|
|
||||||||||
|
explicit assignment needed to prevent memory corruption
|
|
||||||||||
|
|
|
||||||||||
|
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. |
|
||||||||||||||||
|
|
|
||||||||||||||||
|
|
|
|||||||||
|
return numbered of reserved slots in OptppArray
|
|
||||||||||
|
reserve n slots in OptppArray
|
|
||||||||||
|
resize the OptppArray
|
|
||||||||||||||||
|
|
|
|||||
|
T class pointer to the data.
|
|
|||||
|
Length of array.
|
|
|||||
|
Amount of reserved space.
|