Public Member Functions
Sundance::Handleable< Base > Class Template Reference

Class Handleable provides an abstract interface for polymorphic conversion from raw pointers to smart pointers. More...

List of all members.

Public Member Functions

virtual ~Handleable ()
 Virtual dtor.
virtual RCP< Base > getRcp ()=0
 Return a safely-created RefCountPtr to the base type.

Detailed Description

template<class Base>
class Sundance::Handleable< Base >

Class Handleable provides an abstract interface for polymorphic conversion from raw pointers to smart pointers.

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

 Handle h = new Derived();

impossible with the straightforward implementation in which Handle 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 Handleable<Base>, where Handleable<Base> provides a getRcp() method which returns the result of a call to rcp() on this.

Definition at line 60 of file SundanceHandleable.hpp.


Constructor & Destructor Documentation

template<class Base>
virtual Sundance::Handleable< Base >::~Handleable ( ) [inline, virtual]

Virtual dtor.

Definition at line 64 of file SundanceHandleable.hpp.


Member Function Documentation

template<class Base>
virtual RCP<Base> Sundance::Handleable< Base >::getRcp ( ) [pure virtual]

Return a safely-created RefCountPtr to the base type.

Implemented in Sundance::DiscreteFunctionStub, Sundance::QuadratureFamilyStub, Sundance::TestFunctionStub, Sundance::UnknownFunctionStub, Sundance::ConstantExpr, Sundance::DerivOfSymbFunc, Sundance::DiffOp, Sundance::DiscreteFuncElement, Sundance::ExplicitFunctionalDerivativeElement, Sundance::FunctionalPolynomial, Sundance::ListExpr, Sundance::NonlinearUnaryOp, Sundance::ProductExpr, Sundance::SumExpr, Sundance::SumOfBCs, Sundance::SumOfIntegrals, Sundance::SymbolicFuncElement, Sundance::TestFuncElement, Sundance::UnaryMinus, Sundance::UnknownFuncElement, Sundance::UnknownParameterElement, Sundance::UserDefOpElement, Sundance::ZeroExpr, Sundance::CellDiameterExpr, Sundance::CellVectorExpr, Sundance::ComplexExpr, Sundance::CoordExpr, Sundance::CurveNormExpr, Sundance::Derivative, Sundance::Parameter, Sundance::UnknownParameter, Sundance::UserDefOp, Sundance::MaximalCellSet, Sundance::BasicSimplicialMeshType, Sundance::HNMeshType2D, Sundance::HNMeshType3D, Sundance::PeanoMeshType2D, Sundance::PeanoMeshType3D, Sundance::PeriodicMeshType1D, Sundance::BamgMeshReader, Sundance::ExodusMeshReader, Sundance::ExodusNetCDFMeshReader, Sundance::HNMesher2D, Sundance::HNMesher3D, Sundance::OneTriangleMesher, Sundance::OneTetMesher, Sundance::PartitionedLineMesher, Sundance::PartitionedRectangleMesher, Sundance::PeanoMesher2D, Sundance::PeanoMesher3D, Sundance::PeriodicLineMesher, Sundance::TriangleMeshReader, Sundance::ExtrusionMeshTransformation, Sundance::ExodusWriter, Sundance::MatlabWriter, Sundance::TriangleWriter, Sundance::VerboseFieldWriter, Sundance::VTKWriter, Sundance::CartesianCoordinateSystem, Sundance::MeridionalCylindricalCoordinateSystem, Sundance::RadialSphericalCoordinateSystem, TSFExtended::AmesosSolver, TSFExtended::AnasaziEigensolver< Scalar >, TSFExtended::AztecSolver, TSFExtended::BelosSolver, TSFExtended::BICGSTABSolver< Scalar >, TSFExtended::DenseLUSolver, and TSFExtended::GMRESSolver< Scalar >.

Site Contact