Teuchos - Trilinos Tools Package
Version of the Day
|
Templated handle class with strong const protection. More...
#include <Teuchos_Handle.hpp>
Public Member Functions | |
ConstHandle (const RCP< const PointerType > &ptr) | |
Construct with an existing RCP. More... | |
ConstHandle (const ConstHandleable< PointerType > *ptr) | |
Construct with a raw pointer to a ConstHandleable. This will make a call to rcp(), thus removing that call from the user interface. More... | |
const RCP< const PointerType > & | constPtr () const |
Read-only access to the underlying smart pointer. More... | |
const PointerType *const | rawPtr () |
Access to raw pointer. More... | |
Public Member Functions inherited from Teuchos::Describable | |
virtual std::string | description () const |
Return a simple one-line description of this object. More... | |
virtual void | describe (FancyOStream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
Print the object with some verbosity level to a FancyOStream. More... | |
void | describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
Version of describe() that takes an std::ostream instead of a FancyOStream. More... | |
virtual | ~Describable () |
Destructor (marked virtual for memory safety of derived classes). More... | |
Public Member Functions inherited from Teuchos::LabeledObject | |
LabeledObject () | |
Construct with an empty label. More... | |
virtual | ~LabeledObject () |
virtual void | setObjectLabel (const std::string &objectLabel) |
Set the object label (see LabeledObject). More... | |
virtual std::string | getObjectLabel () const |
Get the object label (see LabeledObject). More... | |
Protected Member Functions | |
ConstHandle () | |
The empty ctor will only be called by Handle ctors. More... | |
void | setRcp (const RCP< PointerType > &ptr) |
This function is needed in Handle ctors. More... | |
RCP< PointerType > | nonConstPtr () const |
Protected non-const access to the underlying smart pointer. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from Teuchos::Describable | |
static const EVerbosityLevel | verbLevel_default = VERB_DEFAULT |
Default value for the verbLevel argument of describe(). More... | |
Related Functions inherited from Teuchos::Describable | |
DescribableStreamManipulatorState | describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default) |
Describable output stream manipulator. More... | |
std::ostream & | operator<< (std::ostream &os, const DescribableStreamManipulatorState &d) |
Output stream operator for Describable manipulator. More... | |
Templated handle class with strong const protection.
In writing derived types, it is usually simplest to use the TEUCHOS_CONST_HANDLE_CTORS macro to generate boilerplate constructor code.
There are two modes of construction: construction from an existing RCP,
and construction from a raw pointer,
The second form makes the code slightly cleaner. Note that to use this second form, it is necessary that Derived implement the ConstHandleable interface; this is necessary to avoid any implicit conversions from just any raw pointer to a smart pointer.
Note that the first form with rcp() must be used whenever the object being handled has been allocated on the stack (using rcp(ptr,false) of course).
Definition at line 47 of file Teuchos_Handle.hpp.
|
inline |
Construct with an existing RCP.
Definition at line 51 of file Teuchos_Handle.hpp.
|
inlineexplicit |
Construct with a raw pointer to a ConstHandleable. This will make a call to rcp(), thus removing that call from the user interface.
Definition at line 54 of file Teuchos_Handle.hpp.
|
inlineexplicitprotected |
The empty ctor will only be called by Handle ctors.
Definition at line 61 of file Teuchos_Handle.hpp.
|
inline |
Read-only access to the underlying smart pointer.
Definition at line 56 of file Teuchos_Handle.hpp.
|
inline |
Access to raw pointer.
Definition at line 58 of file Teuchos_Handle.hpp.
|
inlineprotected |
This function is needed in Handle ctors.
The Handle ctors call the empty ConstHandle ctor and then set the pointer in the ConstHandle with a call to setRcp().
Definition at line 66 of file Teuchos_Handle.hpp.
|
inlineprotected |
Protected non-const access to the underlying smart pointer.
This will be called by the nonConstPtr() method of the non-const Handle subclass
Definition at line 72 of file Teuchos_Handle.hpp.