42 #ifndef TEUCHOS_RCP_BOOST_SHAREDPTR_CONVERSIONS_HPP
43 #define TEUCHOS_RCP_BOOST_SHAREDPTR_CONVERSIONS_HPP
45 #include "Teuchos_RCPBoostSharedPtrConversionsDecl.hpp"
56 *rcpd = boost::get_deleter<RCPDeleter<T> >(sptr);
64 RCPNode* existingRCPNode = RCPNodeTracer::getExistingRCPNode(sptr.get());
65 if (existingRCPNode) {
66 return RCP<T>(sptr.get(), RCPNodeHandle(existingRCPNode, RCP_STRONG,
false));
70 return rcpWithDealloc(sptr.get(), DeallocBoostSharedPtr<T>(sptr),
true);
78 Teuchos::shared_pointer(
const RCP<T> &
rcp )
81 Ptr<const DeallocBoostSharedPtr<T> >
82 dbsp = get_optional_dealloc<DeallocBoostSharedPtr<T> >(
rcp);
85 return boost::shared_ptr<T>(rcp.get(), RCPDeleter<T>(
rcp));
87 return boost::shared_ptr<T>();
91 #endif // TEUCHOS_RCP_BOOST_SHAREDPTR_CONVERSIONS_HPP
RCP< T > rcp(const boost::shared_ptr< T > &sptr)
Conversion function that takes in a boost::shared_ptr object and spits out a Teuchos::RCP object...
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
Deprecated.
Smart reference counting pointer class for automatic garbage collection.
RCP< T > rcpWithDealloc(T *p, Dealloc_T dealloc, bool owns_mem=true)
Initialize from a raw pointer with a deallocation policy.
Reference-counted pointer class and non-member templated function implementations.
bool nonnull(const ArrayRCP< T > &p)
Returns true if p.get()!=NULL.