42 #ifndef TEUCHOS_HANDLE_HPP
43 #define TEUCHOS_HANDLE_HPP
47 #include "Teuchos_Describable.hpp"
48 #include "Teuchos_Handleable.hpp"
78 template <
typename Po
interType>
99 {ptr_=rcp_const_cast<const PointerType>(ptr);}
105 {
return rcp_const_cast<PointerType>(ptr_);}
134 template <
typename Po
interType>
179 #define TEUCHOS_HANDLE_CTORS(handle, contents) \
180 handle() : Teuchos::Handle<contents >() {;} \
181 handle(Teuchos::Handleable<contents >* rawPtr) : Teuchos::Handle<contents >(rawPtr) {;} \
182 handle(const Teuchos::RCP<contents >& smartPtr) : Teuchos::Handle<contents >(smartPtr){;}
195 #define TEUCHOS_CONST_HANDLE_CTORS(handle, contents) \
196 handle( Teuchos::ENull _null = Teuchos::null ) : Teuchos::ConstHandle<contents >() {;} \
197 handle(const Teuchos::ConstHandleable<contents >* rawPtr) : Teuchos::ConstHandle<contents >(rawPtr) {;} \
198 handle(const Teuchos::RCP<const contents >& smartPtr) : Teuchos::ConstHandle<contents >(smartPtr){;}
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
Reference-counted pointer class and non-member templated function implementations.
Templated handle class with strong const protection.
RCP< PointerType > nonConstPtr() const
Protected non-const access to the underlying smart pointer.
void setRcp(const RCP< PointerType > &ptr)
This function is needed in Handle ctors.
ConstHandle(const ConstHandleable< PointerType > *ptr)
Construct with a raw pointer to a ConstHandleable. This will make a call to rcp(),...
const PointerType *const rawPtr()
Access to raw pointer.
ConstHandle(const RCP< const PointerType > &ptr)
Construct with an existing RCP.
const RCP< const PointerType > & constPtr() const
Read-only access to the underlying smart pointer.
ConstHandle()
The empty ctor will only be called by Handle ctors.
Class ConstHandleable provides an abstract interface for polymorphic conversion from raw pointers to ...
Base class for all objects that can describe themselves.
Generic templated handle class.
PointerType * rawPtr() const
Access to non-const raw pointer.
RCP< PointerType > ptr() const
Read/write access to the underlying smart pointer.
Handle(const RCP< PointerType > &smartPtr)
Construct with an existing RCP.
Handle(Handleable< PointerType > *rawPtr)
Construct with a raw pointer to a Handleable.
Class Handleable provides an abstract interface for polymorphic conversion from raw pointers to smart...
T * get() const
Get the raw C++ pointer to the underlying object.
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...