Rcpp Version 1.0.14
Loading...
Searching...
No Matches
TagProxy.h
Go to the documentation of this file.
1
// Copyright (C) 2013 Romain Francois
2
//
3
// This file is part of Rcpp.
4
//
5
// Rcpp is free software: you can redistribute it and/or modify it
6
// under the terms of the GNU General Public License as published by
7
// the Free Software Foundation, either version 2 of the License, or
8
// (at your option) any later version.
9
//
10
// Rcpp is distributed in the hope that it will be useful, but
11
// WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
14
//
15
// You should have received a copy of the GNU General Public License
16
// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
17
18
#ifndef Rcpp_TagProxy_h
19
#define Rcpp_TagProxy_h
20
21
namespace
Rcpp
{
22
23
template
<
typename
XPtrClass>
24
class
TagProxyPolicy
{
25
public
:
26
27
class
TagProxy
:
public
GenericProxy
<TagProxy>{
28
public
:
29
TagProxy
(
XPtrClass
&
xp_
):
xp
(
xp_
){}
30
31
template
<
typename
U>
32
TagProxy
&
operator=
(
const
U
&
u
);
33
34
template
<
typename
U>
35
operator
U
()
const
;
36
37
operator
SEXP
()
const
;
38
39
40
private
:
41
XPtrClass
&
xp
;
42
43
inline
SEXP
get
()
const
{
44
return
R_ExternalPtrTag
(
xp
) ;
45
}
46
47
inline
void
set
(
SEXP
x){
48
R_SetExternalPtrTag
(
xp
, x ) ;
49
}
50
51
} ;
52
53
class
const_TagProxy
:
public
GenericProxy
<const_TagProxy>{
54
public
:
55
const_TagProxy
(
XPtrClass
&
xp_
):
xp
(
xp_
){}
56
57
template
<
typename
U>
58
operator
U
()
const
;
59
60
operator
SEXP
()
const
;
61
62
63
private
:
64
XPtrClass
&
xp
;
65
66
inline
SEXP
get
()
const
{
67
return
R_ExternalPtrTag
(
xp
) ;
68
}
69
70
} ;
71
72
73
TagProxy
tag
(){
74
return
TagProxy
(
static_cast<
XPtrClass
&
>
(*
this
) ) ;
75
}
76
77
const_TagProxy
tag
()
const
{
78
return
TagProxy
(
static_cast<
const
XPtrClass
&
>
(*
this
) ) ;
79
}
80
81
82
} ;
83
}
84
85
#endif
Rcpp::TagProxyPolicy::TagProxy
Definition
TagProxy.h:27
Rcpp::TagProxyPolicy::TagProxy::xp
XPtrClass & xp
Definition
TagProxy.h:41
Rcpp::TagProxyPolicy::TagProxy::operator=
TagProxy & operator=(const U &u)
Rcpp::TagProxyPolicy::TagProxy::set
void set(SEXP x)
Definition
TagProxy.h:47
Rcpp::TagProxyPolicy::TagProxy::TagProxy
TagProxy(XPtrClass &xp_)
Definition
TagProxy.h:29
Rcpp::TagProxyPolicy::TagProxy::get
SEXP get() const
Definition
TagProxy.h:43
Rcpp::TagProxyPolicy::const_TagProxy
Definition
TagProxy.h:53
Rcpp::TagProxyPolicy::const_TagProxy::const_TagProxy
const_TagProxy(XPtrClass &xp_)
Definition
TagProxy.h:55
Rcpp::TagProxyPolicy::const_TagProxy::get
SEXP get() const
Definition
TagProxy.h:66
Rcpp::TagProxyPolicy::const_TagProxy::xp
XPtrClass & xp
Definition
TagProxy.h:64
Rcpp::TagProxyPolicy
Definition
TagProxy.h:24
Rcpp::TagProxyPolicy::tag
TagProxy tag()
Definition
TagProxy.h:73
Rcpp::TagProxyPolicy::tag
const_TagProxy tag() const
Definition
TagProxy.h:77
Rcpp
Rcpp API.
Definition
algo.h:28
Rcpp::as
T as(SEXP x)
Definition
as.h:151
Rcpp::GenericProxy
Definition
GenericProxy.h:24
inst
include
Rcpp
proxy
TagProxy.h
Generated on Sun Jan 12 2025 11:21:42 for Rcpp Version 1.0.14 by
1.9.8