Rcpp Version 1.0.14
Loading...
Searching...
No Matches
proxy.h
Go to the documentation of this file.
1// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; indent-tabs-mode: nil; -*-
2//
3// proxy.h: Rcpp R/C++ interface class library -- proxy meat
4//
5// Copyright (C) 2014 Dirk Eddelbuettel, Romain Francois, and Kevin Ushey
6//
7// This file is part of Rcpp.
8//
9// Rcpp is free software: you can redistribute it and/or modify it
10// under the terms of the GNU General Public License as published by
11// the Free Software Foundation, either version 2 of the License, or
12// (at your option) any later version.
13//
14// Rcpp is distributed in the hope that it will be useful, but
15// WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17// GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
21#ifndef RCPP_API_MEAT_PROXY_H
22#define RCPP_API_MEAT_PROXY_H
23
24// NOTE: Implementing this as 'meat' is necessary as it allows user-defined
25// classes writing their own overloads of 'wrap', 'as' to function correctly!
26namespace Rcpp {
27
28// AttributeProxy
29template <typename CLASS>
30template <typename T>
31typename AttributeProxyPolicy<CLASS>::AttributeProxy&
33 set(wrap(rhs));
34 return *this;
35}
36
37template <typename CLASS>
38template <typename T>
43template <typename CLASS>
47
48template <typename CLASS>
49template <typename T>
53
54template <typename CLASS>
58
59// NamesProxy
60template <typename CLASS>
61template <typename T>
64 set(Shield<SEXP>(wrap(rhs)));
65 return *this;
66}
67
68template <typename CLASS>
69template <typename T>
71 return as<T>( get() );
72}
73
74template <typename CLASS>
75template <typename T>
79
80// SlotProxy
81template <typename CLASS>
82template <typename T>
85 set(Shield<SEXP>(wrap(rhs)));
86 return *this;
87}
88
89template <typename CLASS>
90template <typename T>
94
95// TagProxy
96template <typename CLASS>
97template <typename T>
100 set(Shield<SEXP>(wrap(rhs)));
101 return *this;
102}
103
104template <typename CLASS>
105template <typename T>
107 return as<T>(get());
108}
109
110template <typename CLASS>
114
115template <typename CLASS>
116template <typename T>
118 return as<T>(get());
119}
120
121template <typename CLASS>
125
126// Binding
127template <typename CLASS>
128template <typename T>
131 set(Shield<SEXP>(wrap(rhs)));
132 return *this;
133}
134
135template <typename CLASS>
136template <typename T>
138 return as<T>(get());
139}
140
141template <typename CLASS>
142template <typename T>
146
147// DottedPairProxy
148template <typename CLASS>
149template <typename T>
152 set(Shield<SEXP>(wrap(rhs)));
153 return *this;
154}
155
156template <typename CLASS>
157template <typename T>
162
163template <typename CLASS>
164template <typename T>
168
169template <typename CLASS>
170template <typename T>
174
175// FieldProxy
176template <typename CLASS>
179 if (this != &rhs) set(rhs.get());
180 return *this;
181}
182
183template <typename CLASS>
184template <typename T>
187 set(Shield<SEXP>(wrap(rhs)));
188 return *this;
189}
190
191template <typename CLASS>
192template <typename T>
196
197template <typename CLASS>
198template <typename T>
202
203}
204
205#endif
AttributeProxy & operator=(const AttributeProxy &rhs)
Binding & operator=(const Binding &rhs)
Definition Binding.h:47
DottedPairProxy & operator=(const DottedPairProxy &rhs)
FieldProxy & operator=(const FieldProxy &rhs)
NamesProxy & operator=(const NamesProxy &rhs)
Definition NamesProxy.h:32
SlotProxy & operator=(const SlotProxy &rhs)
Definition SlotProxy.h:35
TagProxy & operator=(const U &u)
const std::string & name
Rcpp API.
Definition algo.h:28
SEXP get(const std::string &name) const
Definition Environment.h:98
T as(SEXP x)
Definition as.h:151
SEXP wrap(const Date &date)
Definition Date.h:38