Teuchos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | 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 >:
Inheritance graph
[legend]

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 >
T * access_private_ptr () const
 
template<>
TEUCHOSCORE_LIB_DLL_EXPORT
std::string 
toString () const
 
template<>
TEUCHOSCORE_LIB_DLL_EXPORT
std::string 
toString () const
 
template<>
TEUCHOSCORE_LIB_DLL_EXPORT
std::string 
toString () const
 
template<>
TEUCHOSCORE_LIB_DLL_EXPORT
std::string 
toString () const
 
template<>
TEUCHOSCORE_LIB_DLL_EXPORT
std::string 
toString () const
 
template<>
TEUCHOSCORE_LIB_DLL_EXPORT
std::string 
toString () const
 
template<>
TEUCHOSCORE_LIB_DLL_EXPORT
std::string 
toString () const
 
template<>
TEUCHOSCORE_LIB_DLL_EXPORT
std::string 
toString () const
 
 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 std::remove_const_t< T >> &vec)
 Create a nonconst view of an std::vector<T>. More...
 
 ArrayView (const std::vector< typename std::remove_const_t< T >> &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...
 

Private Attributes

array_ [N]
 

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

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 35 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 197 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 205 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 217 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>.

Member Data Documentation

template<typename T, int N>
T Teuchos::Tuple< T, N >::array_[N]
private

Definition at line 52 of file Teuchos_Tuple.hpp.


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