Teuchos::Array< T > Class Template Reference

Array is a templated array class derived from the STL vector, but with index boundschecking and an extended interface. More...

#include <Teuchos_Array.hpp>

Inheritance diagram for Teuchos::Array< T >:

[legend]
List of all members.

Public Member Functions

 Array ()
 Empty constructor.
 Array (int n)
 Allocate an array with n elements.
 Array (int n, const T &t)
 Allocate n elements, and fill with value t.
Array< T > & append (const T &entry)
 Add a new entry at the end of the array. Resize to allow space for the new entry.
int length () const
 Return number of elements in the array. Equivalent to size(), but included for backwards compatibility.
T & operator[] (int i)
 Read/Write access to a the i-th element, with optional boundschecking.
const T & operator[] (int i) const
 Read-only access to a the i-th element, with optional boundschecking.
std::string toString () const
 Write Array as a string.

Static Public Member Functions

bool hasBoundsChecking ()
 Return true if Array has been compiled with boundschecking on.

Private Member Functions

void indexCheckCrash (int i) const
 check for a bounds violation if HAVE_ARRAY_BOUNDSCHECK has been defined as 1.

Related Functions

(Note that these are not member functions.)

std::ostream & operator<< (std::ostream &os, const Array< T > &array)
 Write an Array to a stream.
int hashCode (const Array< T > &array)
std::string toString (const Array< T > &array)
Array< T > tuple (const T &a)
 Create an array with one entry.
Array< T > tuple (const T &a, const T &b)
 Create an array with two entries.
Array< T > tuple (const T &a, const T &b, const T &c)
 Create an array with three entries.
Array< T > tuple (const T &a, const T &b, const T &c, const T &d)
 Create an array with four entries.
Array< T > tuple (const T &a, const T &b, const T &c, const T &d, const T &e)
 Create an array with five entries.
Array< T > tuple (const T &a, const T &b, const T &c, const T &d, const T &e, const T &f)
 Create an array with six entries.
Array< T > tuple (const T &a, const T &b, const T &c, const T &d, const T &e, const T &f, const T &g)
 Create an array with seven entries.
Array< T > tuple (const T &a, const T &b, const T &c, const T &d, const T &e, const T &f, const T &g, const T &h)
 Create an array with eight entries.
Array< T > tuple (const T &a, const T &b, const T &c, const T &d, const T &e, const T &f, const T &g, const T &h, const T &i)
 Create an array with nine entries.
Array< T > tuple (const T &a, const T &b, const T &c, const T &d, const T &e, const T &f, const T &g, const T &h, const T &i, const T &j)
 Create an array with ten entries.

Detailed Description

template<class T>
class Teuchos::Array< T >

Array is a templated array class derived from the STL vector, but with index boundschecking and an extended interface.

Definition at line 48 of file Teuchos_Array.hpp.


Constructor & Destructor Documentation

template<class T>
Teuchos::Array< T >::Array  )  [inline]
 

Empty constructor.

Definition at line 100 of file Teuchos_Array.hpp.

template<class T>
Teuchos::Array< T >::Array int  n  )  [inline]
 

Allocate an array with n elements.

Definition at line 104 of file Teuchos_Array.hpp.

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

Allocate n elements, and fill with value t.

Definition at line 108 of file Teuchos_Array.hpp.


Member Function Documentation

template<class T>
Array<T>& Teuchos::Array< T >::append const T &  entry  )  [inline]
 

Add a new entry at the end of the array. Resize to allow space for the new entry.

Definition at line 61 of file Teuchos_Array.hpp.

template<class T>
int Teuchos::Array< T >::length  )  const [inline]
 

Return number of elements in the array. Equivalent to size(), but included for backwards compatibility.

Definition at line 66 of file Teuchos_Array.hpp.

template<class T>
T & Teuchos::Array< T >::operator[] int  i  )  [inline]
 

Read/Write access to a the i-th element, with optional boundschecking.

Definition at line 113 of file Teuchos_Array.hpp.

template<class T>
const T & Teuchos::Array< T >::operator[] int  i  )  const [inline]
 

Read-only access to a the i-th element, with optional boundschecking.

Definition at line 121 of file Teuchos_Array.hpp.

template<class T>
std::string Teuchos::Array< T >::toString  )  const [inline]
 

Write Array as a string.

Definition at line 163 of file Teuchos_Array.hpp.

template<class T>
bool Teuchos::Array< T >::hasBoundsChecking  )  [inline, static]
 

Return true if Array has been compiled with boundschecking on.

Definition at line 129 of file Teuchos_Array.hpp.

template<class T>
void Teuchos::Array< T >::indexCheckCrash int  i  )  const [inline, private]
 

check for a bounds violation if HAVE_ARRAY_BOUNDSCHECK has been defined as 1.

Definition at line 139 of file Teuchos_Array.hpp.


Friends And Related Function Documentation

template<class T>
std::ostream & operator<< std::ostream &  os,
const Array< T > &  array
[related]
 

Write an Array to a stream.

template<class T>
int hashCode const Array< T > &  array  )  [related]
 

Definition at line 153 of file Teuchos_Array.hpp.

template<class T>
std::string toString const Array< T > &  array  )  [related]
 

Definition at line 177 of file Teuchos_Array.hpp.

template<class T>
Array< T > tuple const T &  a  )  [related]
 

Create an array with one entry.

Definition at line 187 of file Teuchos_Array.hpp.

template<class T>
Array< T > tuple const T &  a,
const T &  b
[related]
 

Create an array with two entries.

Definition at line 197 of file Teuchos_Array.hpp.

template<class T>
Array< T > tuple const T &  a,
const T &  b,
const T &  c
[related]
 

Create an array with three entries.

Definition at line 209 of file Teuchos_Array.hpp.

template<class T>
Array< T > tuple const T &  a,
const T &  b,
const T &  c,
const T &  d
[related]
 

Create an array with four entries.

Definition at line 222 of file Teuchos_Array.hpp.

template<class T>
Array< T > tuple const T &  a,
const T &  b,
const T &  c,
const T &  d,
const T &  e
[related]
 

Create an array with five entries.

Definition at line 236 of file Teuchos_Array.hpp.

template<class T>
Array< T > tuple const T &  a,
const T &  b,
const T &  c,
const T &  d,
const T &  e,
const T &  f
[related]
 

Create an array with six entries.

Definition at line 252 of file Teuchos_Array.hpp.

template<class T>
Array< T > tuple const T &  a,
const T &  b,
const T &  c,
const T &  d,
const T &  e,
const T &  f,
const T &  g
[related]
 

Create an array with seven entries.

Definition at line 269 of file Teuchos_Array.hpp.

template<class T>
Array< T > tuple const T &  a,
const T &  b,
const T &  c,
const T &  d,
const T &  e,
const T &  f,
const T &  g,
const T &  h
[related]
 

Create an array with eight entries.

Definition at line 287 of file Teuchos_Array.hpp.

template<class T>
Array< T > tuple const T &  a,
const T &  b,
const T &  c,
const T &  d,
const T &  e,
const T &  f,
const T &  g,
const T &  h,
const T &  i
[related]
 

Create an array with nine entries.

Definition at line 306 of file Teuchos_Array.hpp.

template<class T>
Array< T > tuple const T &  a,
const T &  b,
const T &  c,
const T &  d,
const T &  e,
const T &  f,
const T &  g,
const T &  h,
const T &  i,
const T &  j
[related]
 

Create an array with ten entries.

Definition at line 327 of file Teuchos_Array.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:42:52 2008 for Teuchos - Trilinos Tools Package by doxygen 1.3.9.1