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
406 arcp_.access_private_node().assert_valid_ptr(*
this);
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
540 arcp_.access_private_node().assert_valid_ptr(*
this);
550 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
562 ArrayView<T> arrayView( T* p,
typename ArrayView<T>::size_type size );
570 ArrayView<T> arrayViewFromVector( std::vector<T>& vec );
578 ArrayView<const T> arrayViewFromVector(
const std::vector<T>& vec );
598 std::vector<T> createVector(
const ArrayView<T> &av );
612 std::vector<T> createVector(
const ArrayView<const T> &av );
620 bool is_null(
const ArrayView<T> &av );
628 bool nonnull(
const ArrayView<T> &av );
639 std::ostream& operator<<( std::ostream& out, const ArrayView<T>& av );
650 template<
class T2,
class T1>
651 ArrayView<T2> av_const_cast(
const ArrayView<T1>& p1);
666 template<
class T2,
class T1>
667 ArrayView<T2> av_reinterpret_cast(
const ArrayView<T1>& p1);
681 #endif // TEUCHOS_ARRAY_VIEW_DECL_HPP
T & reference
Type of a reference to an array element.
void debug_assert_in_range(size_type offset, size_type size_in) const
std::string toString() const
Convert an ArrayView<T> to an std::string
void setUpIterators(const ERCPNodeLookup rcpNodeLookup=RCP_ENABLE_NODE_LOOKUP)
T & front() const
Get the first element.
const T * const_pointer
Type of a const pointer to an array element.
pointer iterator
Type of a nonconst iterator.
bool is_null() const
Returns true if the underlying pointer is null.
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 ...
Partial specialization of ArrayRCP for const T.
const T & const_reference
Type of a const reference to an array element.
iterator begin() const
Return an iterator to beginning of the array of data.
bool nonnull(const std::shared_ptr< T > &p)
Returns true if p.get()!=NULL.
bool is_null(const std::shared_ptr< T > &p)
Returns true if p.get()==NULL.
UnConst< T >::Result NonConstType
const_pointer const_iterator
Type of a const iterator.
Ordinal size_type
Type representing the number of elements in an ArrayRCP or view thereof.
size_type size() const
The total number of items in the managed array.
ERCPNodeLookup
Used to determine if RCPNode lookup is performed or not.
ENull
Used to initialize a RCP object to NULL using an implicit conversion!
void debug_assert_not_null() const
T * data() const
Return a raw pointer to beginning of array.
TEUCHOS_ORDINAL_TYPE Teuchos_Ordinal
void assign(const ArrayView< const T > &array) const
Copy the data from one array view object to this array view object.
Teuchos_Ordinal Ordinal
Integer index type used throughout ArrayView.
const T & const_reference
void debug_assert_in_range(size_type offset, size_type size_in) const
void debug_assert_not_null() const
void debug_assert_valid_ptr() const
T * pointer
Type of a pointer to an array element.
const T * access_private_ptr() const
T * getRawPtr() const
Return a raw pointer to beginning of array or NULL if unsized.
const ArrayView< T > & assert_not_null() const
Throws NullReferenceError if this->get()==NULL, otherwise returns reference to *this.
void debug_assert_valid_ptr() const
T value_type
Type of each array element.
const ArrayView< T > & operator()() const
Return *this (just for compatibility with Array and ArrayPtr).
ArrayView(ENull null_arg=null)
Constructor that initializes to NULL (implicitly or explicitly).
iterator end() const
Return an iterator to past the end of the array of data.
ArrayView< T > view(size_type offset, size_type size) const
Return a view of a contiguous range of elements.
Partial specialization of ArrayView for const T.
T * access_private_ptr() const
T & operator[](size_type i) const
Random object access.
Reference-counted pointer node classes.
Ordinal difference_type
Type representing the difference between two size_type values.
ArrayView< T > & operator=(const ArrayView< T > &array)
Shallow copy assignment operator.
ArrayView< const T > getConst() const
Return a const view of a possibly nonconst view.
T & back() const
Get the last element.
const_pointer const_iterator
Reference-counted smart pointer for managing arrays.