42 #ifndef TEUCHOS_ARRAY_VIEW_DECL_HPP 43 #define TEUCHOS_ARRAY_VIEW_DECL_HPP 47 #include "Teuchos_ENull.hpp" 48 #include "Teuchos_NullIteratorTraits.hpp" 49 #include "Teuchos_ConstTypeTraits.hpp" 55 template<
class T>
class ArrayRCP;
156 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 365 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 380 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 384 void setUpIterators(
const ERCPNodeLookup rcpNodeLookup = RCP_ENABLE_NODE_LOOKUP);
386 void debug_assert_not_null()
const {
387 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 393 (void)offset; (void)size_in;
394 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 399 void debug_assert_valid_ptr()
const {
400 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 409 T* access_private_ptr()
const 412 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 413 ArrayRCP<T> access_private_arcp()
const 430 typedef Teuchos_Ordinal
Ordinal;
439 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 464 size_type
size()
const;
472 const T&
front()
const;
474 const T&
back()
const;
489 iterator
begin()
const;
491 iterator
end()
const;
497 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 512 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 516 void setUpIterators(
const ERCPNodeLookup rcpNodeLookup = RCP_ENABLE_NODE_LOOKUP);
518 void debug_assert_not_null()
const {
519 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 524 void debug_assert_in_range( size_type offset, size_type size_in )
const {
525 (void)offset; (void)size_in;
526 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 531 void debug_assert_valid_ptr()
const {
532 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 533 arcp_.access_private_node().assert_valid_ptr(*
this);
541 const T* access_private_ptr()
const {
return ptr_; }
543 #ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK 563 ArrayView<T> arrayViewFromVector( std::vector<T>& vec );
632 std::ostream& operator<<( std::ostream& out, const ArrayView<T>& av );
643 template<
class T2,
class T1>
659 template<
class T2,
class T1>
674 #endif // TEUCHOS_ARRAY_VIEW_DECL_HPP T & reference
Type of a reference to an array element.
void assign(const ArrayView< const T > &array) const
Copy the data from one array view object to this array view object.
T & operator[](size_type i) const
Random object access.
const ArrayView< T > & assert_not_null() const
Throws NullReferenceError if this->get()==NULL, otherwise returns reference to *this.
const T * const_pointer
Type of a const pointer to an array element.
pointer iterator
Type of a nonconst iterator.
Partial specialization of ArrayRCP for const T.
const T & const_reference
Type of a const reference to an array element.
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.
T & front() const
Get the first element.
T & back() const
Get the last element.
const ArrayRCP< T > & assert_valid_ptr() const
If the object pointer is non-null, assert that it is still valid.
iterator begin() const
Return an iterator to beginning of the array of data.
ArrayView< const T > getConst() const
Return a const view of a possibly nonconst view.
Teuchos_Ordinal Ordinal
Integer index type used throughout ArrayView.
std::string toString() const
Convert an ArrayView<T> to an std::string
T * pointer
Type of a pointer to an array element.
bool is_null() const
Returns true if the underlying pointer is null.
T value_type
Type of each array element.
T * getRawPtr() const
Return a raw pointer to beginning of array or NULL if unsized.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos, as well as a number of utility routines.
ERCPNodeLookup
Used to determine if RCPNode lookup is performed or not.
ArrayView(ENull null_arg=null)
Constructor that initializes to NULL (implicitly or explicitly).
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 ArrayView for const T.
iterator end() const
Return an iterator to past the end of the array of data.
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< T > view(size_type offset, size_type size) const
Return a view of a contiguous range of elements.
const ArrayView< T > & operator()() const
Return *this (just for compatibility with Array and ArrayPtr).
Reference-counted smart pointer for managing arrays.