Teuchos - Trilinos Tools Package
Version of the Day
Toggle main menu visibility
Loading...
Searching...
No Matches
core
src
Teuchos_getRawPtr.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_GETRAWPTR_HPP
11
#define TEUCHOS_GETRAWPTR_HPP
12
13
#include "Teuchos_ArrayRCP.hpp"
14
15
namespace
Teuchos
{
16
17
template
<
class
Container>
18
class
RawPointerConversionTraits {
19
// Empty : will fail if specialization doesn't exist
20
};
21
22
23
template
<
class
Container>
24
typename
RawPointerConversionTraits<Container>::Ptr_t
25
getRawPtr(
const
Container& c )
26
{
27
return
RawPointerConversionTraits<Container>::getRawPtr(c);
28
}
29
30
31
// partial specialization for C pointer
32
template
<
class
RawType>
33
class
RawPointerConversionTraits<RawType*>
34
{
35
public
:
36
typedef
RawType* Ptr_t;
37
static
Ptr_t getRawPtr( RawType* p ) {
return
p; }
38
};
39
40
// partial specialization for ArrayRCP
41
template
<
class
T>
42
class
RawPointerConversionTraits<
ArrayRCP
<T> >
43
{
44
public
:
45
typedef
typename
ArrayRCP<T>::pointer
Ptr_t;
46
static
Ptr_t getRawPtr(
const
ArrayRCP<T>&
arcp
) {
return
arcp
.getRawPtr(); }
47
};
48
49
// ToDo: Add specializations as needed!
50
51
}
// namespace Teuchos
52
53
#endif
// TEUCHOS_GETRAWPTR_HPP
54
Teuchos::ArrayRCP
Reference-counted smart pointer for managing arrays.
Definition
Teuchos_ArrayRCPDecl.hpp:94
Teuchos::ArrayRCP::arcp
ArrayRCP< T > arcp(const RCP< Array< T > > &v)
Wrap an RCP<Array<T> > object as an ArrayRCP<T> object.
Definition
Teuchos_Array.hpp:512
Teuchos::ArrayRCP::pointer
T * pointer
Type of a (raw) (nonconstant) pointer to an array element.
Definition
Teuchos_ArrayRCPDecl.hpp:124
Teuchos
The Teuchos namespace contains all of the classes, structs and enums used by Teuchos,...
Generated by
1.17.0