10#ifndef TEUCHOS_PTR_DECL_HPP 
   11#define TEUCHOS_PTR_DECL_HPP 
   15#include "Teuchos_dyn_cast.hpp" 
  138  inline T* 
get() 
const;
 
  165  void debug_assert_not_null()
 const 
  172  inline void debug_assert_valid_ptr() 
const;
 
  178  T* access_private_ptr()
 const 
 
  193template<
typename T> 
inline 
  205template<
typename T> 
inline 
  217template<
typename T> 
inline 
  229template<
typename T> 
inline 
  241template<
typename T> 
inline 
  253template<
typename T> 
inline 
  264template<
typename T> 
inline 
  275template<
typename T> 
inline 
  284  if (!
is_null(ptr.access_rcp()))
 
  285    return ptr.access_rcp();
 
  287  return rcpFromRef(*ptr);
 
 
  295template<
typename T> 
inline 
  310template<
typename T> 
inline 
  321template<
class T> 
inline 
  332template<
class T> 
inline 
  343template<
class T> 
inline 
  365template<
class T1, 
class T2>
 
  377template<
class T1, 
class T2>
 
  395template<
class T2, 
class T1>
 
  415template<
class T2, 
class T1>
 
  430template<
class T2, 
class T1>
 
  462template<
class T2, 
class T1>
 
Reference-counted pointer class and non-member templated function implementations.
 
Simple wrapper class for raw pointers to single objects where no persisting relationship exists.
 
Ptr< T2 > ptr_const_cast(const Ptr< T1 > &p1)
Constant cast of underlying Ptr type from T1* to T2*.
 
Ptr< T2 > ptr_implicit_cast(const Ptr< T1 > &p1)
Implicit cast of underlying Ptr type from T1* to T2*.
 
Ptr< const T > ptrInArg(T &arg)
create a general Ptr input argument for a function call from a reference.
 
Ptr< T2 > ptr_dynamic_cast(const Ptr< T1 > &p1, bool throw_on_fail=false)
Dynamic cast of underlying Ptr type from T1* to T2*.
 
const Ptr< T > & assert_not_null() const
Throws std::logic_error if this->get()==NULL, otherwise returns reference to *this.
 
bool operator==(const Ptr< T > &p, ENull)
Returns true if p.get()==NULL.
 
bool nonnull(const Ptr< T > &p)
Returns true if p.get()!=NULL
 
Ptr< const T > getConst() const
Return a Ptr<const T> version of *this.
 
T * getRawPtr() const
Get the raw C++ pointer to the underlying object.
 
Ptr< T > & operator=(const Ptr< T > &ptr)
Shallow copy of the underlying pointer.
 
Ptr< T > optInArg(T &arg)
create a non-persisting non-const optional input argument for a function call.
 
Ptr< const T > constPtr(T &arg)
Create a pointer from a const object given a non-const object reference.
 
bool is_null(const Ptr< T > &p)
Returns true if p.get()==NULL.
 
bool is_null() const
Return true if the wrapped raw pointer is NULL, else return false.
 
Ptr< T > ptrFromRef(T &arg)
Create a pointer to a object from an object reference.
 
Ptr< T > outArg(T &arg)
create a non-persisting (required or optional) output argument for a function call.
 
Ptr< T > inOutArg(T &arg)
create a non-persisting (required or optional) input/output argument for a function call.
 
T * operator->() const
Pointer (->) access to members of underlying object.
 
bool operator!=(const Ptr< T > &p, ENull)
Returns true if p.get()!=NULL.
 
Ptr< T > inoutArg(T &arg)
create a non-persisting (required or optional) input/output argument for a function call.
 
T & operator*() const
Dereference the underlying object.
 
bool operator==(const Ptr< T1 > &p1, const Ptr< T2 > &p2)
Return true if two Ptr objects point to the same object.
 
T * get() const
Get the raw C++ pointer to the underlying object.
 
Ptr< const T > constOptInArg(T &arg)
create a non-persisting const optional input argument for a function call.
 
bool operator!=(const Ptr< T1 > &p1, const Ptr< T2 > &p2)
Return true if two Ptr objects do not point to the same object.
 
Ptr< T2 > ptr_static_cast(const Ptr< T1 > &p1)
Static cast of underlying Ptr type from T1* to T2*.
 
const Ptr< T > ptr() const
Return a copy of *this.
 
Ptr< T > ptr(T *p)
Create a pointer to an object from a raw pointer.
 
std::ostream & operator<<(std::ostream &out, const Ptr< T > &p)
Output stream inserter.
 
Smart reference counting pointer class for automatic garbage collection.
 
RCP< T > rcpFromPtr(const Ptr< T > &ptr)
Create an RCP<T> from a Ptr<T> object.
 
T * get() const
Get the raw C++ pointer to the underlying object.
 
bool is_null(const std::shared_ptr< T > &p)
Returns true if p.get()==NULL.
 
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...