Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
remainder
src
Teuchos_Handleable.hpp
1
// @HEADER
2
// *****************************************************************************
3
// Teuchos: Common Tools Package
4
//
5
// Copyright 2004 NTESS and the Teuchos contributors.
6
// SPDX-License-Identifier: BSD-3-Clause
7
// *****************************************************************************
8
// @HEADER
9
10
#ifndef TEUCHOS_HANDLEABLE_HPP
11
#define TEUCHOS_HANDLEABLE_HPP
12
13
#include "
Teuchos_ConfigDefs.hpp
"
14
#include "
Teuchos_RCP.hpp
"
15
16
17
namespace
Teuchos
18
{
33
template
<
typename
Base>
34
class
ConstHandleable
35
{
36
public
:
38
virtual
~ConstHandleable
(){}
39
42
virtual
RCP<const Base>
getConstRcp
()
const
= 0 ;
43
};
44
59
template
<
typename
Base>
60
class
Handleable
:
public
virtual
ConstHandleable
<Base>
61
{
62
public
:
63
65
virtual
~Handleable
(){;}
66
68
virtual
RCP<Base>
getRcp
() = 0 ;
69
70
};
71
}
72
73
87
#define TEUCHOS_GET_RCP(Base) \
88
virtual Teuchos::RCP<const Base > getConstRcp() const {return rcp(this);} \
89
virtual Teuchos::RCP<Base > getRcp() {return rcp(this);}
90
102
#define TEUCHOS_GET_CONST_RCP(Base) \
103
virtual Teuchos::RCP<const Base > getConstRcp() const {return rcp(this);}
104
105
106
107
108
#endif
// TEUCHOS_HANDLEABLE_HPP
Teuchos_ConfigDefs.hpp
Teuchos header file which uses auto-configuration information to include necessary C++ headers.
Teuchos_RCP.hpp
Reference-counted pointer class and non-member templated function implementations.
Teuchos::ConstHandleable
Class ConstHandleable provides an abstract interface for polymorphic conversion from raw pointers to ...
Definition
Teuchos_Handleable.hpp:35
Teuchos::ConstHandleable::getConstRcp
virtual RCP< const Base > getConstRcp() const =0
Virtual dtorReturn a safely-created RCP to the base type.
Teuchos::ConstHandleable::~ConstHandleable
virtual ~ConstHandleable()
Definition
Teuchos_Handleable.hpp:38
Teuchos::Handleable
Class Handleable provides an abstract interface for polymorphic conversion from raw pointers to smart...
Definition
Teuchos_Handleable.hpp:61
Teuchos::Handleable::~Handleable
virtual ~Handleable()
Definition
Teuchos_Handleable.hpp:65
Teuchos::Handleable::getRcp
virtual RCP< Base > getRcp()=0
Return a safely-created RCP to the base type.
Teuchos::RCP
Smart reference counting pointer class for automatic garbage collection.
Definition
Teuchos_RCPDecl.hpp:397
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0