Teuchos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Teuchos::ArrayRCP< const T > Class Template Reference

Partial specialization of ArrayRCP for const T. More...

#include <Teuchos_ArrayRCPDecl.hpp>

Inheritance diagram for Teuchos::ArrayRCP< const T >:

Public Types

typedef Teuchos_Ordinal Ordinal
 
typedef Ordinal size_type
 
typedef Ordinal difference_type
 
typedef std::random_access_iterator_tag iterator_category
 
typedef const T * iterator_type
 
typedef const T value_type
 
typedef const T & reference
 
typedef const T & const_reference
 
typedef const T * pointer
 
typedef const T * const_pointer
 
typedef const T element_type
 
typedef const T * iterator
 
typedef const T * const_iterator
 

Public Member Functions

 ArrayRCP (ENull null_arg=null)
 
 ArrayRCP (const T *p, size_type lowerOffset, size_type size, bool has_ownership, const ERCPNodeLookup rcpNodeLookup=RCP_ENABLE_NODE_LOOKUP)
 
template<class Dealloc_T>
 ArrayRCP (const T *p, size_type lowerOffset, size_type size, Dealloc_T dealloc, bool has_ownership)
 
 ArrayRCP (size_type size, const T &val=T())
 
 ArrayRCP (const ArrayRCP< const T > &r_ptr)
 
 ~ArrayRCP ()
 
ArrayRCP< const T > & operator= (const ArrayRCP< const T > &r_ptr)
 
bool is_null () const
 
const T * operator-> () const
 
const T & operator* () const
 
const T * get () const
 
const T * getRawPtr () const
 
const T & operator[] (size_type offset) const
 
ArrayRCP< const T > & operator++ ()
 
ArrayRCP< const T > operator++ (int)
 
ArrayRCP< const T > & operator-- ()
 
ArrayRCP< const T > operator-- (int)
 
ArrayRCP< const T > & operator+= (size_type offset)
 
ArrayRCP< const T > & operator-= (size_type offset)
 
ArrayRCP< const T > operator+ (size_type offset) const
 
ArrayRCP< const T > operator- (size_type offset) const
 
iterator begin () const
 
iterator end () const
 
ArrayRCP< const T > getConst () const
 Return const reference to the array.
 
ArrayRCP< const T > persistingView (size_type lowerOffset, size_type size) const
 
size_type lowerOffset () const
 
size_type upperOffset () const
 
size_type size () const
 
ArrayView< const T > view (size_type lowerOffset, size_type size) const
 
ArrayView< const T > operator() (size_type lowerOffset, size_type size) const
 
ArrayView< const T > operator() () const
 
void resize (const size_type n, const T &val=T())
 
void clear ()
 
ERCPStrength strength () const
 
bool is_valid_ptr () const
 
int strong_count () const
 
int weak_count () const
 
int total_count () const
 
void set_has_ownership ()
 
bool has_ownership () const
 
const T * release ()
 
ArrayRCP< const T > create_weak () const
 
ArrayRCP< const T > create_strong () const
 
template<class T2>
bool shares_resource (const ArrayRCP< T2 > &r_ptr) const
 
const ArrayRCP< const T > & assert_not_null () const
 
const ArrayRCP< const T > & assert_in_range (size_type lowerOffset, size_type size) const
 
const ArrayRCP< const T > & assert_valid_ptr () const
 
 ArrayRCP (const T *p, size_type lowerOffset_in, size_type size_in, bool has_ownership_in, const ERCPNodeLookup rcpNodeLookup)
 
 ArrayRCP (const T *p, size_type lowerOffset_in, size_type size_in, Dealloc_T dealloc, bool has_ownership_in)
 
 ArrayRCP (const ArrayRCP< const T > &r_ptr)
 
 ArrayRCP (T *p, size_type lowerOffset_in, size_type size_in, const RCPNodeHandle &node)
 
 ArrayRCP (const T *p, size_type lowerOffset_in, size_type size_in, const RCPNodeHandle &node)
 
 ArrayRCP (const T *p, size_type lowerOffset_in, size_type size_in, bool has_ownership_in, const ERCPNodeLookup rcpNodeLookup)
 
 ArrayRCP (const T *p, size_type lowerOffset_in, size_type size_in, Dealloc_T dealloc, bool has_ownership_in)
 
 ArrayRCP (const ArrayRCP< const T > &r_ptr)
 
 ArrayRCP (T *p, size_type lowerOffset_in, size_type size_in, const RCPNodeHandle &node)
 
 ArrayRCP (const T *p, size_type lowerOffset_in, size_type size_in, const RCPNodeHandle &node)
 

Private Member Functions

void debug_assert_not_null () const
 
void debug_assert_in_range (size_type lowerOffset_in, size_type size_in) const
 
void debug_assert_valid_ptr () const
 

Private Attributes

const T * ptr_
 
RCPNodeHandle node_
 
size_type lowerOffset_
 
size_type upperOffset_
 

Related Symbols

(Note that these are not member symbols.)

ArrayRCP< T > arcp (const RCP< Array< T > > &v)
 Wrap an RCP<Array<T> > object as an ArrayRCP<T> object.
 
ArrayRCP< const T > arcp (const RCP< const Array< T > > &v)
 Wrap a RCP<const Array<T> > object as an ArrayRCP<const T> object.
 
ArrayRCP< T > arcpFromArray (Array< T > &a)
 Wrap an Array<T> object as a non-owning ArrayRCP<T> object.
 
ArrayRCP< const T > arcpFromArray (const Array< T > &a)
 Wrap a const Array<T> object as a non-owning ArrayRCP<T> object.
 
ArrayRCP< T > arcp (T *p, typename ArrayRCP< T >::size_type lowerOffset, typename ArrayRCP< T >::size_type size, bool owns_mem=true)
 Wraps a preallocated array of data with the assumption to call the array version of delete.
 
ArrayRCP< T > arcp (T *p, typename ArrayRCP< T >::size_type lowerOffset, typename ArrayRCP< T >::size_type size, Dealloc_T dealloc, bool owns_mem)
 Wraps a preallocated array of data and uses a templated deallocation strategy object to define deletion .
 
ArrayRCP< T > arcp (typename ArrayRCP< T >::size_type size)
 Allocate a new array just given a dimension.
 
ArrayRCP< T > arcpCloneNode (const ArrayRCP< T > &a)
 Allocate a new ArrayRCP object with a new RCPNode with memory pointing to the initial node.
 
ArrayRCP< T > arcpClone (const ArrayView< const T > &v)
 Allocate a new array by cloning data from an input array view.
 
ArrayRCP< T > arcpWithEmbeddedObjPreDestroy (T *p, typename ArrayRCP< T >::size_type lowerOffset, typename ArrayRCP< T >::size_type size, const Embedded &embedded, bool owns_mem=true)
 Create an ArrayRCP with and also put in an embedded object.
 
ArrayRCP< T > arcpWithEmbeddedObjPostDestroy (T *p, typename ArrayRCP< T >::size_type lowerOffset, typename ArrayRCP< T >::size_type size, const Embedded &embedded, bool owns_mem=true)
 Create an ArrayRCP with and also put in an embedded object.
 
ArrayRCP< T > arcpWithEmbeddedObj (T *p, typename ArrayRCP< T >::size_type lowerOffset, typename ArrayRCP< T >::size_type size, const Embedded &embedded, bool owns_mem=true)
 Create an ArrayRCP with and also put in an embedded object.
 
ArrayRCP< T > arcp (const RCP< std::vector< T > > &v)
 Wrap an std::vector<T> object as an ArrayRCP<T> object.
 
ArrayRCP< const T > arcp (const RCP< const std::vector< T > > &v)
 Wrap a const std::vector<T> object as an ArrayRCP<const T> object.
 
ArrayRCP< T > arcpFromArrayView (const ArrayView< T > &av)
 Get an ArrayRCP object out of an ArrayView object.
 
RCP< std::vector< T > > get_std_vector (const ArrayRCP< T > &ptr)
 Get an std::vector<T> object out of an ArrayRCP<T> object that was created using the arcp() function above to wrap the std::vector in the first place..
 
RCP< const std::vector< T > > get_std_vector (const ArrayRCP< const T > &ptr)
 Get a const std::vector<T> object out of an ArrayRCP<const T> object that was created using the arcp() above to wrap the std::vector in the first place.
 
bool is_null (const ArrayRCP< T > &p)
 Returns true if p.get()==NULL.
 
bool nonnull (const ArrayRCP< T > &p)
 Returns true if p.get()!=NULL.
 
bool operator== (const ArrayRCP< T > &p, ENull)
 Returns true if p.get()==NULL.
 
bool operator!= (const ArrayRCP< T > &p, ENull)
 Returns true if p.get()!=NULL.
 
bool operator== (const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
 Compare two ArrayRCP objects for equality (by pointers).
 
bool operator!= (const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
 Compare two ArrayRCP objects for inequality (by pointers).
 
bool operator< (const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
 Compare the two ArrayRCP objects' pointers using <.
 
bool operator<= (const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
 Compare the two ArrayRCP objects' pointers using <=.
 
bool operator> (const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
 Compare the two ArrayRCP objects' pointers using >.
 
bool operator>= (const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
 Compare the two ArrayRCP objects' pointers using >=.
 
ArrayRCP< T >::difference_type operator- (const ArrayRCP< T > &p1, const ArrayRCP< T > &p2)
 Return the difference of two ArrayRCP objects.
 
ArrayRCP< T2 > arcp_const_cast (const ArrayRCP< T1 > &p1)
 Const cast of underlying ArrayRCP type from const T* to T*.
 
ArrayRCP< T2 > arcp_reinterpret_cast (const ArrayRCP< T1 > &p1)
 Reinterpret cast of underlying ArrayRCP type from T1* to T2*.
 
ArrayRCP< T2 > arcp_reinterpret_cast_nonpod (const ArrayRCP< T1 > &p1, const T2 &val=T2())
 Reinterpret cast of underlying ArrayRCP type from T1* to T2* where T2 is a non-POD (non-plain-old-data).
 
ArrayRCP< T2 > arcp_implicit_cast (const ArrayRCP< T1 > &p1)
 Implicit case the underlying ArrayRCP type from T1* to T2*.
 
void set_extra_data (const T1 &extra_data, const std::string &name, const Ptr< ArrayRCP< T2 > > &p, EPrePostDestruction destroy_when=POST_DESTROY, bool force_unique=true)
 Set extra data associated with a ArrayRCP object.
 
T1 & get_extra_data (ArrayRCP< T2 > &p, const std::string &name)
 Get a non-const reference to extra data associated with a ArrayRCP object.
 
const T1 & get_extra_data (const ArrayRCP< T2 > &p, const std::string &name)
 Get a const reference to extra data associated with a ArrayRCP object.
 
T1 * get_optional_extra_data (ArrayRCP< T2 > &p, const std::string &name)
 Get a pointer to non-const extra data (if it exists) associated with a ArrayRCP object.
 
const T1 * get_optional_extra_data (const ArrayRCP< T2 > &p, const std::string &name)
 Get a pointer to const extra data (if it exists) associated with a ArrayRCP object.
 
Dealloc_T & get_nonconst_dealloc (const ArrayRCP< T > &p)
 Return a non-const reference to the underlying deallocator object.
 
const Dealloc_T & get_dealloc (const ArrayRCP< T > &p)
 Return a const reference to the underlying deallocator object.
 
const Dealloc_T * get_optional_dealloc (const ArrayRCP< T > &p)
 Return a pointer to the underlying non-const deallocator object if it exists.
 
Dealloc_T * get_optional_nonconst_dealloc (const ArrayRCP< T > &p)
 Return a pointer to the underlying const deallocator object if it exists.
 
const Embedded & getEmbeddedObj (const ArrayRCP< T > &p)
 Get a const reference to an embedded object that was set by calling arcpWithEmbeddedObjPreDestroy(), arcpWithEmbeddedObjPostDestory(), or arcpWithEmbeddedObj().
 
Embedded & getNonconstEmbeddedObj (const ArrayRCP< T > &p)
 Get a const reference to an embedded object that was set by calling arcpWithEmbeddedObjPreDestroy(), arcpWithEmbeddedObjPostDestory(), or arcpWithEmbeddedObj().
 
std::ostream & operator<< (std::ostream &out, const ArrayRCP< T > &p)
 Output stream inserter.
 
bool is_null (const ArrayRCP< T > &p)
 Returns true if p.get()==NULL.
 
ArrayRCP< T >::difference_type operator- (const ArrayRCP< T > &p1, const ArrayRCP< T > &p2)
 Return the difference of two ArrayRCP objects.
 
ArrayRCP< T > arcp (const RCP< Array< T > > &v)
 Wrap an RCP<Array<T> > object as an ArrayRCP<T> object.
 
ArrayRCP< const T > arcp (const RCP< const Array< T > > &v)
 Wrap a RCP<const Array<T> > object as an ArrayRCP<const T> object.
 
ArrayRCP< T > arcp (T *p, typename ArrayRCP< T >::size_type lowerOffset, typename ArrayRCP< T >::size_type size, bool owns_mem=true)
 Wraps a preallocated array of data with the assumption to call the array version of delete.
 
ArrayRCP< T > arcp (T *p, typename ArrayRCP< T >::size_type lowerOffset, typename ArrayRCP< T >::size_type size, Dealloc_T dealloc, bool owns_mem)
 Wraps a preallocated array of data and uses a templated deallocation strategy object to define deletion .
 
ArrayRCP< T > arcp (typename ArrayRCP< T >::size_type size)
 Allocate a new array just given a dimension.
 
ArrayRCP< T > arcp (const RCP< std::vector< T > > &v)
 Wrap an std::vector<T> object as an ArrayRCP<T> object.
 
ArrayRCP< const T > arcp (const RCP< const std::vector< T > > &v)
 Wrap a const std::vector<T> object as an ArrayRCP<const T> object.
 
ArrayRCP< T > arcpFromArray (Array< T > &a)
 Wrap an Array<T> object as a non-owning ArrayRCP<T> object.
 
ArrayRCP< const T > arcpFromArray (const Array< T > &a)
 Wrap a const Array<T> object as a non-owning ArrayRCP<T> object.
 
ArrayRCP< T > arcpCloneNode (const ArrayRCP< T > &a)
 Allocate a new ArrayRCP object with a new RCPNode with memory pointing to the initial node.
 
ArrayRCP< T > arcpClone (const ArrayView< const T > &v)
 Allocate a new array by cloning data from an input array view.
 
ArrayRCP< T > arcpWithEmbeddedObjPreDestroy (T *p, typename ArrayRCP< T >::size_type lowerOffset, typename ArrayRCP< T >::size_type size, const Embedded &embedded, bool owns_mem=true)
 Create an ArrayRCP with and also put in an embedded object.
 
ArrayRCP< T > arcpWithEmbeddedObjPostDestroy (T *p, typename ArrayRCP< T >::size_type lowerOffset, typename ArrayRCP< T >::size_type size, const Embedded &embedded, bool owns_mem=true)
 Create an ArrayRCP with and also put in an embedded object.
 
ArrayRCP< T > arcpWithEmbeddedObj (T *p, typename ArrayRCP< T >::size_type lowerOffset, typename ArrayRCP< T >::size_type size, const Embedded &embedded, bool owns_mem=true)
 Create an ArrayRCP with and also put in an embedded object.
 
ArrayRCP< T > arcpFromArrayView (const ArrayView< T > &av)
 Get an ArrayRCP object out of an ArrayView object.
 
RCP< std::vector< T > > get_std_vector (const ArrayRCP< T > &ptr)
 Get an std::vector<T> object out of an ArrayRCP<T> object that was created using the arcp() function above to wrap the std::vector in the first place..
 
RCP< const std::vector< T > > get_std_vector (const ArrayRCP< const T > &ptr)
 Get a const std::vector<T> object out of an ArrayRCP<const T> object that was created using the arcp() above to wrap the std::vector in the first place.
 
bool nonnull (const ArrayRCP< T > &p)
 Returns true if p.get()!=NULL.
 
bool operator== (const ArrayRCP< T > &p, ENull)
 Returns true if p.get()==NULL.
 
bool operator== (const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
 Compare two ArrayRCP objects for equality (by pointers).
 
bool operator!= (const ArrayRCP< T > &p, ENull)
 Returns true if p.get()!=NULL.
 
bool operator!= (const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
 Compare two ArrayRCP objects for inequality (by pointers).
 
bool operator< (const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
 Compare the two ArrayRCP objects' pointers using <.
 
bool operator<= (const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
 Compare the two ArrayRCP objects' pointers using <=.
 
bool operator> (const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
 Compare the two ArrayRCP objects' pointers using >.
 
bool operator>= (const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
 Compare the two ArrayRCP objects' pointers using >=.
 
ArrayRCP< T2 > arcp_const_cast (const ArrayRCP< T1 > &p1)
 Const cast of underlying ArrayRCP type from const T* to T*.
 
ArrayRCP< T2 > arcp_reinterpret_cast (const ArrayRCP< T1 > &p1)
 Reinterpret cast of underlying ArrayRCP type from T1* to T2*.
 
ArrayRCP< T2 > arcp_reinterpret_cast_nonpod (const ArrayRCP< T1 > &p1, const T2 &val=T2())
 Reinterpret cast of underlying ArrayRCP type from T1* to T2* where T2 is a non-POD (non-plain-old-data).
 
ArrayRCP< T2 > arcp_implicit_cast (const ArrayRCP< T1 > &p1)
 Implicit case the underlying ArrayRCP type from T1* to T2*.
 
void set_extra_data (const T1 &extra_data, const std::string &name, const Ptr< ArrayRCP< T2 > > &p, EPrePostDestruction destroy_when=POST_DESTROY, bool force_unique=true)
 Set extra data associated with a ArrayRCP object.
 
T1 & get_extra_data (ArrayRCP< T2 > &p, const std::string &name)
 Get a non-const reference to extra data associated with a ArrayRCP object.
 
const T1 & get_extra_data (const ArrayRCP< T2 > &p, const std::string &name)
 Get a const reference to extra data associated with a ArrayRCP object.
 
T1 * get_optional_extra_data (ArrayRCP< T2 > &p, const std::string &name)
 Get a pointer to non-const extra data (if it exists) associated with a ArrayRCP object.
 
const T1 * get_optional_extra_data (const ArrayRCP< T2 > &p, const std::string &name)
 Get a pointer to const extra data (if it exists) associated with a ArrayRCP object.
 
Dealloc_T & get_nonconst_dealloc (const ArrayRCP< T > &p)
 Return a non-const reference to the underlying deallocator object.
 
const Dealloc_T & get_dealloc (const ArrayRCP< T > &p)
 Return a const reference to the underlying deallocator object.
 
const Dealloc_T * get_optional_dealloc (const ArrayRCP< T > &p)
 Return a pointer to the underlying non-const deallocator object if it exists.
 
Dealloc_T * get_optional_nonconst_dealloc (const ArrayRCP< T > &p)
 Return a pointer to the underlying const deallocator object if it exists.
 
const Embedded & getEmbeddedObj (const ArrayRCP< T > &p)
 Get a const reference to an embedded object that was set by calling arcpWithEmbeddedObjPreDestroy(), arcpWithEmbeddedObjPostDestory(), or arcpWithEmbeddedObj().
 
Embedded & getNonconstEmbeddedObj (const ArrayRCP< T > &p)
 Get a const reference to an embedded object that was set by calling arcpWithEmbeddedObjPreDestroy(), arcpWithEmbeddedObjPostDestory(), or arcpWithEmbeddedObj().
 
std::ostream & operator<< (std::ostream &out, const ArrayRCP< T > &p)
 Output stream inserter.
 

Public typedefs

typedef Teuchos_Ordinal Ordinal
 Integer index type used throughout ArrayRCP.
 
typedef Ordinal size_type
 Type representing the number of elements in an ArrayRCP or view thereof.
 
typedef Ordinal difference_type
 Type representing the difference between two size_type values.
 
typedef std::random_access_iterator_tag iterator_category
 Category of ArrayRCP's iterator type.
 
typedef T * iterator_type
 Type of an ArrayRCP's iterator.
 
typedef T value_type
 Type of each array element.
 
typedef T & reference
 Type of a (nonconstant) reference to an array element.
 
typedef const T & const_reference
 Type of a (constant) reference to an array element.
 
typedef T * pointer
 Type of a (raw) (nonconstant) pointer to an array element.
 
typedef T * const_pointer
 Type of a (raw) (constant) pointer to an array element.
 
typedef T element_type
 Type of each array element.
 
typedef T * iterator
 Nonconstant iterator type used if bounds checking is disabled.
 
typedef const T * const_iterator
 Constant iterator type used if bounds checking is disabled.
 

Assertion Functions.

T * ptr_
 Raw pointer to the array; NULL if this array is null.
 
RCPNodeHandle node_
 Reference-counting machinery.
 
size_type lowerOffset_
 Lower offset to the data; 0 if this array is null.
 
size_type upperOffset_
 Upper offset to the data; -1 if this array is null.
 
const ArrayRCP< T > & assert_not_null () const
 Throws NullReferenceError if this->get()==NULL, otherwise returns reference to *this.
 
const ArrayRCP< T > & assert_in_range (size_type lowerOffset, size_type size) const
 Throws NullReferenceError if this->get()==NULL orthis->get()!=NULL, throws RangeError if (lowerOffset < this->lowerOffset() || this->upperOffset() < upperOffset, otherwise returns reference to *this
 
const ArrayRCP< T > & assert_valid_ptr () const
 If the object pointer is non-null, assert that it is still valid.
 
void debug_assert_not_null () const
 
void debug_assert_in_range (size_type lowerOffset_in, size_type size_in) const
 
void debug_assert_valid_ptr () const
 

Constructors/Destructors/Initializers

 ArrayRCP (ENull null_arg=null)
 Default constructor; initialize to an empty array.
 
 ArrayRCP (T *p, size_type lowerOffset, size_type size, bool has_ownership, const ERCPNodeLookup rcpNodeLookup=RCP_ENABLE_NODE_LOOKUP)
 Construct from a raw pointer and a valid range.
 
 ArrayRCP (T *p, size_type lowerOffset, size_type size, Dealloc_T dealloc, bool has_ownership)
 Construct from a raw pointer, a valid range, and a deallocator.
 
 ArrayRCP (size_type size, const T &val=T())
 Construct an array with the given number of elements.
 
 ArrayRCP (const ArrayRCP< T > &r_ptr)
 Initialize from another ArrayRCP<T> object.
 
 ~ArrayRCP ()
 Destructor, that decrements the reference count.
 
ArrayRCP< T > & operator= (const ArrayRCP< T > &r_ptr)
 Assignment operator: Makes *this reference the input array.
 

Object/Pointer Access Functions

bool is_null () const
 True if the underlying pointer is null, else false.
 
T * operator-> () const
 Pointer (->) access to members of underlying object for current position.
 
T & operator* () const
 Dereference the underlying object for the current pointer position.
 
T * get () const
 Get the raw C++ pointer to the underlying object.
 
T * getRawPtr () const
 Get the raw C++ pointer to the underlying object.
 
T & operator[] (size_type offset) const
 Random object access.
 

Pointer Arithmetic Functions

ArrayRCP< T > & operator++ ()
 Prefix increment of pointer (i.e. ++ptr).
 
ArrayRCP< T > operator++ (int)
 Postfix increment of pointer (i.e. ptr++).
 
ArrayRCP< T > & operator-- ()
 Prefix decrement of pointer (i.e. –ptr).
 
ArrayRCP< T > operator-- (int)
 Postfix decrement of pointer (i.e. ptr–).
 
ArrayRCP< T > & operator+= (size_type offset)
 Pointer integer increment (i.e. ptr+=offset).
 
ArrayRCP< T > & operator-= (size_type offset)
 Pointer integer increment (i.e. ptr-=offset).
 
ArrayRCP< T > operator+ (size_type offset) const
 Pointer integer increment (i.e. ptr+offset).
 
ArrayRCP< T > operator- (size_type offset) const
 Pointer integer decrement (i.e. ptr-offset).
 

Standard Container-Like Functions

iterator begin () const
 Return an iterator to beginning of the array of data.
 
iterator end () const
 Return an iterator to past the end of the array of data.
 

ArrayRCP Views

ArrayRCP< const T > getConst () const
 Return object for only const access to data.
 
ArrayRCP< T > persistingView (size_type lowerOffset, size_type size) const
 Return a persisting view of a contiguous range of elements.
 

Size and extent query functions

size_type lowerOffset () const
 Return the lower offset to valid data.
 
size_type upperOffset () const
 Return the upper offset to valid data.
 
size_type size () const
 The total number of entries in the array.
 

ArrayView views

ArrayView< T > view (size_type lowerOffset, size_type size) const
 Return a nonpersisting view of a contiguous range of elements.
 
ArrayView< T > operator() (size_type lowerOffset, size_type size) const
 Return a nonpersisting view of a contiguous range of elements.
 
ArrayView< T > operator() () const
 Return a nonpersisting view of *this.
 

Implicit conversions

 operator ArrayRCP< const T > () const
 Convert from ArrayRCP<T> to ArrayRCP<const T>.
 

std::vector like and other misc functions

void assign (size_type n, const T &val)
 Resize and assign n elements of val.
 
void assign (Iter first, Iter last)
 Resize and assign to iterator sequence [first, last)
 
void deepCopy (const ArrayView< const T > &av)
 Deep copy the elements from one ArrayView object into this object.
 
void resize (const size_type n, const T &val=T())
 Resize and append new elements if necessary.
 
void clear ()
 Resize to zero.
 

Reference counting

ERCPStrength strength () const
 Strength of the pointer.
 
bool is_valid_ptr () const
 Return whether the underlying object pointer is still valid.
 
int strong_count () const
 Return the number of active RCP<> objects that have a "strong" reference to the underlying reference-counted object.
 
int weak_count () const
 Return the number of active RCP<> objects that have a "weak" reference to the underlying reference-counted object.
 
int total_count () const
 Total count (strong_count() + weak_count()).
 
void set_has_ownership ()
 Give this and other ArrayRCP<> objects ownership of the underlying referenced array to delete it.
 
bool has_ownership () const
 Returns true if this has ownership of object pointed to by this->get() in order to deallocate it.
 
T * release ()
 Release the ownership of the underlying array.
 
ArrayRCP< T > create_weak () const
 Create a new weak reference from another (strong) reference.
 
ArrayRCP< T > create_strong () const
 Create a new strong RCP object from another (weak) RCP object.
 
bool shares_resource (const ArrayRCP< T2 > &r_ptr) const
 Returns true if the smart pointers share the same underlying reference-counted object.
 

Detailed Description

template<class T>
class Teuchos::ArrayRCP< const T >

Partial specialization of ArrayRCP for const T.

The main documentation for ArrayRCP explains why this class needs a partial specialization for const types.

Definition at line 838 of file Teuchos_ArrayRCPDecl.hpp.

Member Typedef Documentation

◆ Ordinal [1/2]

template<class T>
typedef Teuchos_Ordinal Teuchos::ArrayRCP< const T >::Ordinal

Definition at line 840 of file Teuchos_ArrayRCPDecl.hpp.

◆ size_type [1/2]

template<class T>
typedef Ordinal Teuchos::ArrayRCP< const T >::size_type

Definition at line 841 of file Teuchos_ArrayRCPDecl.hpp.

◆ difference_type [1/2]

template<class T>
typedef Ordinal Teuchos::ArrayRCP< const T >::difference_type

Definition at line 842 of file Teuchos_ArrayRCPDecl.hpp.

◆ iterator_category [1/2]

template<class T>
typedef std::random_access_iterator_tag Teuchos::ArrayRCP< const T >::iterator_category

Definition at line 843 of file Teuchos_ArrayRCPDecl.hpp.

◆ iterator_type [1/2]

template<class T>
typedef const T* Teuchos::ArrayRCP< const T >::iterator_type

Definition at line 844 of file Teuchos_ArrayRCPDecl.hpp.

◆ value_type [1/2]

template<class T>
typedef const T Teuchos::ArrayRCP< const T >::value_type

Definition at line 845 of file Teuchos_ArrayRCPDecl.hpp.

◆ reference [1/2]

template<class T>
typedef const T& Teuchos::ArrayRCP< const T >::reference

Definition at line 846 of file Teuchos_ArrayRCPDecl.hpp.

◆ const_reference [1/2]

template<class T>
typedef const T& Teuchos::ArrayRCP< const T >::const_reference

Definition at line 847 of file Teuchos_ArrayRCPDecl.hpp.

◆ pointer [1/2]

template<class T>
typedef const T* Teuchos::ArrayRCP< const T >::pointer

Definition at line 848 of file Teuchos_ArrayRCPDecl.hpp.

◆ const_pointer [1/2]

template<class T>
typedef const T* Teuchos::ArrayRCP< const T >::const_pointer

Definition at line 849 of file Teuchos_ArrayRCPDecl.hpp.

◆ element_type [1/2]

template<class T>
typedef const T Teuchos::ArrayRCP< const T >::element_type

Definition at line 850 of file Teuchos_ArrayRCPDecl.hpp.

◆ iterator [1/2]

template<class T>
typedef const T* Teuchos::ArrayRCP< const T >::iterator

Definition at line 856 of file Teuchos_ArrayRCPDecl.hpp.

◆ const_iterator [1/2]

template<class T>
typedef const T* Teuchos::ArrayRCP< const T >::const_iterator

Definition at line 857 of file Teuchos_ArrayRCPDecl.hpp.

◆ Ordinal [2/2]

typedef Teuchos_Ordinal Teuchos::ArrayRCP< T >::Ordinal

Integer index type used throughout ArrayRCP.

Definition at line 133 of file Teuchos_ArrayRCPDecl.hpp.

◆ size_type [2/2]

typedef Ordinal Teuchos::ArrayRCP< T >::size_type

Type representing the number of elements in an ArrayRCP or view thereof.

Definition at line 136 of file Teuchos_ArrayRCPDecl.hpp.

◆ difference_type [2/2]

typedef Ordinal Teuchos::ArrayRCP< T >::difference_type

Type representing the difference between two size_type values.

Definition at line 139 of file Teuchos_ArrayRCPDecl.hpp.

◆ iterator_category [2/2]

typedef std::random_access_iterator_tag Teuchos::ArrayRCP< T >::iterator_category

Category of ArrayRCP's iterator type.

Definition at line 142 of file Teuchos_ArrayRCPDecl.hpp.

◆ iterator_type [2/2]

typedef T* Teuchos::ArrayRCP< T >::iterator_type

Type of an ArrayRCP's iterator.

Definition at line 145 of file Teuchos_ArrayRCPDecl.hpp.

◆ value_type [2/2]

typedef T Teuchos::ArrayRCP< T >::value_type

Type of each array element.

Definition at line 148 of file Teuchos_ArrayRCPDecl.hpp.

◆ reference [2/2]

typedef T& Teuchos::ArrayRCP< T >::reference

Type of a (nonconstant) reference to an array element.

Definition at line 151 of file Teuchos_ArrayRCPDecl.hpp.

◆ const_reference [2/2]

typedef const T& Teuchos::ArrayRCP< T >::const_reference

Type of a (constant) reference to an array element.

Definition at line 154 of file Teuchos_ArrayRCPDecl.hpp.

◆ pointer [2/2]

typedef T* Teuchos::ArrayRCP< T >::pointer

Type of a (raw) (nonconstant) pointer to an array element.

Definition at line 157 of file Teuchos_ArrayRCPDecl.hpp.

◆ const_pointer [2/2]

typedef T* Teuchos::ArrayRCP< T >::const_pointer

Type of a (raw) (constant) pointer to an array element.

Definition at line 160 of file Teuchos_ArrayRCPDecl.hpp.

◆ element_type [2/2]

typedef T Teuchos::ArrayRCP< T >::element_type

Type of each array element.

Definition at line 163 of file Teuchos_ArrayRCPDecl.hpp.

◆ iterator [2/2]

typedef T* Teuchos::ArrayRCP< T >::iterator

Nonconstant iterator type used if bounds checking is disabled.

Definition at line 172 of file Teuchos_ArrayRCPDecl.hpp.

◆ const_iterator [2/2]

typedef const T* Teuchos::ArrayRCP< T >::const_iterator

Constant iterator type used if bounds checking is disabled.

Definition at line 174 of file Teuchos_ArrayRCPDecl.hpp.

Constructor & Destructor Documentation

◆ ArrayRCP() [1/20]

template<class T>
Teuchos::ArrayRCP< const T >::ArrayRCP ( ENull null_arg = null)
inline

◆ ArrayRCP() [2/20]

template<class T>
Teuchos::ArrayRCP< const T >::ArrayRCP ( const T * p,
size_type lowerOffset,
size_type size,
bool has_ownership,
const ERCPNodeLookup rcpNodeLookup = RCP_ENABLE_NODE_LOOKUP )
inline

◆ ArrayRCP() [3/20]

template<class T>
template<class Dealloc_T>
Teuchos::ArrayRCP< const T >::ArrayRCP ( const T * p,
size_type lowerOffset,
size_type size,
Dealloc_T dealloc,
bool has_ownership )
inline

◆ ArrayRCP() [4/20]

template<class T>
Teuchos::ArrayRCP< const T >::ArrayRCP ( size_type size,
const T & val = T() )
inlineexplicit

◆ ArrayRCP() [5/20]

template<class T>
Teuchos::ArrayRCP< const T >::ArrayRCP ( const ArrayRCP< const T > & r_ptr)
inline

◆ ~ArrayRCP() [1/2]

template<class T>
Teuchos::ArrayRCP< const T >::~ArrayRCP ( )
inline

◆ ArrayRCP() [6/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( const T * p,
size_type lowerOffset_in,
size_type size_in,
bool has_ownership_in,
const ERCPNodeLookup rcpNodeLookup )
inline

Definition at line 186 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [7/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( const T * p,
size_type lowerOffset_in,
size_type size_in,
Dealloc_T dealloc,
bool has_ownership_in )
inline

Definition at line 252 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [8/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( const ArrayRCP< const T > & r_ptr)
inline

Definition at line 285 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [9/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( T * p,
size_type lowerOffset_in,
size_type size_in,
const RCPNodeHandle & node )
inline

Definition at line 1185 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [10/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( const T * p,
size_type lowerOffset_in,
size_type size_in,
const RCPNodeHandle & node )
inline

Definition at line 1196 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [11/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( ENull null_arg = null)
inline

Default constructor; initialize to an empty array.

This lets users write code like:

or

Both lines of code above set the raw array pointer to NULL, and the array's length to zero.

Definition at line 193 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [12/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( T * p,
size_type lowerOffset,
size_type size,
bool has_ownership,
const ERCPNodeLookup rcpNodeLookup = RCP_ENABLE_NODE_LOOKUP )
inline

Construct from a raw pointer and a valid range.

Parameters
p[in] Raw array pointer.
lowerOffset[in] Array index at which the range starts (zero if at the beginning of the range).
size[in] Number of array elements in the range.
has_ownership[in] True if the ArrayRCP is responsible for deallocating the raw array (using delete []) when the reference count goes to zero. If false, the ArrayRCP does not deallocate the array.
rcpNodeLookup[in] Whether to perform RCPNode lookup. The default value is fine for nearly all use cases.
Postcondition
this->get() == p
this->lowerOffset() == lowerOffset
this->upperOffset() == size + lowerOffset - 1
this->has_ownership() == has_ownership
Warning
You should avoid manipulating raw pointers and use other methods to construct an ArrayRCP object instead!

Definition at line 216 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [13/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( T * p,
size_type lowerOffset,
size_type size,
Dealloc_T dealloc,
bool has_ownership )
inline

Construct from a raw pointer, a valid range, and a deallocator.

Parameters
p[in] Raw array pointer.
lowerOffset[in] Array index at which the range starts (zero if at the beginning of the range).
size[in] Number of array elements in the range.
dealloc[in] Function (or object with an operator()(T*) method) responsible for deallocating the raw array when the reference count goes to zero.
has_ownership[in] True if the ArrayRCP is responsible for deallocating the raw array (using the given deallocator) when the reference count goes to zero. If false, the ArrayRCP does not deallocate the array.
Postcondition
this->get() == p
this->lowerOffset() == lowerOffset
this->upperOffset() == size + lowerOffset - 1
this->has_ownership() == has_ownership
Warning
You should avoid manipulating raw pointers and use other methods to construct an ArrayRCP object instead!

Definition at line 242 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [14/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( size_type size,
const T & val = T() )
inlineexplicit

Construct an array with the given number of elements.

Parameters
size[in] Number of elements in the array.
val[in] Value with which to fill all elements of the array.

This constructor fills the array as if with the following code:

std::fill_n (begin (), n, val);
Postcondition
this->lowerOffset() == 0
this->upperOffset() == size - 1
this->has_ownership() == true

Definition at line 260 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [15/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( const ArrayRCP< T > & r_ptr)
inline

Initialize from another ArrayRCP<T> object.

After construction, this and r_ptr will reference the same array.

Postcondition
this->get() == r_ptr.get()
this->count() == r_ptr.count()
this->has_ownership() == r_ptr.has_ownership()
If r_ptr.get() != NULL then r_ptr.count() is incremented by 1.
Note
To implementers: In compilers that conform to the C++ standard, this copy constructor overload is unnecessary, since the more general templated version of the copy constructor below is sufficient. However, not all compilers have handled this code correctly in the past. This version ensures correct compilation with such compilers, without affecting compilers that correctly implement the C++ standard.

Definition at line 280 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [16/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( const T * p,
size_type lowerOffset_in,
size_type size_in,
bool has_ownership_in,
const ERCPNodeLookup rcpNodeLookup )
inline

Definition at line 186 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [17/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( const T * p,
size_type lowerOffset_in,
size_type size_in,
Dealloc_T dealloc,
bool has_ownership_in )
inline

Definition at line 252 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [18/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( const ArrayRCP< const T > & r_ptr)
inline

Definition at line 285 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [19/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( T * p,
size_type lowerOffset_in,
size_type size_in,
const RCPNodeHandle & node )
inline

Definition at line 1185 of file Teuchos_ArrayRCP.hpp.

◆ ArrayRCP() [20/20]

Teuchos::ArrayRCP< T >::ArrayRCP ( const T * p,
size_type lowerOffset_in,
size_type size_in,
const RCPNodeHandle & node )
inline

Definition at line 1196 of file Teuchos_ArrayRCP.hpp.

◆ ~ArrayRCP() [2/2]

Teuchos::ArrayRCP< T >::~ArrayRCP ( )
inline

Destructor, that decrements the reference count.

If this->get() == NULL then the destructor does nothing. Otherwise, it decrements the reference count of this and all other references to the array. If the final reference count is zero, it also deallocates the array if owned (i.e., if this->has_ownership() returns true). Deallocation uses the custom deallocator if one was supplied; otherwise it uses delete [].

Definition at line 292 of file Teuchos_ArrayRCP.hpp.

Member Function Documentation

◆ operator=() [1/2]

template<class T>
ArrayRCP< const T > & Teuchos::ArrayRCP< const T >::operator= ( const ArrayRCP< const T > & r_ptr)
inline

◆ is_null() [1/2]

template<class T>
bool Teuchos::ArrayRCP< const T >::is_null ( ) const
inline

◆ operator->() [1/2]

template<class T>
const T * Teuchos::ArrayRCP< const T >::operator-> ( ) const
inline

◆ operator*() [1/2]

template<class T>
const T & Teuchos::ArrayRCP< const T >::operator* ( ) const
inline

◆ get() [1/2]

template<class T>
const T * Teuchos::ArrayRCP< const T >::get ( ) const
inline

◆ getRawPtr() [1/2]

template<class T>
const T * Teuchos::ArrayRCP< const T >::getRawPtr ( ) const
inline

◆ operator[]() [1/2]

template<class T>
const T & Teuchos::ArrayRCP< const T >::operator[] ( size_type offset) const
inline

◆ operator++() [1/4]

template<class T>
ArrayRCP< const T > & Teuchos::ArrayRCP< const T >::operator++ ( )
inline

◆ operator++() [2/4]

template<class T>
ArrayRCP< const T > Teuchos::ArrayRCP< const T >::operator++ ( int )
inline

◆ operator--() [1/4]

template<class T>
ArrayRCP< const T > & Teuchos::ArrayRCP< const T >::operator-- ( )
inline

◆ operator--() [2/4]

template<class T>
ArrayRCP< const T > Teuchos::ArrayRCP< const T >::operator-- ( int )
inline

◆ operator+=() [1/2]

template<class T>
ArrayRCP< const T > & Teuchos::ArrayRCP< const T >::operator+= ( size_type offset)
inline

◆ operator-=() [1/2]

template<class T>
ArrayRCP< const T > & Teuchos::ArrayRCP< const T >::operator-= ( size_type offset)
inline

◆ operator+() [1/2]

template<class T>
ArrayRCP< const T > Teuchos::ArrayRCP< const T >::operator+ ( size_type offset) const
inline

◆ operator-() [1/2]

template<class T>
ArrayRCP< const T > Teuchos::ArrayRCP< const T >::operator- ( size_type offset) const
inline

◆ begin() [1/2]

template<class T>
iterator Teuchos::ArrayRCP< const T >::begin ( ) const
inline

◆ end() [1/2]

template<class T>
iterator Teuchos::ArrayRCP< const T >::end ( ) const
inline

◆ getConst() [1/2]

template<class T>
ArrayRCP< const T > Teuchos::ArrayRCP< const T >::getConst ( ) const
inline

Return const reference to the array.

This method has a trivial implementation for the const T specialization of ArrayRCP.

◆ persistingView() [1/2]

template<class T>
ArrayRCP< const T > Teuchos::ArrayRCP< const T >::persistingView ( size_type lowerOffset,
size_type size ) const
inline

◆ lowerOffset() [1/2]

template<class T>
size_type Teuchos::ArrayRCP< const T >::lowerOffset ( ) const
inline

◆ upperOffset() [1/2]

template<class T>
size_type Teuchos::ArrayRCP< const T >::upperOffset ( ) const
inline

◆ size() [1/2]

template<class T>
size_type Teuchos::ArrayRCP< const T >::size ( ) const
inline

◆ view() [1/2]

template<class T>
ArrayView< const T > Teuchos::ArrayRCP< const T >::view ( size_type lowerOffset,
size_type size ) const
inline

◆ operator()() [1/4]

template<class T>
ArrayView< const T > Teuchos::ArrayRCP< const T >::operator() ( size_type lowerOffset,
size_type size ) const
inline

◆ operator()() [2/4]

template<class T>
ArrayView< const T > Teuchos::ArrayRCP< const T >::operator() ( ) const
inline

◆ resize() [1/2]

template<class T>
void Teuchos::ArrayRCP< const T >::resize ( const size_type n,
const T & val = T() )
inline

◆ clear() [1/2]

template<class T>
void Teuchos::ArrayRCP< const T >::clear ( )
inline

◆ strength() [1/2]

template<class T>
ERCPStrength Teuchos::ArrayRCP< const T >::strength ( ) const
inline

◆ is_valid_ptr() [1/2]

template<class T>
bool Teuchos::ArrayRCP< const T >::is_valid_ptr ( ) const
inline

◆ strong_count() [1/2]

template<class T>
int Teuchos::ArrayRCP< const T >::strong_count ( ) const
inline

◆ weak_count() [1/2]

template<class T>
int Teuchos::ArrayRCP< const T >::weak_count ( ) const
inline

◆ total_count() [1/2]

template<class T>
int Teuchos::ArrayRCP< const T >::total_count ( ) const
inline

◆ set_has_ownership() [1/2]

template<class T>
void Teuchos::ArrayRCP< const T >::set_has_ownership ( )
inline

◆ has_ownership() [1/2]

template<class T>
bool Teuchos::ArrayRCP< const T >::has_ownership ( ) const
inline

◆ release() [1/2]

template<class T>
const T * Teuchos::ArrayRCP< const T >::release ( )
inline

◆ create_weak() [1/2]

template<class T>
ArrayRCP< const T > Teuchos::ArrayRCP< const T >::create_weak ( ) const
inline

◆ create_strong() [1/2]

template<class T>
ArrayRCP< const T > Teuchos::ArrayRCP< const T >::create_strong ( ) const
inline

◆ shares_resource() [1/2]

template<class T>
template<class T2>
bool Teuchos::ArrayRCP< const T >::shares_resource ( const ArrayRCP< T2 > & r_ptr) const
inline

◆ assert_not_null() [1/2]

template<class T>
const ArrayRCP< const T > & Teuchos::ArrayRCP< const T >::assert_not_null ( ) const
inline

◆ assert_in_range() [1/2]

template<class T>
const ArrayRCP< const T > & Teuchos::ArrayRCP< const T >::assert_in_range ( size_type lowerOffset,
size_type size ) const
inline

◆ assert_valid_ptr() [1/2]

template<class T>
const ArrayRCP< const T > & Teuchos::ArrayRCP< const T >::assert_valid_ptr ( ) const
inline

◆ debug_assert_not_null() [1/2]

template<class T>
void Teuchos::ArrayRCP< const T >::debug_assert_not_null ( ) const
inlineprivate

Definition at line 934 of file Teuchos_ArrayRCPDecl.hpp.

◆ debug_assert_in_range() [1/2]

template<class T>
void Teuchos::ArrayRCP< const T >::debug_assert_in_range ( size_type lowerOffset_in,
size_type size_in ) const
inlineprivate

Definition at line 941 of file Teuchos_ArrayRCPDecl.hpp.

◆ debug_assert_valid_ptr() [1/2]

template<class T>
void Teuchos::ArrayRCP< const T >::debug_assert_valid_ptr ( ) const
inlineprivate

Definition at line 950 of file Teuchos_ArrayRCPDecl.hpp.

◆ operator=() [2/2]

ArrayRCP< const T > & Teuchos::ArrayRCP< T >::operator= ( const ArrayRCP< T > & r_ptr)
inline

Assignment operator: Makes *this reference the input array.

If the input array is a reference to *this (that is, if this->getRawPtr() == r_ptr.getRawPtr()), then this method does nothing. Otherwise, it does the following:

  1. Decrements the reference count of *this (as if its destructor had been called)
  2. Makes *this a reference to the input array (thus incrementing its reference count)

For example, after the following sample code is done, the array to which x originally pointed on construction will have reference count 2, and the array to which y originally pointed on constructor will have reference count 0 (and will thus be deallocated).

x = y;
ArrayRCP< T > arcp(const RCP< Array< T > > &v)
Postcondition
this->get() == r_ptr.get()
this->count() == r_ptr.count()
this->has_ownership() == r_ptr.has_ownership()
If r_ptr.get() != NULL then r_ptr.count() is incremented by 1

Definition at line 321 of file Teuchos_ArrayRCP.hpp.

◆ is_null() [2/2]

bool Teuchos::ArrayRCP< T >::is_null ( ) const
inline

True if the underlying pointer is null, else false.

Definition at line 328 of file Teuchos_ArrayRCP.hpp.

◆ operator->() [2/2]

const T * Teuchos::ArrayRCP< T >::operator-> ( ) const
inline

Pointer (->) access to members of underlying object for current position.

Precondition
this->get() != NULL
this->lowerOffset() <= 0
this->upperOffset() >= 0

Definition at line 337 of file Teuchos_ArrayRCP.hpp.

◆ operator*() [2/2]

const T & Teuchos::ArrayRCP< T >::operator* ( ) const
inline

Dereference the underlying object for the current pointer position.

Precondition
this->get() != NULL
this->lowerOffset() <= 0
this->upperOffset() >= 0

Definition at line 346 of file Teuchos_ArrayRCP.hpp.

◆ get() [2/2]

const T * Teuchos::ArrayRCP< T >::get ( ) const
inline

Get the raw C++ pointer to the underlying object.

Precondition
[*this != null] this->lowerOffset() <= 0
[*this != null] this->upperOffset() >= 0

Definition at line 353 of file Teuchos_ArrayRCP.hpp.

◆ getRawPtr() [2/2]

const T * Teuchos::ArrayRCP< T >::getRawPtr ( ) const
inline

Get the raw C++ pointer to the underlying object.

Precondition
[*this != null] this->lowerOffset() <= 0
[*this != null] this->upperOffset() >= 0

Definition at line 360 of file Teuchos_ArrayRCP.hpp.

◆ operator[]() [2/2]

const T & Teuchos::ArrayRCP< T >::operator[] ( size_type offset) const
inline

Random object access.

Precondition
this->get() != NULL
this->lowerOffset() <= offset && offset <= this->upperOffset()

Definition at line 367 of file Teuchos_ArrayRCP.hpp.

◆ operator++() [3/4]

ArrayRCP< const T > & Teuchos::ArrayRCP< T >::operator++ ( )
inline

Prefix increment of pointer (i.e. ++ptr).

Does nothing if this->get() == NULL.

Postcondition
[this->get()!=NULL] this->get() is incremented by 1
[this->get()!=NULL] this->lowerOffset() is decremented by 1
[this->get()!=NULL] this->upperOffset() is decremented by 1

Definition at line 381 of file Teuchos_ArrayRCP.hpp.

◆ operator++() [4/4]

ArrayRCP< const T > Teuchos::ArrayRCP< T >::operator++ ( int )
inline

Postfix increment of pointer (i.e. ptr++).

Does nothing if this->get() == NULL.

Postcondition
this->get() is incremented by 1
this->lowerOffset() is decremented by 1
this->upperOffset() is decremented by 1

Definition at line 391 of file Teuchos_ArrayRCP.hpp.

◆ operator--() [3/4]

ArrayRCP< const T > & Teuchos::ArrayRCP< T >::operator-- ( )
inline

Prefix decrement of pointer (i.e. –ptr).

Does nothing if this->get() == NULL.

Postcondition
[this->get()!=NULL] this->get() is decremented by 1
[this->get()!=NULL] this->lowerOffset() is incremented by 1
[this->get()!=NULL] this->upperOffset() is incremented by 1

Definition at line 401 of file Teuchos_ArrayRCP.hpp.

◆ operator--() [4/4]

ArrayRCP< const T > Teuchos::ArrayRCP< T >::operator-- ( int )
inline

Postfix decrement of pointer (i.e. ptr–).

Does nothing if this->get() == NULL.

Postcondition
this->get() is decremented by 1
this->lowerOffset() is incremented by 1
this->upperOffset() is incremented by 1

Definition at line 411 of file Teuchos_ArrayRCP.hpp.

◆ operator+=() [2/2]

ArrayRCP< const T > & Teuchos::ArrayRCP< T >::operator+= ( size_type offset)
inline

Pointer integer increment (i.e. ptr+=offset).

Does nothing if this->get() == NULL.

Postcondition
[this->get()!=NULL] this->get() is incremented by offset
[this->get()!=NULL] this->lowerOffset() is decremented by offset
[this->get()!=NULL] this->upperOffset() is decremented by offset

Definition at line 421 of file Teuchos_ArrayRCP.hpp.

◆ operator-=() [2/2]

ArrayRCP< const T > & Teuchos::ArrayRCP< T >::operator-= ( size_type offset)
inline

Pointer integer increment (i.e. ptr-=offset).

Does nothing if this->get() == NULL.

Postcondition
[this->get()!=NULL] this->get() is decremented by offset
[this->get()!=NULL] this->lowerOffset() is incremented by offset
[this->get()!=NULL] this->upperOffset() is incremented by offset

Definition at line 431 of file Teuchos_ArrayRCP.hpp.

◆ operator+() [2/2]

ArrayRCP< const T > Teuchos::ArrayRCP< T >::operator+ ( size_type offset) const
inline

Pointer integer increment (i.e. ptr+offset).

Returns a null pointer if this->get() == NULL.

Postcondition
[this->get()!=NULL] return->get() == this->get() + offset
[this->get()!=NULL] return->lowerOffset() == this->lowerOffset() - offset
[this->get()!=NULL] return->upperOffset() == this->upperOffset() - offset

Note that since implicit conversion of ArrayRCP<T> objects is not allowed that it does not help at all to make this function into a non-member function.

Definition at line 445 of file Teuchos_ArrayRCP.hpp.

◆ operator-() [2/2]

ArrayRCP< const T > Teuchos::ArrayRCP< T >::operator- ( size_type offset) const
inline

Pointer integer decrement (i.e. ptr-offset).

Returns a null pointer if this->get() == NULL.

Postcondition
[this->get()!=NULL] return->get() == this->get() - offset
[this->get()!=NULL] return->lowerOffset() == this->lowerOffset() + offset
[this->get()!=NULL] return->upperOffset() == this->upperOffset() + offset

Note that since implicit conversion of ArrayRCP<T> objects is not allowed that it does not help at all to make this function into a non-member function.

Definition at line 459 of file Teuchos_ArrayRCP.hpp.

◆ begin() [2/2]

ArrayRCP< constT >::iterator Teuchos::ArrayRCP< T >::begin ( ) const
inline

Return an iterator to beginning of the array of data.

If HAVE_TEUCHOS_ARRAY_BOUNDSCHECK is defined then the iterator returned is an ArrayRCP<T> object and all operations are checked at runtime. When HAVE_TEUCHOS_ARRAY_BOUNDSCHECK is not defined, the a raw pointer T* is returned for fast execution.

Postcondition
[this->get()!=NULL] &*return == this->get()
[this->get()==NULL] return == (null or NULL)

Definition at line 475 of file Teuchos_ArrayRCP.hpp.

◆ end() [2/2]

ArrayRCP< constT >::iterator Teuchos::ArrayRCP< T >::end ( ) const
inline

Return an iterator to past the end of the array of data.

If HAVE_TEUCHOS_ARRAY_BOUNDSCHECK is defined then the iterator returned is an ArrayRCP<T> object and all operations are checked at runtime. When HAVE_TEUCHOS_ARRAY_BOUNDSCHECK is not defined, the a raw pointer T* is returned for fast execution.

Postcondition
[this->get()!=NULL] &*end == this->get()+(this->upperOffset()+1)
[this->get()==NULL] return == (null or NULL)

Definition at line 487 of file Teuchos_ArrayRCP.hpp.

◆ getConst() [2/2]

ArrayRCP< const T > Teuchos::ArrayRCP< T >::getConst ( ) const
inline

Return object for only const access to data.

This function should only compile successfully if the type T is not already declared const!

Definition at line 498 of file Teuchos_ArrayRCP.hpp.

◆ persistingView() [2/2]

ArrayRCP< const T > Teuchos::ArrayRCP< T >::persistingView ( size_type lowerOffset,
size_type size ) const
inline

Return a persisting view of a contiguous range of elements.

Precondition
this->get() != NULL
this->lowerOffset() <= lowerOffset
lowerOffset + size - 1 <= this->upperOffset()
Postcondition
return->get() == this->get() + lowerOffset
return->lowerOffset() == 0
return->upperOffset() == size-1
Note
A size==0 view of even a null ArrayRCP is allowed. It returns a null view in that case.

Definition at line 513 of file Teuchos_ArrayRCP.hpp.

◆ lowerOffset() [2/2]

ArrayRCP< constT >::size_type Teuchos::ArrayRCP< T >::lowerOffset ( ) const
inline

Return the lower offset to valid data.

Definition at line 520 of file Teuchos_ArrayRCP.hpp.

◆ upperOffset() [2/2]

ArrayRCP< constT >::size_type Teuchos::ArrayRCP< T >::upperOffset ( ) const
inline

Return the upper offset to valid data.

Definition at line 523 of file Teuchos_ArrayRCP.hpp.

◆ size() [2/2]

ArrayRCP< constT >::size_type Teuchos::ArrayRCP< T >::size ( ) const
inline

The total number of entries in the array.

x.upperOffset() - x.lowerOffset() + 1 == x.size() for any ArrayRCP x.

Definition at line 529 of file Teuchos_ArrayRCP.hpp.

◆ view() [2/2]

ArrayView< const T > Teuchos::ArrayRCP< T >::view ( size_type lowerOffset,
size_type size ) const
inline

Return a nonpersisting view of a contiguous range of elements.

Precondition
this->get() != NULL
this->lowerOffset() <= lowerOffset
lowerOffset + size - 1 <= this->upperOffset()
Postcondition
return->get() == this->get() + lowerOffset
return->lowerOffset() == 0
return->upperOffset() == size-1
Note
A size==0 view of even a null ArrayRCP is allowed. It returns a null view in that case.

Definition at line 548 of file Teuchos_ArrayRCP.hpp.

◆ operator()() [3/4]

ArrayView< const T > Teuchos::ArrayRCP< T >::operator() ( size_type lowerOffset,
size_type size ) const
inline

Return a nonpersisting view of a contiguous range of elements.

This is equivalent to calling view (offset, size).

Definition at line 554 of file Teuchos_ArrayRCP.hpp.

◆ operator()() [4/4]

ArrayView< const T > Teuchos::ArrayRCP< T >::operator() ( ) const
inline

Return a nonpersisting view of *this.

Note
This will return a null ArrayView if this->size() == 0.

Definition at line 560 of file Teuchos_ArrayRCP.hpp.

◆ operator ArrayRCP< const T >()

Teuchos::ArrayRCP< T >::operator ArrayRCP< const T > ( ) const
inline

Convert from ArrayRCP<T> to ArrayRCP<const T>.

Note
This conversion operator does not exist if T is already a const type (that is, if T is const T' for some type T'). In that case, the assignment operator and copy constructor achieve the same syntactic effect.

Definition at line 572 of file Teuchos_ArrayRCP.hpp.

◆ assign() [1/2]

void Teuchos::ArrayRCP< T >::assign ( size_type n,
const T & val )
inline

Resize and assign n elements of val.

\postconditions size() == n

Definition at line 582 of file Teuchos_ArrayRCP.hpp.

◆ assign() [2/2]

void Teuchos::ArrayRCP< T >::assign ( Iter first,
Iter last )
inline

Resize and assign to iterator sequence [first, last)

\postconditions size() == std::distance(first, last)

This will not change the underlying pointer array if the size does not change.

Definition at line 592 of file Teuchos_ArrayRCP.hpp.

◆ deepCopy()

void Teuchos::ArrayRCP< T >::deepCopy ( const ArrayView< const T > & av)
inline

Deep copy the elements from one ArrayView object into this object.

This is equivalent to calling assign (av.begin (), av.end ())

Definition at line 599 of file Teuchos_ArrayRCP.hpp.

◆ resize() [2/2]

void Teuchos::ArrayRCP< T >::resize ( const size_type n,
const T & val = T() )
inline

Resize and append new elements if necessary.

Definition at line 602 of file Teuchos_ArrayRCP.hpp.

◆ clear() [2/2]

void Teuchos::ArrayRCP< T >::clear ( )
inline

Resize to zero.

\postconditions size()==0

Definition at line 608 of file Teuchos_ArrayRCP.hpp.

◆ strength() [2/2]

ERCPStrength Teuchos::ArrayRCP< T >::strength ( ) const
inline

Strength of the pointer.

Return values:

  • RCP_STRONG: Underlying reference-counted object will be deleted when *this is destroyed if strong_count()==1.
  • RCP_WEAK: Underlying reference-counted object will not be deleted when *this is destroyed if strong_count() > 0.
  • RCP_STRENGTH_INVALID: *this is not strong or weak but is null.

Definition at line 625 of file Teuchos_ArrayRCP.hpp.

◆ is_valid_ptr() [2/2]

bool Teuchos::ArrayRCP< T >::is_valid_ptr ( ) const
inline

Return whether the underlying object pointer is still valid.

The underlying object will not be valid if the strong count has gone to zero but the weak count has not.

NOTE: Null is a valid object pointer. If you want to know if there is a non-null object and it is valid then !is_null() && is_valid_ptr() will be true.

Definition at line 636 of file Teuchos_ArrayRCP.hpp.

◆ strong_count() [2/2]

int Teuchos::ArrayRCP< T >::strong_count ( ) const
inline

Return the number of active RCP<> objects that have a "strong" reference to the underlying reference-counted object.

Returns
If this->get() == NULL then this function returns 0.

Definition at line 643 of file Teuchos_ArrayRCP.hpp.

◆ weak_count() [2/2]

int Teuchos::ArrayRCP< T >::weak_count ( ) const
inline

Return the number of active RCP<> objects that have a "weak" reference to the underlying reference-counted object.

Returns
If this->get() == NULL then this function returns 0.

Definition at line 650 of file Teuchos_ArrayRCP.hpp.

◆ total_count() [2/2]

int Teuchos::ArrayRCP< T >::total_count ( ) const
inline

Total count (strong_count() + weak_count()).

Definition at line 653 of file Teuchos_ArrayRCP.hpp.

◆ set_has_ownership() [2/2]

void Teuchos::ArrayRCP< T >::set_has_ownership ( )
inline

Give this and other ArrayRCP<> objects ownership of the underlying referenced array to delete it.

See ~ArrayRCP() above. This function does nothing if this->get() == NULL.

Postconditions:

Definition at line 672 of file Teuchos_ArrayRCP.hpp.

◆ has_ownership() [2/2]

bool Teuchos::ArrayRCP< T >::has_ownership ( ) const
inline

Returns true if this has ownership of object pointed to by this->get() in order to deallocate it.

See the above documentation for the destructor.

Returns
If this->get() == NULL then this function always returns false. Otherwise the value returned from this function depends on which function was called most recently, if any; set_has_ownership() (true) or release() (false).

Definition at line 685 of file Teuchos_ArrayRCP.hpp.

◆ release() [2/2]

const T * Teuchos::ArrayRCP< T >::release ( )
inline

Release the ownership of the underlying array.

After this function is called then the client is responsible for deleting the returned pointer no matter how many ref_count_ptr<T> objects have a reference to it. If this->get() == NULL, then this call is meaningless.

Note that this function does not have the exact same semantics as does auto_ptr<T>::release(). In auto_ptr<T>::release(), this is set to NULL while here in ArrayRCP<T>:: release() only an ownership flag is set and this still points to the same array. It would be difficult to duplicate the behavior of auto_ptr<T>::release() for this class.

Postconditions:

Returns
Returns the value of this->get()

Definition at line 707 of file Teuchos_ArrayRCP.hpp.

◆ create_weak() [2/2]

ArrayRCP< const T > Teuchos::ArrayRCP< T >::create_weak ( ) const
inline

Create a new weak reference from another (strong) reference.

A "weak" reference gives access to the array, without incrementing its (strong) reference count. This lets you have access to the array, without affecting when it gets deallocated.

Precondition
returnVal.is_valid_ptr()==true
Postcondition
returnVal.get() == this->get()
returnVal.strong_count() == this->strong_count()
returnVal.weak_count() == this->weak_count()+1
returnVal.strength() == RCP_WEAK
returnVal.has_ownership() == this->has_ownership()

Definition at line 723 of file Teuchos_ArrayRCP.hpp.

◆ create_strong() [2/2]

ArrayRCP< const T > Teuchos::ArrayRCP< T >::create_strong ( ) const
inline

Create a new strong RCP object from another (weak) RCP object.

A "weak" reference gives access to the array, without incrementing its (strong) reference count. This method lets you "promote" a weak reference into a strong reference. If the array has been deallocated, the returned reference is null.

Precondition
returnVal.is_valid_ptr()==true
Postcondition
returnVal.get() == this->get()
returnVal.strong_count() == this->strong_count()+1
returnVal.weak_count() == this->weak_count()
returnVal.strength() == RCP_STRONG
returnVal.has_ownership() == this->has_ownership()

Definition at line 740 of file Teuchos_ArrayRCP.hpp.

◆ shares_resource() [2/2]

bool Teuchos::ArrayRCP< T >::shares_resource ( const ArrayRCP< T2 > & r_ptr) const
inline

Returns true if the smart pointers share the same underlying reference-counted object.

This method does more than just check if this->get() == r_ptr.get(). It also checks to see if the underlying reference counting machinery is the same.

Definition at line 749 of file Teuchos_ArrayRCP.hpp.

◆ assert_not_null() [2/2]

const ArrayRCP< const T > & Teuchos::ArrayRCP< T >::assert_not_null ( ) const
inline

Throws NullReferenceError if this->get()==NULL, otherwise returns reference to *this.

Definition at line 758 of file Teuchos_ArrayRCP.hpp.

◆ assert_in_range() [2/2]

const ArrayRCP< const T > & Teuchos::ArrayRCP< T >::assert_in_range ( size_type lowerOffset,
size_type size ) const
inline

Throws NullReferenceError if this->get()==NULL orthis->get()!=NULL, throws RangeError if (lowerOffset < this->lowerOffset() || this->upperOffset() < upperOffset, otherwise returns reference to *this

Definition at line 765 of file Teuchos_ArrayRCP.hpp.

◆ assert_valid_ptr() [2/2]

const ArrayRCP< const T > & Teuchos::ArrayRCP< T >::assert_valid_ptr ( ) const
inline

If the object pointer is non-null, assert that it is still valid.

If is_null()==false && strong_count()==0, this will throw DanglingReferenceErorr with a great error message.

If is_null()==true, then this will not throw any exception.

In this context, null is a valid object.

Definition at line 776 of file Teuchos_ArrayRCP.hpp.

◆ debug_assert_not_null() [2/2]

void Teuchos::ArrayRCP< T >::debug_assert_not_null ( ) const
inlineprivate

Definition at line 790 of file Teuchos_ArrayRCPDecl.hpp.

◆ debug_assert_in_range() [2/2]

void Teuchos::ArrayRCP< T >::debug_assert_in_range ( size_type lowerOffset_in,
size_type size_in ) const
inlineprivate

Definition at line 797 of file Teuchos_ArrayRCPDecl.hpp.

◆ debug_assert_valid_ptr() [2/2]

void Teuchos::ArrayRCP< T >::debug_assert_valid_ptr ( ) const
inlineprivate

Definition at line 807 of file Teuchos_ArrayRCPDecl.hpp.

Friends And Related Symbol Documentation

◆ arcp() [1/14]

ArrayRCP< T > arcp ( const RCP< Array< T > > & v)
related

Wrap an RCP<Array<T> > object as an ArrayRCP<T> object.

Definition at line 541 of file Teuchos_Array.hpp.

◆ arcp() [2/14]

ArrayRCP< const T > arcp ( const RCP< const Array< T > > & v)
related

Wrap a RCP<const Array<T> > object as an ArrayRCP<const T> object.

Definition at line 558 of file Teuchos_Array.hpp.

◆ arcpFromArray() [1/4]

ArrayRCP< T > arcpFromArray ( Array< T > & a)
related

Wrap an Array<T> object as a non-owning ArrayRCP<T> object.

Definition at line 575 of file Teuchos_Array.hpp.

◆ arcpFromArray() [2/4]

ArrayRCP< const T > arcpFromArray ( const Array< T > & a)
related

Wrap a const Array<T> object as a non-owning ArrayRCP<T> object.

Definition at line 593 of file Teuchos_Array.hpp.

◆ arcp() [3/14]

ArrayRCP< T > arcp ( T * p,
typename ArrayRCP< T >::size_type lowerOffset,
typename ArrayRCP< T >::size_type size,
bool owns_mem = true )
related

Wraps a preallocated array of data with the assumption to call the array version of delete.

◆ arcp() [4/14]

ArrayRCP< T > arcp ( T * p,
typename ArrayRCP< T >::size_type lowerOffset,
typename ArrayRCP< T >::size_type size,
Dealloc_T dealloc,
bool owns_mem )
related

Wraps a preallocated array of data and uses a templated deallocation strategy object to define deletion .

◆ arcp() [5/14]

ArrayRCP< T > arcp ( typename ArrayRCP< T >::size_type size)
related

Allocate a new array just given a dimension.

Warning! The memory is allocated using new T[size] and is not initialized (unless there is a default constructor for a user-defined type).

When called with 'size == 0' it returns a null ArrayRCP object.

◆ arcpCloneNode() [1/2]

ArrayRCP< T > arcpCloneNode ( const ArrayRCP< T > & a)
related

Allocate a new ArrayRCP object with a new RCPNode with memory pointing to the initial node.

The purpose of this function is to create a new "handle" to the array of memory with its own seprate reference count. The new ArrayRCP object will have a new RCPNodeTmpl object that has a copy of the input ArrayRCP object embedded in it. This maintains the correct reference counting behaviors but now gives a private count. One would want to use arcpCloneNode(...) whenever it is important to keep a private reference count which is needed for some types of use cases.

◆ arcpClone() [1/2]

ArrayRCP< T > arcpClone ( const ArrayView< const T > & v)
related

Allocate a new array by cloning data from an input array view.

◆ arcpWithEmbeddedObjPreDestroy() [1/2]

ArrayRCP< T > arcpWithEmbeddedObjPreDestroy ( T * p,
typename ArrayRCP< T >::size_type lowerOffset,
typename ArrayRCP< T >::size_type size,
const Embedded & embedded,
bool owns_mem = true )
related

Create an ArrayRCP with and also put in an embedded object.

In this case the embedded object is destroyed (by setting to Embedded()) before the object at *p is destroyed.

The embedded object can be extracted using getEmbeddedObj() and getNonconstEmbeddedObject().

◆ arcpWithEmbeddedObjPostDestroy() [1/2]

ArrayRCP< T > arcpWithEmbeddedObjPostDestroy ( T * p,
typename ArrayRCP< T >::size_type lowerOffset,
typename ArrayRCP< T >::size_type size,
const Embedded & embedded,
bool owns_mem = true )
related

Create an ArrayRCP with and also put in an embedded object.

In this case the embedded object is destroyed (by setting to Embedded()) after the object at *p is destroyed.

The embedded object can be extracted using getEmbeddedObj() and getNonconstEmbeddedObject().

◆ arcpWithEmbeddedObj() [1/2]

ArrayRCP< T > arcpWithEmbeddedObj ( T * p,
typename ArrayRCP< T >::size_type lowerOffset,
typename ArrayRCP< T >::size_type size,
const Embedded & embedded,
bool owns_mem = true )
related

Create an ArrayRCP with and also put in an embedded object.

This function should be called when it is not important when the embedded object is destroyed (by setting to Embedded()) with respect to when *p is destroyed.

The embedded object can be extracted using getEmbeddedObj() and getNonconstEmbeddedObject().

◆ arcp() [6/14]

ArrayRCP< T > arcp ( const RCP< std::vector< T > > & v)
related

Wrap an std::vector<T> object as an ArrayRCP<T> object.

◆ arcp() [7/14]

ArrayRCP< const T > arcp ( const RCP< const std::vector< T > > & v)
related

Wrap a const std::vector<T> object as an ArrayRCP<const T> object.

◆ arcpFromArrayView() [1/2]

ArrayRCP< T > arcpFromArrayView ( const ArrayView< T > & av)
related

Get an ArrayRCP object out of an ArrayView object.

This conversion is required and proper in certain types of situations. In a debug build, a dangling reference will be detected with an exception being thrown.

◆ get_std_vector() [1/4]

RCP< std::vector< T > > get_std_vector ( const ArrayRCP< T > & ptr)
related

Get an std::vector<T> object out of an ArrayRCP<T> object that was created using the arcp() function above to wrap the std::vector in the first place..

◆ get_std_vector() [2/4]

RCP< const std::vector< T > > get_std_vector ( const ArrayRCP< const T > & ptr)
related

Get a const std::vector<T> object out of an ArrayRCP<const T> object that was created using the arcp() above to wrap the std::vector in the first place.

◆ is_null() [1/2]

bool is_null ( const ArrayRCP< T > & p)
related

Returns true if p.get()==NULL.

◆ nonnull() [1/2]

bool nonnull ( const ArrayRCP< T > & p)
related

Returns true if p.get()!=NULL.

◆ operator==() [1/4]

bool operator== ( const ArrayRCP< T > & p,
ENull  )
related

Returns true if p.get()==NULL.

◆ operator!=() [1/4]

bool operator!= ( const ArrayRCP< T > & p,
ENull  )
related

Returns true if p.get()!=NULL.

◆ operator==() [2/4]

bool operator== ( const ArrayRCP< T1 > & p1,
const ArrayRCP< T2 > & p2 )
related

Compare two ArrayRCP objects for equality (by pointers).

◆ operator!=() [2/4]

bool operator!= ( const ArrayRCP< T1 > & p1,
const ArrayRCP< T2 > & p2 )
related

Compare two ArrayRCP objects for inequality (by pointers).

◆ operator<() [1/2]

bool operator< ( const ArrayRCP< T1 > & p1,
const ArrayRCP< T2 > & p2 )
related

Compare the two ArrayRCP objects' pointers using <.

◆ operator<=() [1/2]

bool operator<= ( const ArrayRCP< T1 > & p1,
const ArrayRCP< T2 > & p2 )
related

Compare the two ArrayRCP objects' pointers using <=.

◆ operator>() [1/2]

bool operator> ( const ArrayRCP< T1 > & p1,
const ArrayRCP< T2 > & p2 )
related

Compare the two ArrayRCP objects' pointers using >.

◆ operator>=() [1/2]

bool operator>= ( const ArrayRCP< T1 > & p1,
const ArrayRCP< T2 > & p2 )
related

Compare the two ArrayRCP objects' pointers using >=.

◆ operator-() [1/2]

ArrayRCP< T >::difference_type operator- ( const ArrayRCP< T > & p1,
const ArrayRCP< T > & p2 )
related

Return the difference of two ArrayRCP objects.

The difference of two ArrayRCP objects is the difference of their two pointers.

◆ arcp_const_cast() [1/2]

ArrayRCP< T2 > arcp_const_cast ( const ArrayRCP< T1 > & p1)
related

Const cast of underlying ArrayRCP type from const T* to T*.

The function will compile only if the following code compiles:

T2* p2 = const_cast<T2*> (p1.get ());

◆ arcp_reinterpret_cast() [1/2]

ArrayRCP< T2 > arcp_reinterpret_cast ( const ArrayRCP< T1 > & p1)
related

Reinterpret cast of underlying ArrayRCP type from T1* to T2*.

The function will compile only if the following code compiles:

T2* p2 = reinterpret_cast<T2*> (p1.get ());
Warning
This function is only for advanced users.

◆ arcp_reinterpret_cast_nonpod() [1/2]

ArrayRCP< T2 > arcp_reinterpret_cast_nonpod ( const ArrayRCP< T1 > & p1,
const T2 & val = T2() )
related

Reinterpret cast of underlying ArrayRCP type from T1* to T2* where T2 is a non-POD (non-plain-old-data).

The function will compile only if (reinterpret_cast<T2*>(p1.get());) compiles.

This function is used to reinterpret-cast an array of plain-old-data (POD) (e.g. int or char) into an array of objects of type T2, which is not a plain-old-data type. The constructors will be called on each of the memory locations with placement new and the destructors will get called when the last ArrayRCP goes away.

Warning
This function is only for advanced users.

◆ arcp_implicit_cast() [1/2]

ArrayRCP< T2 > arcp_implicit_cast ( const ArrayRCP< T1 > & p1)
related

Implicit case the underlying ArrayRCP type from T1* to T2*.

The function will compile only if (T2 *p = p1.get();) compiles.

Warning! Do not use this function unless you absolutely know what you are doing. While implicit casting of pointers to single objects is usually 100% safe, implicit casting pointers to arrays of objects can be very dangerous. One std::exception that is always safe is when you are implicit casting an array of pointers to non-const objects to an array of const pointers to const objects. For example, the following implicit conversion from a array pointer objects aptr1 of type ArrayRCP<T*> to

ArrayRCP< T2 > arcp_implicit_cast(const ArrayRCP< T1 > &p1)

is always legal and safe to do.

◆ set_extra_data() [1/2]

void set_extra_data ( const T1 & extra_data,
const std::string & name,
const Ptr< ArrayRCP< T2 > > & p,
EPrePostDestruction destroy_when = POST_DESTROY,
bool force_unique = true )
related

Set extra data associated with a ArrayRCP object.

Parameters
extra_data[in] Data object that will be set (copied)
name[in] The name given to the extra data. The value of name together with the data type T1 of the extra data must be unique from any other such data or the other data will be overwritten.
p[out] On output, will be updated with the input extra_data
destroy_when[in] Determines when extra_data will be destroyed in relation to the underlying reference-counted object. If destroy_when==PRE_DESTROY then extra_data will be deleted before the underlying reference-counted object. If destroy_when==POST_DESTROY (the default) then extra_data will be deleted after the underlying reference-counted object.
force_unique[in] Determines if this type and name pair must be unique in which case if an object with this same type and name already exists, then an std::exception will be thrown. The default is true for safety.

If there is a call to this function with the same type of extra data T1 and same arguments p and name has already been made, then the current piece of extra data already set will be overwritten with extra_data. However, if the type of the extra data T1 is different, then the extra data can be added and not overwrite existing extra data. This means that extra data is keyed on both the type and name. This helps to minimize the chance that clients will unexpectedly overwrite data by accident.

When the last RefcountPtr object is removed and the reference-count node is deleted, then objects are deleted in the following order: (1) All of the extra data that where added with destroy_when==PRE_DESTROY are first, (2) then the underlying reference-counted object is deleted, and (3) the rest of the extra data that was added with destroy_when==PRE_DESTROY is then deleted. The order in which the objects are destroyed is not guaranteed. Therefore, clients should be careful not to add extra data that has deletion dependencies (instead consider using nested ArrayRCP objects as extra data which will guarantee the order of deletion).

Preconditions:

  • p->get() != NULL (throws NullReferenceError)
  • If this function has already been called with the same template type T1 for extra_data and the same std::string name and force_unique==true, then an std::invalid_argument std::exception will be thrown.

Note, this function is made a non-member function to be consistent with the non-member get_extra_data() functions.

◆ get_extra_data() [1/4]

T1 & get_extra_data ( ArrayRCP< T2 > & p,
const std::string & name )
related

Get a non-const reference to extra data associated with a ArrayRCP object.

Parameters
p[in] Smart pointer object that extra data is being extracted from.
name[in] Name of the extra data.
Returns
Returns a non-const reference to the extra_data object.

Preconditions:

Note, this function must be a non-member function since the client must manually select the first template argument.

◆ get_extra_data() [2/4]

const T1 & get_extra_data ( const ArrayRCP< T2 > & p,
const std::string & name )
related

Get a const reference to extra data associated with a ArrayRCP object.

Parameters
p[in] Smart pointer object that extra data is being extracted from.
name[in] Name of the extra data.
Returns
Returns a const reference to the extra_data object.

Preconditions:

Note, this function must be a non-member function since the client must manually select the first template argument.

Also note that this const version is a false sense of security since a client can always copy a const ArrayRCP object into a non-const object and then use the non-const version to change the data. However, its presence will help to avoid some types of accidental changes to this extra data.

◆ get_optional_extra_data() [1/4]

T1 * get_optional_extra_data ( ArrayRCP< T2 > & p,
const std::string & name )
related

Get a pointer to non-const extra data (if it exists) associated with a ArrayRCP object.

Parameters
p[in] Smart pointer object that extra data is being extracted from.
name[in] Name of the extra data.
Returns
Returns a non-const pointer to the extra_data object.

Preconditions:

Postconditions:

  • If name and T1 have been used in a previous call to set_extra_data() then return !=NULL and otherwise return == NULL.

Note, this function must be a non-member function since the client must manually select the first template argument.

◆ get_optional_extra_data() [2/4]

const T1 * get_optional_extra_data ( const ArrayRCP< T2 > & p,
const std::string & name )
related

Get a pointer to const extra data (if it exists) associated with a ArrayRCP object.

Parameters
p[in] Smart pointer object that extra data is being extracted from.
name[in] Name of the extra data.
Returns
Returns a const pointer to the extra_data object if it exists.

Preconditions:

Postconditions:

  • If name and T1 have been used in a previous call to set_extra_data() then return !=NULL and otherwise return == NULL.

Note, this function must be a non-member function since the client must manually select the first template argument.

Also note that this const version is a false sense of security since a client can always copy a const ArrayRCP object into a non-const object and then use the non-const version to change the data. However, its presence will help to avoid some types of accidental changes to this extra data.

◆ get_nonconst_dealloc() [1/2]

Dealloc_T & get_nonconst_dealloc ( const ArrayRCP< T > & p)
related

Return a non-const reference to the underlying deallocator object.

Preconditions:

◆ get_dealloc() [1/2]

const Dealloc_T & get_dealloc ( const ArrayRCP< T > & p)
related

Return a const reference to the underlying deallocator object.

Preconditions:

Note that the const version of this function provides only a very ineffective attempt to avoid accidental changes to the deallocation object. A client can always just create a new non-const ArrayRCP<T> object from any const ArrayRCP<T> object and then call the non-const version of this function.

◆ get_optional_dealloc() [1/2]

const Dealloc_T * get_optional_dealloc ( const ArrayRCP< T > & p)
related

Return a pointer to the underlying non-const deallocator object if it exists.

Preconditions:

Postconditions:

  • If the deallocator object type used to construct p is same as Dealloc_T then return!=NULL, otherwise return==NULL

◆ get_optional_nonconst_dealloc() [1/2]

Dealloc_T * get_optional_nonconst_dealloc ( const ArrayRCP< T > & p)
related

Return a pointer to the underlying const deallocator object if it exists.

Preconditions:

Postconditions:

  • If the deallocator object type used to construct p is same as Dealloc_T then return!=NULL, otherwise return==NULL

Note that the const version of this function provides only a very ineffective attempt to avoid accidental changes to the deallocation object. A client can always just create a new non-const ArrayRCP<T> object from any const ArrayRCP<T> object and then call the non-const version of this function.

◆ getEmbeddedObj() [1/2]

const Embedded & getEmbeddedObj ( const ArrayRCP< T > & p)
related

Get a const reference to an embedded object that was set by calling arcpWithEmbeddedObjPreDestroy(), arcpWithEmbeddedObjPostDestory(), or arcpWithEmbeddedObj().

◆ getNonconstEmbeddedObj() [1/2]

Embedded & getNonconstEmbeddedObj ( const ArrayRCP< T > & p)
related

Get a const reference to an embedded object that was set by calling arcpWithEmbeddedObjPreDestroy(), arcpWithEmbeddedObjPostDestory(), or arcpWithEmbeddedObj().

◆ operator<<() [1/2]

std::ostream & operator<< ( std::ostream & out,
const ArrayRCP< T > & p )
related

Output stream inserter.

The implementation of this function just print pointer addresses and therefore puts not restrictions on the data types involved.

◆ is_null() [2/2]

bool is_null ( const ArrayRCP< T > & p)
related

Returns true if p.get()==NULL.

◆ operator-() [2/2]

ArrayRCP< T >::difference_type operator- ( const ArrayRCP< T > & p1,
const ArrayRCP< T > & p2 )
related

Return the difference of two ArrayRCP objects.

The difference of two ArrayRCP objects is the difference of their two pointers.

◆ arcp() [8/14]

ArrayRCP< T > arcp ( const RCP< Array< T > > & v)
related

Wrap an RCP<Array<T> > object as an ArrayRCP<T> object.

Definition at line 541 of file Teuchos_Array.hpp.

◆ arcp() [9/14]

ArrayRCP< const T > arcp ( const RCP< const Array< T > > & v)
related

Wrap a RCP<const Array<T> > object as an ArrayRCP<const T> object.

Definition at line 558 of file Teuchos_Array.hpp.

◆ arcp() [10/14]

ArrayRCP< T > arcp ( T * p,
typename ArrayRCP< T >::size_type lowerOffset,
typename ArrayRCP< T >::size_type size,
bool owns_mem = true )
related

Wraps a preallocated array of data with the assumption to call the array version of delete.

◆ arcp() [11/14]

ArrayRCP< T > arcp ( T * p,
typename ArrayRCP< T >::size_type lowerOffset,
typename ArrayRCP< T >::size_type size,
Dealloc_T dealloc,
bool owns_mem )
related

Wraps a preallocated array of data and uses a templated deallocation strategy object to define deletion .

◆ arcp() [12/14]

ArrayRCP< T > arcp ( typename ArrayRCP< T >::size_type size)
related

Allocate a new array just given a dimension.

Warning! The memory is allocated using new T[size] and is not initialized (unless there is a default constructor for a user-defined type).

When called with 'size == 0' it returns a null ArrayRCP object.

◆ arcp() [13/14]

ArrayRCP< T > arcp ( const RCP< std::vector< T > > & v)
related

Wrap an std::vector<T> object as an ArrayRCP<T> object.

◆ arcp() [14/14]

ArrayRCP< const T > arcp ( const RCP< const std::vector< T > > & v)
related

Wrap a const std::vector<T> object as an ArrayRCP<const T> object.

◆ arcpFromArray() [3/4]

ArrayRCP< T > arcpFromArray ( Array< T > & a)
related

Wrap an Array<T> object as a non-owning ArrayRCP<T> object.

Definition at line 575 of file Teuchos_Array.hpp.

◆ arcpFromArray() [4/4]

ArrayRCP< const T > arcpFromArray ( const Array< T > & a)
related

Wrap a const Array<T> object as a non-owning ArrayRCP<T> object.

Definition at line 593 of file Teuchos_Array.hpp.

◆ arcpCloneNode() [2/2]

ArrayRCP< T > arcpCloneNode ( const ArrayRCP< T > & a)
related

Allocate a new ArrayRCP object with a new RCPNode with memory pointing to the initial node.

The purpose of this function is to create a new "handle" to the array of memory with its own seprate reference count. The new ArrayRCP object will have a new RCPNodeTmpl object that has a copy of the input ArrayRCP object embedded in it. This maintains the correct reference counting behaviors but now gives a private count. One would want to use arcpCloneNode(...) whenever it is important to keep a private reference count which is needed for some types of use cases.

◆ arcpClone() [2/2]

ArrayRCP< T > arcpClone ( const ArrayView< const T > & v)
related

Allocate a new array by cloning data from an input array view.

◆ arcpWithEmbeddedObjPreDestroy() [2/2]

ArrayRCP< T > arcpWithEmbeddedObjPreDestroy ( T * p,
typename ArrayRCP< T >::size_type lowerOffset,
typename ArrayRCP< T >::size_type size,
const Embedded & embedded,
bool owns_mem = true )
related

Create an ArrayRCP with and also put in an embedded object.

In this case the embedded object is destroyed (by setting to Embedded()) before the object at *p is destroyed.

The embedded object can be extracted using getEmbeddedObj() and getNonconstEmbeddedObject().

◆ arcpWithEmbeddedObjPostDestroy() [2/2]

ArrayRCP< T > arcpWithEmbeddedObjPostDestroy ( T * p,
typename ArrayRCP< T >::size_type lowerOffset,
typename ArrayRCP< T >::size_type size,
const Embedded & embedded,
bool owns_mem = true )
related

Create an ArrayRCP with and also put in an embedded object.

In this case the embedded object is destroyed (by setting to Embedded()) after the object at *p is destroyed.

The embedded object can be extracted using getEmbeddedObj() and getNonconstEmbeddedObject().

◆ arcpWithEmbeddedObj() [2/2]

ArrayRCP< T > arcpWithEmbeddedObj ( T * p,
typename ArrayRCP< T >::size_type lowerOffset,
typename ArrayRCP< T >::size_type size,
const Embedded & embedded,
bool owns_mem = true )
related

Create an ArrayRCP with and also put in an embedded object.

This function should be called when it is not important when the embedded object is destroyed (by setting to Embedded()) with respect to when *p is destroyed.

The embedded object can be extracted using getEmbeddedObj() and getNonconstEmbeddedObject().

◆ arcpFromArrayView() [2/2]

ArrayRCP< T > arcpFromArrayView ( const ArrayView< T > & av)
related

Get an ArrayRCP object out of an ArrayView object.

This conversion is required and proper in certain types of situations. In a debug build, a dangling reference will be detected with an exception being thrown.

◆ get_std_vector() [3/4]

RCP< std::vector< T > > get_std_vector ( const ArrayRCP< T > & ptr)
related

Get an std::vector<T> object out of an ArrayRCP<T> object that was created using the arcp() function above to wrap the std::vector in the first place..

◆ get_std_vector() [4/4]

RCP< const std::vector< T > > get_std_vector ( const ArrayRCP< const T > & ptr)
related

Get a const std::vector<T> object out of an ArrayRCP<const T> object that was created using the arcp() above to wrap the std::vector in the first place.

◆ nonnull() [2/2]

bool nonnull ( const ArrayRCP< T > & p)
related

Returns true if p.get()!=NULL.

◆ operator==() [3/4]

bool operator== ( const ArrayRCP< T > & p,
ENull  )
related

Returns true if p.get()==NULL.

◆ operator==() [4/4]

bool operator== ( const ArrayRCP< T1 > & p1,
const ArrayRCP< T2 > & p2 )
related

Compare two ArrayRCP objects for equality (by pointers).

◆ operator!=() [3/4]

bool operator!= ( const ArrayRCP< T > & p,
ENull  )
related

Returns true if p.get()!=NULL.

◆ operator!=() [4/4]

bool operator!= ( const ArrayRCP< T1 > & p1,
const ArrayRCP< T2 > & p2 )
related

Compare two ArrayRCP objects for inequality (by pointers).

◆ operator<() [2/2]

bool operator< ( const ArrayRCP< T1 > & p1,
const ArrayRCP< T2 > & p2 )
related

Compare the two ArrayRCP objects' pointers using <.

◆ operator<=() [2/2]

bool operator<= ( const ArrayRCP< T1 > & p1,
const ArrayRCP< T2 > & p2 )
related

Compare the two ArrayRCP objects' pointers using <=.

◆ operator>() [2/2]

bool operator> ( const ArrayRCP< T1 > & p1,
const ArrayRCP< T2 > & p2 )
related

Compare the two ArrayRCP objects' pointers using >.

◆ operator>=() [2/2]

bool operator>= ( const ArrayRCP< T1 > & p1,
const ArrayRCP< T2 > & p2 )
related

Compare the two ArrayRCP objects' pointers using >=.

◆ arcp_const_cast() [2/2]

ArrayRCP< T2 > arcp_const_cast ( const ArrayRCP< T1 > & p1)
related

Const cast of underlying ArrayRCP type from const T* to T*.

The function will compile only if the following code compiles:

T2* p2 = const_cast<T2*> (p1.get ());

◆ arcp_reinterpret_cast() [2/2]

ArrayRCP< T2 > arcp_reinterpret_cast ( const ArrayRCP< T1 > & p1)
related

Reinterpret cast of underlying ArrayRCP type from T1* to T2*.

The function will compile only if the following code compiles:

T2* p2 = reinterpret_cast<T2*> (p1.get ());
Warning
This function is only for advanced users.

◆ arcp_reinterpret_cast_nonpod() [2/2]

ArrayRCP< T2 > arcp_reinterpret_cast_nonpod ( const ArrayRCP< T1 > & p1,
const T2 & val = T2() )
related

Reinterpret cast of underlying ArrayRCP type from T1* to T2* where T2 is a non-POD (non-plain-old-data).

The function will compile only if (reinterpret_cast<T2*>(p1.get());) compiles.

This function is used to reinterpret-cast an array of plain-old-data (POD) (e.g. int or char) into an array of objects of type T2, which is not a plain-old-data type. The constructors will be called on each of the memory locations with placement new and the destructors will get called when the last ArrayRCP goes away.

Warning
This function is only for advanced users.

◆ arcp_implicit_cast() [2/2]

ArrayRCP< T2 > arcp_implicit_cast ( const ArrayRCP< T1 > & p1)
related

Implicit case the underlying ArrayRCP type from T1* to T2*.

The function will compile only if (T2 *p = p1.get();) compiles.

Warning! Do not use this function unless you absolutely know what you are doing. While implicit casting of pointers to single objects is usually 100% safe, implicit casting pointers to arrays of objects can be very dangerous. One std::exception that is always safe is when you are implicit casting an array of pointers to non-const objects to an array of const pointers to const objects. For example, the following implicit conversion from a array pointer objects aptr1 of type ArrayRCP<T*> to

is always legal and safe to do.

◆ set_extra_data() [2/2]

void set_extra_data ( const T1 & extra_data,
const std::string & name,
const Ptr< ArrayRCP< T2 > > & p,
EPrePostDestruction destroy_when = POST_DESTROY,
bool force_unique = true )
related

Set extra data associated with a ArrayRCP object.

Parameters
extra_data[in] Data object that will be set (copied)
name[in] The name given to the extra data. The value of name together with the data type T1 of the extra data must be unique from any other such data or the other data will be overwritten.
p[out] On output, will be updated with the input extra_data
destroy_when[in] Determines when extra_data will be destroyed in relation to the underlying reference-counted object. If destroy_when==PRE_DESTROY then extra_data will be deleted before the underlying reference-counted object. If destroy_when==POST_DESTROY (the default) then extra_data will be deleted after the underlying reference-counted object.
force_unique[in] Determines if this type and name pair must be unique in which case if an object with this same type and name already exists, then an std::exception will be thrown. The default is true for safety.

If there is a call to this function with the same type of extra data T1 and same arguments p and name has already been made, then the current piece of extra data already set will be overwritten with extra_data. However, if the type of the extra data T1 is different, then the extra data can be added and not overwrite existing extra data. This means that extra data is keyed on both the type and name. This helps to minimize the chance that clients will unexpectedly overwrite data by accident.

When the last RefcountPtr object is removed and the reference-count node is deleted, then objects are deleted in the following order: (1) All of the extra data that where added with destroy_when==PRE_DESTROY are first, (2) then the underlying reference-counted object is deleted, and (3) the rest of the extra data that was added with destroy_when==PRE_DESTROY is then deleted. The order in which the objects are destroyed is not guaranteed. Therefore, clients should be careful not to add extra data that has deletion dependencies (instead consider using nested ArrayRCP objects as extra data which will guarantee the order of deletion).

Preconditions:

  • p->get() != NULL (throws NullReferenceError)
  • If this function has already been called with the same template type T1 for extra_data and the same std::string name and force_unique==true, then an std::invalid_argument std::exception will be thrown.

Note, this function is made a non-member function to be consistent with the non-member get_extra_data() functions.

◆ get_extra_data() [3/4]

T1 & get_extra_data ( ArrayRCP< T2 > & p,
const std::string & name )
related

Get a non-const reference to extra data associated with a ArrayRCP object.

Parameters
p[in] Smart pointer object that extra data is being extracted from.
name[in] Name of the extra data.
Returns
Returns a non-const reference to the extra_data object.

Preconditions:

Note, this function must be a non-member function since the client must manually select the first template argument.

◆ get_extra_data() [4/4]

const T1 & get_extra_data ( const ArrayRCP< T2 > & p,
const std::string & name )
related

Get a const reference to extra data associated with a ArrayRCP object.

Parameters
p[in] Smart pointer object that extra data is being extracted from.
name[in] Name of the extra data.
Returns
Returns a const reference to the extra_data object.

Preconditions:

Note, this function must be a non-member function since the client must manually select the first template argument.

Also note that this const version is a false sense of security since a client can always copy a const ArrayRCP object into a non-const object and then use the non-const version to change the data. However, its presence will help to avoid some types of accidental changes to this extra data.

◆ get_optional_extra_data() [3/4]

T1 * get_optional_extra_data ( ArrayRCP< T2 > & p,
const std::string & name )
related

Get a pointer to non-const extra data (if it exists) associated with a ArrayRCP object.

Parameters
p[in] Smart pointer object that extra data is being extracted from.
name[in] Name of the extra data.
Returns
Returns a non-const pointer to the extra_data object.

Preconditions:

Postconditions:

  • If name and T1 have been used in a previous call to set_extra_data() then return !=NULL and otherwise return == NULL.

Note, this function must be a non-member function since the client must manually select the first template argument.

◆ get_optional_extra_data() [4/4]

const T1 * get_optional_extra_data ( const ArrayRCP< T2 > & p,
const std::string & name )
related

Get a pointer to const extra data (if it exists) associated with a ArrayRCP object.

Parameters
p[in] Smart pointer object that extra data is being extracted from.
name[in] Name of the extra data.
Returns
Returns a const pointer to the extra_data object if it exists.

Preconditions:

Postconditions:

  • If name and T1 have been used in a previous call to set_extra_data() then return !=NULL and otherwise return == NULL.

Note, this function must be a non-member function since the client must manually select the first template argument.

Also note that this const version is a false sense of security since a client can always copy a const ArrayRCP object into a non-const object and then use the non-const version to change the data. However, its presence will help to avoid some types of accidental changes to this extra data.

◆ get_nonconst_dealloc() [2/2]

Dealloc_T & get_nonconst_dealloc ( const ArrayRCP< T > & p)
related

Return a non-const reference to the underlying deallocator object.

Preconditions:

◆ get_dealloc() [2/2]

const Dealloc_T & get_dealloc ( const ArrayRCP< T > & p)
related

Return a const reference to the underlying deallocator object.

Preconditions:

Note that the const version of this function provides only a very ineffective attempt to avoid accidental changes to the deallocation object. A client can always just create a new non-const ArrayRCP<T> object from any const ArrayRCP<T> object and then call the non-const version of this function.

◆ get_optional_dealloc() [2/2]

const Dealloc_T * get_optional_dealloc ( const ArrayRCP< T > & p)
related

Return a pointer to the underlying non-const deallocator object if it exists.

Preconditions:

Postconditions:

  • If the deallocator object type used to construct p is same as Dealloc_T then return!=NULL, otherwise return==NULL

◆ get_optional_nonconst_dealloc() [2/2]

Dealloc_T * get_optional_nonconst_dealloc ( const ArrayRCP< T > & p)
related

Return a pointer to the underlying const deallocator object if it exists.

Preconditions:

Postconditions:

  • If the deallocator object type used to construct p is same as Dealloc_T then return!=NULL, otherwise return==NULL

Note that the const version of this function provides only a very ineffective attempt to avoid accidental changes to the deallocation object. A client can always just create a new non-const ArrayRCP<T> object from any const ArrayRCP<T> object and then call the non-const version of this function.

◆ getEmbeddedObj() [2/2]

const Embedded & getEmbeddedObj ( const ArrayRCP< T > & p)
related

Get a const reference to an embedded object that was set by calling arcpWithEmbeddedObjPreDestroy(), arcpWithEmbeddedObjPostDestory(), or arcpWithEmbeddedObj().

◆ getNonconstEmbeddedObj() [2/2]

Embedded & getNonconstEmbeddedObj ( const ArrayRCP< T > & p)
related

Get a const reference to an embedded object that was set by calling arcpWithEmbeddedObjPreDestroy(), arcpWithEmbeddedObjPostDestory(), or arcpWithEmbeddedObj().

◆ operator<<() [2/2]

std::ostream & operator<< ( std::ostream & out,
const ArrayRCP< T > & p )
related

Output stream inserter.

The implementation of this function just print pointer addresses and therefore puts not restrictions on the data types involved.

Member Data Documentation

◆ ptr_ [1/2]

template<class T>
const T* Teuchos::ArrayRCP< const T >::ptr_
private

Definition at line 929 of file Teuchos_ArrayRCPDecl.hpp.

◆ node_ [1/2]

template<class T>
RCPNodeHandle Teuchos::ArrayRCP< const T >::node_
private

Definition at line 930 of file Teuchos_ArrayRCPDecl.hpp.

◆ lowerOffset_ [1/2]

template<class T>
size_type Teuchos::ArrayRCP< const T >::lowerOffset_
private

Definition at line 931 of file Teuchos_ArrayRCPDecl.hpp.

◆ upperOffset_ [1/2]

template<class T>
size_type Teuchos::ArrayRCP< const T >::upperOffset_
private

Definition at line 932 of file Teuchos_ArrayRCPDecl.hpp.

◆ ptr_ [2/2]

T* Teuchos::ArrayRCP< T >::ptr_
private

Raw pointer to the array; NULL if this array is null.

Definition at line 782 of file Teuchos_ArrayRCPDecl.hpp.

◆ node_ [2/2]

RCPNodeHandle Teuchos::ArrayRCP< T >::node_
private

Reference-counting machinery.

Definition at line 784 of file Teuchos_ArrayRCPDecl.hpp.

◆ lowerOffset_ [2/2]

size_type Teuchos::ArrayRCP< T >::lowerOffset_
private

Lower offset to the data; 0 if this array is null.

Definition at line 786 of file Teuchos_ArrayRCPDecl.hpp.

◆ upperOffset_ [2/2]

size_type Teuchos::ArrayRCP< T >::upperOffset_
private

Upper offset to the data; -1 if this array is null.

Definition at line 788 of file Teuchos_ArrayRCPDecl.hpp.


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