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>

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.
void remove (int i)
 Remove the i-th element from the array, with optional boundschecking.
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.

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.
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.
Examples:

ParameterList/cxx_main.cpp.

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 103 of file Teuchos_Array.hpp.

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

Allocate an array with n elements.

Definition at line 107 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 111 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>
void Teuchos::Array< T >::remove int  i  ) 
 

Remove the i-th element from the array, with optional boundschecking.

Definition at line 116 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 69 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 125 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 133 of file Teuchos_Array.hpp.

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

Write Array as a string.

Definition at line 176 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 141 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>
Array< T > tuple const T &  a  )  [related]
 

Create an array with one entry.

Definition at line 201 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 211 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 223 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 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
[related]
 

Create an array with five entries.

Definition at line 250 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 266 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 283 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 301 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 320 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 341 of file Teuchos_Array.hpp.


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