43 #ifndef TEUCHOS_PTR_HPP
44 #define TEUCHOS_PTR_HPP
54 namespace PtrPrivateUtilityPack {
59 template<
class T>
inline
65 template<
class T>
inline
71 template<
class T>
inline
78 template<
class T2>
inline
84 template<
class T>
inline
92 template<
class T>
inline
95 debug_assert_not_null();
96 debug_assert_valid_ptr();
101 template<
class T>
inline
104 debug_assert_not_null();
105 debug_assert_valid_ptr();
110 template<
class T>
inline
113 debug_assert_valid_ptr();
118 template<
class T>
inline
125 template<
class T>
inline
134 template<
class T>
inline
141 template<
class T>
inline
144 return ptr_implicit_cast<
const T>(*this);
148 template<
class T>
inline
152 rcp_.access_private_node().assert_valid_ptr(*
this);
160 template<
class T>
inline
166 #endif // TEUCHOS_DEBUG
173 std::ostream& Teuchos::operator<<( std::ostream& out, const Ptr<T>& p )
176 << TypeNameTraits<RCP<T> >::name() <<
"{"
177 <<
"ptr="<<(
const void*)(p.get())
183 #endif // TEUCHOS_PTR_HPP
void debug_assert_valid_ptr() const
RawPointerConversionTraits< Container >::Ptr_t getRawPtr(const Container &c)
ENull
Used to initialize a RCP object to NULL using an implicit conversion!
T * getRawPtr() const
Get the raw C++ pointer to the underlying object.
#define TEUCHOSCORE_LIB_DLL_EXPORT
Ptr(ENull null_in=null)
Default construct to NULL.
TEUCHOSCORE_LIB_DLL_EXPORT void throw_null(const std::string &type_name)
T & operator*() const
Dereference the underlying object.
const Ptr< T > & assert_not_null() const
Throws std::logic_error if this->get()==NULL, otherwise returns reference to *this.
Default traits class that just returns typeid(T).name().
Smart reference counting pointer class for automatic garbage collection.
Ptr< const T > getConst() const
Return a Ptr<const T> version of *this.
Reference-counted pointer class and non-member templated function implementations.
const Ptr< T > ptr() const
Return a copy of *this.
Simple wrapper class for raw pointers to single objects where no persisting relationship exists...
T * get() const
Get the raw C++ pointer to the underlying object.
T * operator->() const
Pointer (->) access to members of underlying object.
Ptr< T > & operator=(const Ptr< T > &ptr)
Shallow copy of the underlying pointer.