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.

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.

Examples:
FancyOutputting_test.cpp, and ParameterList/cxx_main.cpp.

Definition at line 37 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 51 of file Teuchos_RCPBoostSharedPtrConversions.hpp.


Generated on Tue Oct 20 12:45:26 2009 for Teuchos - Trilinos Tools Package by doxygen 1.4.7