Conversion utilities for going between Teuchos::RCP and boost::shared_ptr.
[Teuchos Memory Management Utilities]


Classes

class  Teuchos::DeallocBoostSharedPtr< T >
 Teuchos::RCP Deallocator class that wraps a boost::shared_ptr More...
class  Teuchos::RCPDeleter< T >
 boost::shared_ptr deleter class that wraps a Teuchos::RCP. More...

Functions

template<class T>
Teuchos::RCP< T > Teuchos::rcp (const boost::shared_ptr< T > &sptr)
 Conversion function that takes in a boost::shared_ptr object and spits out a Teuchos::RCP object.
template<class T>
boost::shared_ptr< T > Teuchos::shared_pointer (const RCP< T > &rcp)
 Conversion function that takes in a Teuchos::RCP object and spits out a boost::shared_ptr object.
template<class T>
bool boost::is_null (const boost::shared_ptr< T > &p)
 Returns true if p.get()==NULL.
template<class T>
bool boost::nonnull (const boost::shared_ptr< T > &p)
 Returns true if p.get()!=NULL.

Detailed Description

The smart pointer classes Teuchos::RCP and boost::shared_ptr are easily compatible. The two templated conversion functions Teuchos::rcp( const boost::shared_ptr<T> & ) and Teuchos::shared_pointer( const RCP<T> & ) have been created for converting back and forth.

The following code shows how to convert back and forth between these two smart pointer types:


Function Documentation

template<class T>
RCP< T > Teuchos::rcp ( const boost::shared_ptr< T > &  sptr  ) 

Conversion function that takes in a boost::shared_ptr object and spits out a Teuchos::RCP object.

If the input boost::shared_ptr already wraps a Teuchos::RCP object, then that Teuchos::RCP object will be copied and returned.

This function is not complicated, just look at its defintion below.

Definition at line 38 of file Teuchos_RCPBoostSharedPtrConversions.hpp.

template<class T>
boost::shared_ptr< T > Teuchos::shared_pointer ( const RCP< T > &  rcp  ) 

Conversion function that takes in a Teuchos::RCP object and spits out a boost::shared_ptr object.

If the input Teuchos::RCP already wraps a boost::shared_ptr object, then that boost::shared_ptr object will be copied and returned.

This function is not complicated, just look at its defintion below.

Definition at line 65 of file Teuchos_RCPBoostSharedPtrConversions.hpp.

template<class T>
bool boost::is_null ( const boost::shared_ptr< T > &  p  )  [inline]

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

Definition at line 138 of file Teuchos_RCPBoostSharedPtrConversionsDecl.hpp.

template<class T>
bool boost::nonnull ( const boost::shared_ptr< T > &  p  )  [inline]

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

Definition at line 149 of file Teuchos_RCPBoostSharedPtrConversionsDecl.hpp.


Generated on Tue Jul 13 09:23:01 2010 for Teuchos - Trilinos Tools Package by  doxygen 1.4.7