Teuchos - Trilinos Tools Package
Version of the Day
|
Statically sized simple array (tuple) class. More...
#include <Teuchos_Tuple.hpp>
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... | |
![]() | |
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... | |
![]() | |
template<class T > | |
ArrayView< T > | arrayView (T *p, typename ArrayView< T >::size_type size) |
Construct a const or non-const view to const or non-const data. More... | |
template<class T > | |
ArrayView< T > | arrayViewFromVector (std::vector< T > &vec) |
Construct a non-const view of an std::vector. More... | |
template<class T > | |
ArrayView< const T > | arrayViewFromVector (const std::vector< T > &vec) |
Construct a const view of an std::vector. More... | |
template<class T > | |
std::vector< T > | createVector (const ArrayView< T > &av) |
Get a new std::vector<T> object out of an ArrayView<T> object. More... | |
template<class T > | |
std::vector< T > | createVector (const ArrayView< const T > &av) |
Get a new std::vector<T> object out of an ArrayView<const T> object. More... | |
template<class T > | |
bool | is_null (const ArrayView< T > &av) |
Returns true if av.is_null()==true . More... | |
template<class T > | |
bool | nonnull (const ArrayView< T > &av) |
Returns true if av.get()!=NULL . More... | |
template<class T > | |
std::ostream & | operator<< (std::ostream &out, const ArrayView< T > &av) |
Output stream inserter. More... | |
template<class T2 , class T1 > | |
ArrayView< T2 > | av_const_cast (const ArrayView< T1 > &p1) |
Const cast of underlying ArrayView type from const T* to T* . More... | |
template<class T2 , class T1 > | |
ArrayView< T2 > | av_reinterpret_cast (const ArrayView< T1 > &p1) |
Reinterpret cast of underlying ArrayView type from T1* to T2* . More... | |
Additional Inherited Members | |
![]() | |
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... | |
Statically sized simple array (tuple) class.
ToDo: Finish documentation!
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.
|
inline |
Default construct raw storage.
Definition at line 229 of file Teuchos_Tuple.hpp.
Teuchos::Tuple< T, N >::Tuple | ( | const Tuple< T, N > & | t | ) |
Copy constructor.
Definition at line 237 of file Teuchos_Tuple.hpp.
Tuple< T, N > & Teuchos::Tuple< T, N >::operator= | ( | const Tuple< T, N > & | t | ) |
Copy constructor.
Definition at line 249 of file Teuchos_Tuple.hpp.
|
related |
Create a Tuple<T,1>.
|
related |
Create a Tuple<T,2>.
|
related |
Create a Tuple<T,3>.
|
related |
Create a Tuple<T,4>.
|
related |
Create a Tuple<T,5>.
|
related |
Create a Tuple<T,6>.
|
related |
Create a Tuple<T,7>.
|
related |
Create a Tuple<T,8>.
|
related |
Create a Tuple<T,9>.
|
related |
Create a Tuple<T,10>.
|
related |
Create a Tuple<T,11>.
|
related |
Create a Tuple<T,12>.
|
related |
Create a Tuple<T,13>.
|
related |
Create a Tuple<T,14>.
|
related |
Create a Tuple<T,15>.