Teuchos - Trilinos Tools Package 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>

Public Member Functions

ArrayRCP< const T > getConst () const
 Return const reference to the array.
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 deepCopy (const ArrayView< const T > &av)
 Deep copy the elements from one ArrayView object into this object.

(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.

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 805 of file Teuchos_ArrayRCPDecl.hpp.

Member Function Documentation

◆ getConst()

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.

◆ 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 539 of file Teuchos_ArrayRCP.hpp.

◆ assign()

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 549 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 566 of file Teuchos_ArrayRCP.hpp.

◆ arcp() [1/7]

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

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

Definition at line 512 of file Teuchos_Array.hpp.

◆ arcp() [2/7]

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 529 of file Teuchos_Array.hpp.

◆ arcpFromArray() [1/2]

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

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

Definition at line 546 of file Teuchos_Array.hpp.

◆ arcpFromArray() [2/2]

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 564 of file Teuchos_Array.hpp.

◆ arcp() [3/7]

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/7]

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/7]

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()

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()

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

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

◆ arcpWithEmbeddedObjPreDestroy()

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()

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()

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/7]

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

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

◆ arcp() [7/7]

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()

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/2]

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/2]

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()

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

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

◆ nonnull()

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

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

◆ operator==() [1/2]

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

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

◆ operator!=() [1/2]

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

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

◆ operator==() [2/2]

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

Compare two ArrayRCP objects for equality (by pointers).

◆ operator!=() [2/2]

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

Compare two ArrayRCP objects for inequality (by pointers).

◆ operator<()

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

Compare the two ArrayRCP objects' pointers using <.

◆ operator<=()

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

Compare the two ArrayRCP objects' pointers using <=.

◆ operator>()

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

Compare the two ArrayRCP objects' pointers using >.

◆ operator>=()

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

Compare the two ArrayRCP objects' pointers using >=.

◆ operator-()

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()

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()

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()

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()

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<const T * const>
ArrayRCP< T2 > arcp_implicit_cast(const ArrayRCP< T1 > &p1)

is always legal and safe to do.

◆ set_extra_data()

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/2]

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/2]

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/2]

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/2]

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()

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

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

Preconditions:

◆ get_dealloc()

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()

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()

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()

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()

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<<()

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.


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