Teuchos::ConstHandleable< Base > Class Template ReferenceClass ConstHandleable provides an abstract interface for polymorphic conversion from raw pointers to const smart pointers.
Inheritance diagram for Teuchos::ConstHandleable< Base >:
List of all members.
Class ConstHandleable provides an abstract interface for polymorphic conversion from raw pointers to const smart pointers.
class Teuchos::ConstHandleable< Base >
Recall from the Teuchos RefCountPtr documentation that one should never create directly a smart pointer from a raw pointer; rather, smart pointers should be created through a call to rcp(). The type of the argument to rcp() must be known at compile time. This makes the syntax
impossible with the straightforward implementation in which ConstHandle takes a raw pointer to a Base. In order to preserve this clean syntax, we require any handles supporting this syntax to take a raw pointer to a ConstHandleable<Base>, where ConstHandleable<Base> provides a getConstRcp() method which returns the result of a call to rcp() on this.
ConstHandle h = new Derived();
Definition at line 53 of file Teuchos_Handleable.hpp.
Constructor & Destructor Documentation
Member Function Documentation
Virtual dtorReturn a safely-created RefCountPtr to the base type.
The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:30:32 2008 for Teuchos - Trilinos Tools Package by 126.96.36.199