10 #ifndef TEUCHOS_RCP_STD_SHAREDPTR_CONVERSIONS_HPP
11 #define TEUCHOS_RCP_STD_SHAREDPTR_CONVERSIONS_HPP
23 const StdSharedPtrRCPDeleter<T>
24 *rcpd = std::get_deleter<StdSharedPtrRCPDeleter<T> >(sptr);
32 RCPNode* existingRCPNode = RCPNodeTracer::getExistingRCPNode(sptr.get());
33 if (existingRCPNode) {
34 return RCP<T>(sptr.get(), RCPNodeHandle(existingRCPNode,
RCP_STRONG,
false));
38 return rcpWithDealloc(sptr.get(), DeallocStdSharedPtr<T>(sptr),
true);
46 Teuchos::get_shared_ptr(
const RCP<T> &
rcp )
49 Ptr<const DeallocStdSharedPtr<T> >
50 dbsp = get_optional_dealloc<DeallocStdSharedPtr<T> >(
rcp);
54 return std::shared_ptr<T>(rcp.get(), StdSharedPtrRCPDeleter<T>(
rcp));
56 return std::shared_ptr<T>();
60 #endif // TEUCHOS_RCP_STD_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.