Teuchos - Trilinos Tools Package  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Related Functions | List of all members
Teuchos::Tuple< T, N > Class Template Reference

Statically sized simple array (tuple) class. More...

#include <Teuchos_Tuple.hpp>

Inheritance diagram for Teuchos::Tuple< T, N >:
Teuchos::ArrayView< T >

Public Member Functions

 Tuple ()
 Default construct raw storage. More...
 
 Tuple (const Tuple< T, N > &t)
 Copy constructor. More...
 
Tuple< T, N > & operator= (const Tuple< T, N > &t)
 Copy constructor. More...
 
- Public Member Functions inherited from Teuchos::ArrayView< T >
 ArrayView (ENull null_arg=null)
 Constructor that initializes to NULL (implicitly or explicitly). More...
 
 ArrayView (T *p, size_type size, const ERCPNodeLookup rcpNodeLookup=RCP_ENABLE_NODE_LOOKUP)
 Initialize view from raw memory. More...
 
 ArrayView (const ArrayView< T > &array)
 Initialize from another ArrayView<T> object. More...
 
 ArrayView (std::vector< typename ConstTypeTraits< T >::NonConstType > &vec)
 Create a nonconst view of an std::vector<T>. More...
 
 ArrayView (const std::vector< typename ConstTypeTraits< T >::NonConstType > &vec)
 Create a const view of an std::vector<T>. More...
 
ArrayView< T > & operator= (const ArrayView< T > &array)
 Shallow copy assignment operator. More...
 
 ~ArrayView ()
 Destructor. More...
 
bool is_null () const
 Returns true if the underlying pointer is null. More...
 
size_type size () const
 The total number of items in the managed array. More...
 
std::string toString () const
 Convert an ArrayView<T> to an std::string More...
 
T * getRawPtr () const
 Return a raw pointer to beginning of array or NULL if unsized. More...
 
T * data () const
 Return a raw pointer to beginning of array. More...
 
T & operator[] (size_type i) const
 Random object access. More...
 
T & front () const
 Get the first element. More...
 
T & back () const
 Get the last element. More...
 
ArrayView< T > view (size_type offset, size_type size) const
 Return a view of a contiguous range of elements. More...
 
ArrayView< T > operator() (size_type offset, size_type size) const
 Return a view of a contiguous range of elements (calls view(offset, size)). More...
 
const ArrayView< T > & operator() () const
 Return *this (just for compatibility with Array and ArrayPtr). More...
 
ArrayView< const T > getConst () const
 Return a const view of a possibly nonconst view. More...
 
 operator ArrayView< const T > () const
 Implicitly convert an ArrayView<T> to an ArrayView<const T>. More...
 
void assign (const ArrayView< const T > &array) const
 Copy the data from one array view object to this array view object. More...
 
iterator begin () const
 Return an iterator to beginning of the array of data. More...
 
iterator end () const
 Return an iterator to past the end of the array of data. More...
 
const ArrayView< T > & assert_not_null () const
 Throws NullReferenceError if this->get()==NULL, otherwise returns reference to *this. More...
 
const ArrayView< T > & assert_in_range (size_type offset, size_type size) const
 Throws NullReferenceError if this->get()==NULL orthis->get()!=NULL, throws RangeError if (offset < 0 || this->size() < offset+size, otherwise returns reference to *this More...
 

Related Functions

(Note that these are not member functions.)

template<typename T >
Tuple< T, 1 > tuple (const T &a)
 Create a Tuple<T,1>. More...
 
template<typename T >
Tuple< T, 2 > tuple (const T &a, const T &b)
 Create a Tuple<T,2>. More...
 
template<typename T >
Tuple< T, 3 > tuple (const T &a, const T &b, const T &c)
 Create a Tuple<T,3>. More...
 
template<typename T >
Tuple< T, 4 > tuple (const T &a, const T &b, const T &c, const T &d)
 Create a Tuple<T,4>. More...
 
template<typename T >
Tuple< T, 5 > tuple (const T &a, const T &b, const T &c, const T &d, const T &e)
 Create a Tuple<T,5>. More...
 
template<typename T >
Tuple< T, 6 > tuple (const T &a, const T &b, const T &c, const T &d, const T &e, const T &f)
 Create a Tuple<T,6>. More...
 
template<typename T >
Tuple< T, 7 > tuple (const T &a, const T &b, const T &c, const T &d, const T &e, const T &f, const T &g)
 Create a Tuple<T,7>. More...
 
template<typename T >
Tuple< T, 8 > 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 a Tuple<T,8>. More...
 
template<typename T >
Tuple< T, 9 > 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 a Tuple<T,9>. More...
 
template<typename T >
Tuple< T, 10 > 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 a Tuple<T,10>. More...
 
template<typename T >
Tuple< T, 11 > 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, const T &k)
 Create a Tuple<T,11>. More...
 
template<typename T >
Tuple< T, 12 > 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, const T &k, const T &l)
 Create a Tuple<T,12>. More...
 
template<typename T >
Tuple< T, 13 > 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, const T &k, const T &l, const T &m)
 Create a Tuple<T,13>. More...
 
template<typename T >
Tuple< T, 14 > 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, const T &k, const T &l, const T &m, const T &n)
 Create a Tuple<T,14>. More...
 
template<typename T >
Tuple< T, 15 > 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, const T &k, const T &l, const T &m, const T &n, const T &o)
 Create a Tuple<T,15>. More...
 

Additional Inherited Members

- Public Types inherited from Teuchos::ArrayView< T >
typedef Teuchos_Ordinal Ordinal
 Integer index type used throughout ArrayView. More...
 
typedef Ordinal size_type
 Type representing the number of elements in an ArrayRCP or view thereof. More...
 
typedef Ordinal difference_type
 Type representing the difference between two size_type values. More...
 
typedef T value_type
 Type of each array element. More...
 
typedef T * pointer
 Type of a pointer to an array element. More...
 
typedef const T * const_pointer
 Type of a const pointer to an array element. More...
 
typedef T & reference
 Type of a reference to an array element. More...
 
typedef const T & const_reference
 Type of a const reference to an array element. More...
 
typedef pointer iterator
 Type of a nonconst iterator. More...
 
typedef const_pointer const_iterator
 Type of a const iterator. More...
 

Detailed Description

template<typename T, int N>
class Teuchos::Tuple< T, N >

Statically sized simple array (tuple) class.

ToDo: Finish documentation!

Design Discussion

This class derives from ArrayView and therefore inherits all of the features line element access and iterators along with full runtime checking. It does so at the expense of a little extra data (an extra pointer and an extra integer). However, this overhead will be small for any reasonable size of N.

Definition at line 67 of file Teuchos_Tuple.hpp.

Constructor & Destructor Documentation

template<typename T , int N>
Teuchos::Tuple< T, N >::Tuple ( )
inline

Default construct raw storage.

Definition at line 229 of file Teuchos_Tuple.hpp.

template<typename T, int N>
Teuchos::Tuple< T, N >::Tuple ( const Tuple< T, N > &  t)

Copy constructor.

Definition at line 237 of file Teuchos_Tuple.hpp.

Member Function Documentation

template<typename T, int N>
Tuple< T, N > & Teuchos::Tuple< T, N >::operator= ( const Tuple< T, N > &  t)

Copy constructor.

Definition at line 249 of file Teuchos_Tuple.hpp.

Friends And Related Function Documentation

template<typename T >
Tuple< T, 1 > tuple ( const T &  a)
related

Create a Tuple<T,1>.

template<typename T >
Tuple< T, 2 > tuple ( const T &  a,
const T &  b 
)
related

Create a Tuple<T,2>.

template<typename T >
Tuple< T, 3 > tuple ( const T &  a,
const T &  b,
const T &  c 
)
related

Create a Tuple<T,3>.

template<typename T >
Tuple< T, 4 > tuple ( const T &  a,
const T &  b,
const T &  c,
const T &  d 
)
related

Create a Tuple<T,4>.

template<typename T >
Tuple< T, 5 > tuple ( const T &  a,
const T &  b,
const T &  c,
const T &  d,
const T &  e 
)
related

Create a Tuple<T,5>.

template<typename T >
Tuple< T, 6 > tuple ( const T &  a,
const T &  b,
const T &  c,
const T &  d,
const T &  e,
const T &  f 
)
related

Create a Tuple<T,6>.

template<typename T >
Tuple< T, 7 > tuple ( const T &  a,
const T &  b,
const T &  c,
const T &  d,
const T &  e,
const T &  f,
const T &  g 
)
related

Create a Tuple<T,7>.

template<typename T >
Tuple< T, 8 > 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 a Tuple<T,8>.

template<typename T >
Tuple< T, 9 > 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 a Tuple<T,9>.

template<typename T >
Tuple< T, 10 > 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 a Tuple<T,10>.

template<typename T >
Tuple< T, 11 > 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,
const T &  k 
)
related

Create a Tuple<T,11>.

template<typename T >
Tuple< T, 12 > 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,
const T &  k,
const T &  l 
)
related

Create a Tuple<T,12>.

template<typename T >
Tuple< T, 13 > 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,
const T &  k,
const T &  l,
const T &  m 
)
related

Create a Tuple<T,13>.

template<typename T >
Tuple< T, 14 > 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,
const T &  k,
const T &  l,
const T &  m,
const T &  n 
)
related

Create a Tuple<T,14>.

template<typename T >
Tuple< T, 15 > 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,
const T &  k,
const T &  l,
const T &  m,
const T &  n,
const T &  o 
)
related

Create a Tuple<T,15>.


The documentation for this class was generated from the following file: