42 #ifndef TEUCHOS_RCP_STD_SHAREDPTR_CONVERSIONS_HPP
43 #define TEUCHOS_RCP_STD_SHAREDPTR_CONVERSIONS_HPP
45 #include "Teuchos_RCPStdSharedPtrConversionsDecl.hpp"
55 const StdSharedPtrRCPDeleter<T>
56 *rcpd = std::get_deleter<StdSharedPtrRCPDeleter<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(), DeallocStdSharedPtr<T>(sptr),
true);
78 Teuchos::get_shared_ptr(
const RCP<T> &
rcp )
81 Ptr<const DeallocStdSharedPtr<T> >
82 dbsp = get_optional_dealloc<DeallocStdSharedPtr<T> >(
rcp);
86 return std::shared_ptr<T>(rcp.get(), StdSharedPtrRCPDeleter<T>(
rcp));
88 return std::shared_ptr<T>();
92 #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.