Teuchos - Trilinos Tools Package Version of the Day
Loading...
Searching...
No Matches
Teuchos_ArrayRCPDecl.hpp
1// @HEADER
2// *****************************************************************************
3// Teuchos: Common Tools Package
4//
5// Copyright 2004 NTESS and the Teuchos contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef TEUCHOS_ARRAY_RCP_DECL_HPP
11#define TEUCHOS_ARRAY_RCP_DECL_HPP
12
13
14#include "Teuchos_RCP.hpp"
15#include "Teuchos_Exceptions.hpp"
16#include "Teuchos_ArrayViewDecl.hpp"
17
18
19namespace Teuchos {
20
93template<class T>
94class ArrayRCP {
95public:
97
98
100 typedef Teuchos_Ordinal Ordinal;
101
104
107
109 typedef std::random_access_iterator_tag iterator_category;
110
112 typedef T* iterator_type;
113
115 typedef T value_type;
116
118 typedef T& reference;
119
121 typedef const T& const_reference;
122
124 typedef T* pointer;
125
127 typedef T* const_pointer;
128
131
132#ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
134 typedef ArrayRCP<T> iterator;
137#else
139 typedef T* iterator;
141 typedef const T* const_iterator;
142#endif
143
145
147
160 inline ArrayRCP( ENull null_arg = null );
161
184 bool has_ownership, const ERCPNodeLookup rcpNodeLookup = RCP_ENABLE_NODE_LOOKUP );
185
208 template<class Dealloc_T>
210 bool has_ownership );
211
227 inline explicit ArrayRCP( size_type size, const T& val = T() );
228
247 inline ArrayRCP(const ArrayRCP<T>& r_ptr);
248
259 inline ~ArrayRCP();
260
288 inline ArrayRCP<T>& operator=(const ArrayRCP<T>& r_ptr);
289
291
293
295 inline bool is_null() const;
296
304 inline T* operator->() const;
305
313 inline T& operator*() const;
314
320 inline T* get() const;
321
327 inline T* getRawPtr() const;
328
334 inline T& operator[](size_type offset) const;
335
337
339
348 inline ArrayRCP<T>& operator++();
349
358 inline ArrayRCP<T> operator++(int);
359
368 inline ArrayRCP<T>& operator--();
369
378 inline ArrayRCP<T> operator--(int);
379
389
399
413
427
429
431
442 inline iterator begin() const;
443
454 inline iterator end() const;
455
457
459
465 inline ArrayRCP<const T> getConst() const;
466
481
483
485
487 inline size_type lowerOffset() const;
488
490 inline size_type upperOffset() const;
491
496 inline size_type size() const;
497
499
501
516
522
527 inline ArrayView<T> operator()() const;
528
530
532
539 inline operator ArrayRCP<const T>() const;
540
542
544
549 inline void assign(size_type n, const T &val);
550
558 template<class Iter>
559 inline void assign(Iter first, Iter last);
560
566 inline void deepCopy(const ArrayView<const T>& av);
567
569 inline void resize(const size_type n, const T &val = T());
570
575 inline void clear();
576
578
580
592 inline ERCPStrength strength() const;
593
603 inline bool is_valid_ptr() const;
604
610 inline int strong_count() const;
611
617 inline int weak_count() const;
618
620 inline int total_count() const;
621
639 inline void set_has_ownership();
640
652 inline bool has_ownership() const;
653
674 inline T* release();
675
690 inline ArrayRCP<T> create_weak() const;
691
707 inline ArrayRCP<T> create_strong() const;
708
715 template<class T2>
716 inline bool shares_resource(const ArrayRCP<T2>& r_ptr) const;
717
719
721
725 inline const ArrayRCP<T>& assert_not_null() const;
726
733
743 inline const ArrayRCP<T>& assert_valid_ptr() const;
744
746
747private:
749 T *ptr_;
751 RCPNodeHandle node_;
753 size_type lowerOffset_;
755 size_type upperOffset_;
756
757 inline void debug_assert_not_null () const {
758#ifdef TEUCHOS_REFCOUNTPTR_ASSERT_NONNULL
760#endif
761 }
762
763 inline void
764 debug_assert_in_range (size_type lowerOffset_in,
765 size_type size_in) const
766 {
768 (void) size_in;
769#ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
771#endif
772 }
773
774 inline void debug_assert_valid_ptr() const {
775#ifdef TEUCHOS_DEBUG
777#endif
778 }
779
780public:
781
782#ifndef DOXYGEN_COMPILE
783 // These constructors should be private but I have not had good luck making
784 // this portable (i.e. using friendship etc.) in the past
785 // This is a very bad breach of encapsulation that is needed since MS VC++
786 // 5.0 will not allow me to declare template functions as friends.
788 const RCPNodeHandle& node );
789 T* access_private_ptr() const;
790 RCPNodeHandle& nonconst_access_private_node();
791 const RCPNodeHandle& access_private_node() const;
792#endif
793
794};
795
796
804template<class T>
806public:
807 typedef Teuchos_Ordinal Ordinal;
808 typedef Ordinal size_type;
809 typedef Ordinal difference_type;
810 typedef std::random_access_iterator_tag iterator_category;
811 typedef const T* iterator_type;
812 typedef const T value_type;
813 typedef const T& reference;
814 typedef const T& const_reference;
815 typedef const T* pointer;
816 typedef const T* const_pointer;
817 typedef const T element_type;
818
819#ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
822#else
823 typedef const T* iterator;
824 typedef const T* const_iterator;
825#endif
826
827 inline ArrayRCP (ENull null_arg = null);
828 inline ArrayRCP (const T* p, size_type lowerOffset,
830 const ERCPNodeLookup rcpNodeLookup = RCP_ENABLE_NODE_LOOKUP);
831 template<class Dealloc_T>
832 inline ArrayRCP (const T* p, size_type lowerOffset, size_type size,
834 inline explicit ArrayRCP (size_type size, const T& val = T ());
835 inline ArrayRCP (const ArrayRCP<const T>& r_ptr);
836 inline ~ArrayRCP();
837
839 inline bool is_null() const;
840 inline const T* operator->() const;
841 inline const T& operator*() const;
842 inline const T* get() const;
843 inline const T* getRawPtr() const;
844 inline const T& operator[] (size_type offset) const;
845
847 inline ArrayRCP<const T> operator++ (int);
849 inline ArrayRCP<const T> operator-- (int);
854
855 inline iterator begin() const;
856 inline iterator end() const;
857
865
866 inline size_type lowerOffset() const;
867 inline size_type upperOffset() const;
868 inline size_type size() const;
869
872 inline ArrayView<const T> operator() () const;
873
874 inline void resize (const size_type n, const T& val = T ());
875 inline void clear ();
876
877 inline ERCPStrength strength() const;
878 inline bool is_valid_ptr() const;
879 inline int strong_count() const;
880 inline int weak_count() const;
881 inline int total_count() const;
882 inline void set_has_ownership();
883 inline bool has_ownership() const;
884 inline const T* release();
885 inline ArrayRCP<const T> create_weak() const;
886 inline ArrayRCP<const T> create_strong() const;
887
888 template<class T2>
889 inline bool shares_resource (const ArrayRCP<T2>& r_ptr) const;
890
891 inline const ArrayRCP<const T>& assert_not_null () const;
893 inline const ArrayRCP<const T>& assert_valid_ptr() const;
894
895private:
896 const T* ptr_; // NULL if this pointer is null
897 RCPNodeHandle node_; // NULL if this pointer is null
898 size_type lowerOffset_; // 0 if this pointer is null
899 size_type upperOffset_; // -1 if this pointer is null
900
901 inline void debug_assert_not_null() const {
902#ifdef TEUCHOS_REFCOUNTPTR_ASSERT_NONNULL
904#endif
905 }
906
907 inline void
908 debug_assert_in_range (size_type lowerOffset_in,
909 size_type size_in) const
910 {
912#ifdef HAVE_TEUCHOS_ARRAY_BOUNDSCHECK
914#endif
915 }
916
917 inline void debug_assert_valid_ptr() const {
918#ifdef TEUCHOS_DEBUG
920#endif
921 }
922
923public:
924
925#ifndef DOXYGEN_COMPILE
926 // These constructors should be private but I have not had good luck making
927 // this portable (i.e. using friendship etc.) in the past
928 // This is a very bad breach of encapsulation that is needed since MS VC++
929 // 5.0 will not allow me to declare template functions as friends.
930 ArrayRCP (const T* p, size_type lowerOffset,
931 size_type size, const RCPNodeHandle& node);
932 const T* access_private_ptr() const;
933 RCPNodeHandle& nonconst_access_private_node();
934 const RCPNodeHandle& access_private_node() const;
935#endif
936};
937
938
947template<>
949public:
950 typedef Teuchos_Ordinal Ordinal;
951 typedef Ordinal size_type;
952 typedef Ordinal difference_type;
953 typedef std::random_access_iterator_tag iterator_category;
954 typedef void* iterator_type;
955 typedef void value_type;
957 // typedef T& reference; // these are not valid
959 // typedef const T& const_reference; // these are not valid
960 typedef void* pointer;
961 typedef void* const_pointer;
962 typedef void element_type;
963
965 inline ArrayRCP ();
966};
967
972template<>
974public:
975 typedef Teuchos_Ordinal Ordinal;
976 typedef Ordinal size_type;
977 typedef Ordinal difference_type;
978 typedef std::random_access_iterator_tag iterator_category;
979 typedef const void* iterator_type;
980 typedef const void value_type;
982 // typedef T& reference; // these are not valid
984 // typedef const T& const_reference; // these are not valid
985 typedef const void* pointer;
986 typedef const void* const_pointer;
987 typedef const void element_type;
988
990 inline ArrayRCP ();
991};
992
993// 2008/09/22: rabartl: NOTE: I removed the TypeNameTraits<ArrayRCP<T> >
994// specialization since I want to be able to print the type name of an
995// ArrayRCP that does not have the type T fully defined!
996
997
1002template<typename T>
1004public:
1005 static ArrayRCP<T> getNull() { return null; }
1006};
1007
1008
1014template<class T>
1016 T* p,
1017 typename ArrayRCP<T>::size_type lowerOffset,
1018 typename ArrayRCP<T>::size_type size,
1019 bool owns_mem = true
1020 );
1021
1022
1028template<class T, class Dealloc_T>
1030 T* p,
1031 typename ArrayRCP<T>::size_type lowerOffset,
1032 typename ArrayRCP<T>::size_type size,
1034 );
1035
1036
1047template<class T>
1049
1050
1064template<class T>
1066
1067
1072template<class T>
1074
1075
1086template<class T, class Embedded>
1089 T* p,
1090 typename ArrayRCP<T>::size_type lowerOffset,
1091 typename ArrayRCP<T>::size_type size,
1092 const Embedded &embedded,
1093 bool owns_mem = true
1094 );
1095
1096
1107template<class T, class Embedded>
1110 T* p,
1111 typename ArrayRCP<T>::size_type lowerOffset,
1112 typename ArrayRCP<T>::size_type size,
1113 const Embedded &embedded,
1114 bool owns_mem = true
1115 );
1116
1117
1129template<class T, class Embedded>
1132 T* p,
1133 typename ArrayRCP<T>::size_type lowerOffset,
1134 typename ArrayRCP<T>::size_type size,
1135 const Embedded &embedded,
1136 bool owns_mem = true
1137 );
1138
1139
1145template<class T>
1146ArrayRCP<T> arcp( const RCP<std::vector<T> > &v );
1147
1148
1154template<class T>
1155ArrayRCP<const T> arcp( const RCP<const std::vector<T> > &v );
1156
1157
1166template<class T>
1168
1169
1177template<class T>
1179
1180
1187template<class T>
1189
1190
1195template<class T>
1196bool is_null( const ArrayRCP<T> &p );
1197
1198
1203template<class T>
1204bool nonnull( const ArrayRCP<T> &p );
1205
1206
1211template<class T>
1212bool operator==( const ArrayRCP<T> &p, ENull );
1213
1214
1219template<class T>
1220bool operator!=( const ArrayRCP<T> &p, ENull );
1221
1222
1227template<class T1, class T2>
1229
1230
1235template<class T1, class T2>
1237
1238
1243template<class T1, class T2>
1244bool operator<( const ArrayRCP<T1> &p1, const ArrayRCP<T2> &p2 );
1245
1246
1251template<class T1, class T2>
1253
1254
1259template<class T1, class T2>
1260bool operator>( const ArrayRCP<T1> &p1, const ArrayRCP<T2> &p2 );
1261
1262
1267template<class T1, class T2>
1269
1270
1278template<class T>
1281
1282
1293template<class T2, class T1>
1294inline
1296
1297
1309template<class T2, class T1>
1311
1312
1329template<class T2, class T1>
1331
1332
1358template<class T2, class T1>
1359inline
1361
1362
1421template<class T1, class T2>
1423 const T1 &extra_data, const std::string& name,
1424 const Ptr<ArrayRCP<T2> > &p, EPrePostDestruction destroy_when = POST_DESTROY,
1425 bool force_unique = true );
1426
1427
1447template<class T1, class T2>
1448T1& get_extra_data( ArrayRCP<T2>& p, const std::string& name );
1449
1450
1476template<class T1, class T2>
1477const T1& get_extra_data( const ArrayRCP<T2>& p, const std::string& name );
1478
1479
1504template<class T1, class T2>
1505T1* get_optional_extra_data( ArrayRCP<T2>& p, const std::string& name );
1506
1507
1537template<class T1, class T2>
1538const T1* get_optional_extra_data( const ArrayRCP<T2>& p, const std::string& name );
1539
1540
1551template<class Dealloc_T, class T>
1553
1554
1572template<class Dealloc_T, class T>
1574
1575
1590template<class Dealloc_T, class T>
1592
1593
1615template<class Dealloc_T, class T>
1617
1618
1625template<class TOrig, class Embedded, class T>
1627
1628
1635template<class TOrig, class Embedded, class T>
1637
1638
1646template<class T>
1647std::ostream& operator<<( std::ostream& out, const ArrayRCP<T>& p );
1648
1649
1650} // end namespace Teuchos
1651
1652
1653#endif // TEUCHOS_ARRAY_RCP_DECL_HPP
Reference-counted pointer class and non-member templated function implementations.
ArrayRCP< const T > getConst() const
Return const reference to the array.
ArrayRCP()
Default constructor; thows an exception.
Reference-counted smart pointer for managing arrays.
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.
ArrayRCP< T > create_weak() const
Create a new weak reference from another (strong) reference.
T & reference
Type of a (nonconstant) reference to an array element.
Embedded & getNonconstEmbeddedObj(const ArrayRCP< T > &p)
Get a const reference to an embedded object that was set by calling arcpWithEmbeddedObjPreDestroy(),...
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.
void set_has_ownership()
Give this and other ArrayRCP<> objects ownership of the underlying referenced array to delete it.
T1 & get_extra_data(ArrayRCP< T2 > &p, const std::string &name)
Get a non-const reference to extra data associated with a ArrayRCP object.
size_type upperOffset() const
Return the upper offset to valid data.
ArrayRCP< T > & operator++()
Prefix increment of pointer (i.e. ++ptr).
const T & const_reference
Type of a (constant) reference to an array element.
Ordinal size_type
Type representing the number of elements in an ArrayRCP or view thereof.
Ordinal difference_type
Type representing the difference between two size_type values.
ArrayRCP< T > arcp(typename ArrayRCP< T >::size_type size)
Allocate a new array just given a dimension.
std::random_access_iterator_tag iterator_category
Category of ArrayRCP's iterator type.
bool has_ownership() const
Returns true if this has ownership of object pointed to by this->get() in order to deallocate it.
bool operator!=(const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
Compare two ArrayRCP objects for inequality (by pointers).
Teuchos_Ordinal Ordinal
Integer index type used throughout ArrayRCP.
T * iterator
Nonconstant iterator type used if bounds checking is disabled.
ArrayRCP< T > arcpFromArrayView(const ArrayView< T > &av)
Get an ArrayRCP object out of an ArrayView object.
ArrayRCP< T > & operator+=(size_type offset)
Pointer integer increment (i.e. ptr+=offset).
ArrayRCP(ENull null_arg=null)
Default constructor; initialize to an empty array.
bool is_null() const
True if the underlying pointer is null, else false.
ArrayRCP< T2 > arcp_reinterpret_cast(const ArrayRCP< T1 > &p1)
Reinterpret cast of underlying ArrayRCP type from T1* to T2*.
ArrayRCP< const T > getConst() const
Return object for only const access to data.
const Dealloc_T * get_optional_dealloc(const ArrayRCP< T > &p)
Return a pointer to the underlying non-const deallocator object if it exists.
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.
const Dealloc_T & get_dealloc(const ArrayRCP< T > &p)
Return a const reference to the underlying deallocator object.
T & operator*() const
Dereference the underlying object for the current pointer position.
const ArrayRCP< T > & assert_not_null() const
Throws NullReferenceError if this->get()==NULL, otherwise returns reference to *this.
bool operator==(const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
Compare two ArrayRCP objects for equality (by pointers).
T * release()
Release the ownership of the underlying array.
bool is_null(const ArrayRCP< T > &p)
Returns true if p.get()==NULL.
bool operator>=(const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
Compare the two ArrayRCP objects' pointers using >=.
void clear()
Resize to zero.
T value_type
Type of each array element.
T * get() const
Get the raw C++ pointer to the underlying object.
ArrayRCP< T2 > arcp_const_cast(const ArrayRCP< T1 > &p1)
Const cast of underlying ArrayRCP type from const T* to T*.
size_type size() const
The total number of entries in the array.
Dealloc_T * get_optional_nonconst_dealloc(const ArrayRCP< T > &p)
Return a pointer to the underlying const deallocator object if it exists.
T & operator[](size_type offset) const
Random object access.
ArrayRCP< T > create_strong() const
Create a new strong RCP object from another (weak) RCP object.
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 deleti...
void deepCopy(const ArrayView< const T > &av)
Deep copy the elements from one ArrayView object into this 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.
bool shares_resource(const ArrayRCP< T2 > &r_ptr) const
Returns true if the smart pointers share the same underlying reference-counted object.
size_type lowerOffset() const
Return the lower offset to valid data.
ArrayRCP< T > operator-(size_type offset) const
Pointer integer decrement (i.e. ptr-offset).
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.
const T * const_iterator
Constant iterator type used if bounds checking is disabled.
T * getRawPtr() const
Get the raw C++ pointer to the underlying object.
T element_type
Type of each array element.
bool operator<(const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
Compare the two ArrayRCP objects' pointers using <.
ArrayRCP< T > & operator--()
Prefix decrement of pointer (i.e. –ptr).
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.
ArrayView< T > operator()() const
Return a nonpersisting view of *this.
ArrayView< T > view(size_type lowerOffset, size_type size) const
Return a nonpersisting view of a contiguous range of elements.
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...
std::ostream & operator<<(std::ostream &out, const ArrayRCP< T > &p)
Output stream inserter.
bool operator==(const ArrayRCP< T > &p, ENull)
Returns true if p.get()==NULL.
int strong_count() const
Return the number of active RCP<> objects that have a "strong" reference to the underlying reference-...
ArrayRCP< T > persistingView(size_type lowerOffset, size_type size) const
Return a persisting view of a contiguous range of elements.
bool is_valid_ptr() const
Return whether the underlying object pointer is still valid.
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(...
void resize(const size_type n, const T &val=T())
Resize and append new elements if necessary.
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 > & operator=(const ArrayRCP< T > &r_ptr)
Assignment operator: Makes *this reference the input array.
ArrayRCP< T > operator+(size_type offset) const
Pointer integer increment (i.e. ptr+offset).
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-dat...
T * iterator_type
Type of an ArrayRCP's iterator.
void assign(size_type n, const T &val)
Resize and assign n elements of val.
iterator begin() const
Return an iterator to beginning of the array of data.
T * operator->() const
Pointer (->) access to members of underlying object for current position.
~ArrayRCP()
Destructor, that decrements the reference count.
ERCPStrength strength() const
Strength of the pointer.
ArrayRCP< T > arcpClone(const ArrayView< const T > &v)
Allocate a new array by cloning data from an input array view.
Dealloc_T & get_nonconst_dealloc(const ArrayRCP< T > &p)
Return a non-const reference to the underlying deallocator object.
ArrayRCP< T >::difference_type operator-(const ArrayRCP< T > &p1, const ArrayRCP< T > &p2)
Return the difference of two ArrayRCP objects.
bool nonnull(const ArrayRCP< T > &p)
Returns true if p.get()!=NULL.
T * pointer
Type of a (raw) (nonconstant) pointer to an array element.
iterator end() const
Return an iterator to past the end of the array of data.
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 ...
bool operator>(const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
Compare the two ArrayRCP objects' pointers using >.
ArrayRCP< T2 > arcp_implicit_cast(const ArrayRCP< T1 > &p1)
Implicit case the underlying ArrayRCP type from T1* to T2*.
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.
T * const_pointer
Type of a (raw) (constant) pointer to an array element.
const ArrayRCP< T > & assert_valid_ptr() const
If the object pointer is non-null, assert that it is still valid.
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.
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 > arcp(const RCP< std::vector< T > > &v)
Wrap an std::vector<T> object as an ArrayRCP<T> object.
ArrayRCP< T > & operator-=(size_type offset)
Pointer integer increment (i.e. ptr-=offset).
bool operator<=(const ArrayRCP< T1 > &p1, const ArrayRCP< T2 > &p2)
Compare the two ArrayRCP objects' pointers using <=.
bool operator!=(const ArrayRCP< T > &p, ENull)
Returns true if p.get()!=NULL.
int weak_count() const
Return the number of active RCP<> objects that have a "weak" reference to the underlying reference-co...
const Embedded & getEmbeddedObj(const ArrayRCP< T > &p)
Get a const reference to an embedded object that was set by calling arcpWithEmbeddedObjPreDestroy(),...
int total_count() const
Total count (strong_count() + weak_count()).
Base traits class for getting a properly initialized null pointer.
Simple wrapper class for raw pointers to single objects where no persisting relationship exists.
Handle class that manages the RCPNode's reference counting.
Smart reference counting pointer class for automatic garbage collection.
ERCPStrength
Used to specify if the pointer is weak or strong.
ERCPNodeLookup
Used to determine if RCPNode lookup is performed or not.
EPrePostDestruction
Used to specify a pre or post destruction of extra data.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...