42 #ifndef TEUCHOS_ARRAY_VIEW_DECL_HPP
43 #define TEUCHOS_ARRAY_VIEW_DECL_HPP
55 template<
class T>
class ArrayRCP;
156 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
240 inline T*
data()
const;
370 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
385 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
392 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
398 (void)offset; (void)size_in;
399 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
405 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
417 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
444 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
475 inline const T*
data()
const;
479 const T&
front()
const;
481 const T&
back()
const;
504 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
519 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
526 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
532 (void)offset; (void)size_in;
533 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
539 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
550 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
650 template<
class T2,
class T1>
666 template<
class T2,
class T1>
TEUCHOS_ORDINAL_TYPE Teuchos_Ordinal
Reference-counted pointer node classes.
Partial specialization of ArrayRCP for const T.
const ArrayRCP< const T > & assert_valid_ptr() const
Reference-counted smart pointer for managing arrays.
const ArrayRCP< T > & assert_valid_ptr() const
If the object pointer is non-null, assert that it is still valid.
Partial specialization of ArrayView for const T.
void debug_assert_valid_ptr() const
void debug_assert_not_null() const
const T & const_reference
const_pointer const_iterator
const T * access_private_ptr() const
void debug_assert_in_range(size_type offset, size_type size_in) const
T * access_private_ptr() const
void setUpIterators(const ERCPNodeLookup rcpNodeLookup=RCP_ENABLE_NODE_LOOKUP)
ArrayView< const T > arrayViewFromVector(const std::vector< T > &vec)
Construct a const view of an std::vector.
T * pointer
Type of a pointer to an array element.
bool is_null() const
Returns true if the underlying pointer is null.
ArrayView< T2 > av_const_cast(const ArrayView< T1 > &p1)
Const cast of underlying ArrayView type from const T* to T*.
iterator begin() const
Return an iterator to beginning of the array of data.
ArrayView< T > & operator=(const ArrayView< T > &array)
Shallow copy assignment operator.
T * getRawPtr() const
Return a raw pointer to beginning of array or NULL if unsized.
ArrayView(ENull null_arg=null)
Constructor that initializes to NULL (implicitly or explicitly).
ArrayView< T > view(size_type offset, size_type size) const
Return a view of a contiguous range of elements.
iterator end() const
Return an iterator to past the end of the array of data.
const T * const_pointer
Type of a const pointer to an array element.
Teuchos_Ordinal Ordinal
Integer index type used throughout ArrayView.
bool nonnull(const ArrayView< T > &av)
Returns true if av.get()!=NULL.
void debug_assert_not_null() const
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 ...
T & reference
Type of a reference to an array element.
Ordinal difference_type
Type representing the difference between two size_type values.
ArrayView< T > arrayViewFromVector(std::vector< T > &vec)
Construct a non-const view of an std::vector.
size_type size() const
The total number of items in the managed array.
T & back() const
Get the last element.
const ArrayView< T > & operator()() const
Return *this (just for compatibility with Array and ArrayPtr).
T & operator[](size_type i) const
Random object access.
const_pointer const_iterator
Type of a const iterator.
std::vector< T > createVector(const ArrayView< T > &av)
Get a new std::vector<T> object out of an ArrayView<T> object.
const T & const_reference
Type of a const reference to an array element.
void debug_assert_in_range(size_type offset, size_type size_in) const
ArrayView< T2 > av_reinterpret_cast(const ArrayView< T1 > &p1)
Reinterpret cast of underlying ArrayView type from T1* to T2*.
ArrayView< const T > getConst() const
Return a const view of a possibly nonconst view.
std::ostream & operator<<(std::ostream &out, const ArrayView< T > &av)
Output stream inserter.
std::vector< T > createVector(const ArrayView< const T > &av)
Get a new std::vector<T> object out of an ArrayView<const T> object.
pointer iterator
Type of a nonconst iterator.
void assign(const ArrayView< const T > &array) const
Copy the data from one array view object to this array view object.
void debug_assert_valid_ptr() const
const ArrayView< T > & assert_not_null() const
Throws NullReferenceError if this->get()==NULL, otherwise returns reference to *this.
std::string toString() const
Convert an ArrayView<T> to an std::string
T * data() const
Return a raw pointer to beginning of array.
T value_type
Type of each array element.
bool is_null(const ArrayView< T > &av)
Returns true if av.is_null()==true.
Ordinal size_type
Type representing the number of elements in an ArrayRCP or view thereof.
T & front() const
Get the first element.
ArrayView< T > arrayView(T *p, typename ArrayView< T >::size_type size)
Construct a const or non-const view to const or non-const data.
UnConst< T >::Result NonConstType
ERCPNodeLookup
Used to determine if RCPNode lookup is performed or not.