Rcpp Version 1.0.7
RcppCommon.h
Go to the documentation of this file.
1 
2 //
3 // RcppCommon.h: Rcpp R/C++ interface class library -- common include and defines statements
4 //
5 // Copyright (C) 2008 - 2009 Dirk Eddelbuettel
6 // Copyright (C) 2009 - 2020 Dirk Eddelbuettel and Romain Francois
7 // Copyright (C) 2021 Dirk Eddelbuettel, Romain Francois and IƱaki Ucar
8 //
9 // This file is part of Rcpp.
10 //
11 // Rcpp is free software: you can redistribute it and/or modify it
12 // under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 2 of the License, or
14 // (at your option) any later version.
15 //
16 // Rcpp is distributed in the hope that it will be useful, but
17 // WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
23 
24 #ifndef RcppCommon_h
25 #define RcppCommon_h
26 
27 // #define RCPP_DEBUG_LEVEL 1
28 // #define RCPP_DEBUG_MODULE_LEVEL 1
29 
30 #include <Rcpp/r/headers.h>
31 
35 namespace Rcpp {
36 
40  namespace traits {
41  } // traits
42 
46  namespace internal {
47  } // internal
48 } // Rcpp
49 
50 #include <iterator>
51 #include <exception>
52 #include <iostream>
53 #include <iomanip>
54 #include <sstream>
55 #include <string>
56 #include <list>
57 #include <map>
58 #include <set>
59 #include <stdexcept>
60 #include <vector>
61 #include <deque>
62 #include <functional>
63 #include <numeric>
64 #include <algorithm>
65 #include <complex>
66 #include <cfloat>
67 #include <limits>
68 #include <typeinfo>
69 #include <Rcpp/sprintf.h>
70 #include <R_ext/Callbacks.h>
71 #include <R_ext/Visibility.h>
72 #include <Rcpp/utils/tinyformat.h>
73 
74 #include <Rmath.h>
75 #include <Rcpp/sugar/undoRmath.h>
76 
77 namespace Rcpp {
78 
79  SEXP Rcpp_fast_eval(SEXP expr_, SEXP env);
80  SEXP Rcpp_eval(SEXP expr_, SEXP env = R_GlobalEnv);
81 
82  SEXP Rcpp_precious_preserve(SEXP object);
83  void Rcpp_precious_remove(SEXP token);
84 
85  namespace internal {
86  SEXP Rcpp_eval_impl(SEXP expr, SEXP env);
87  }
88 
89  class Module;
90 
91  namespace traits {
92  template <typename T> class named_object;
93  }
94 
95  // begin deprecated interface not using precious list
96  // use Rcpp_PreciousPreserve + Rcpp_PreciousRelease below it
97  inline SEXP Rcpp_PreserveObject(SEXP x) {
98  if (x != R_NilValue) R_PreserveObject(x);
99  return x;
100  }
101  inline void Rcpp_ReleaseObject(SEXP x) {
102  if (x != R_NilValue) R_ReleaseObject(x);
103  }
104  inline SEXP Rcpp_ReplaceObject(SEXP x, SEXP y) {
105  // if we are setting to the same SEXP as we already have, do nothing
106  if (x != y) {
109  }
110  return y;
111  }
112  // end deprecated interface not using precious list
113 
114  // new preferred interface using token-based precious list
115  inline SEXP Rcpp_PreciousPreserve(SEXP object) {
116  return Rcpp_precious_preserve(object);
117  }
118 
119  inline void Rcpp_PreciousRelease(SEXP token) {
120  Rcpp_precious_remove(token);
121  }
122 
123 }
124 
125 #include <Rcpp/storage/storage.h>
127 #include <Rcpp/routines.h>
128 #include <Rcpp/exceptions.h>
129 #include <Rcpp/proxy/proxy.h>
130 
131 #ifdef RCPP_USING_UNWIND_PROTECT
132  #include <Rcpp/unwindProtect.h>
133 #endif
134 
135 #include <Rcpp/lang.h>
136 #include <Rcpp/complex.h>
137 #include <Rcpp/barrier.h>
138 
139 #define RcppExport extern "C" attribute_visible
140 
141 #include <Rcpp/Interrupt.h>
142 
143 namespace Rcpp {
144  template <typename T> class object;
145  class String;
146  namespace internal {
147  template <typename Class> SEXP make_new_object(Class* ptr);
148  }
149 }
150 
151 #include <Rcpp/longlong.h>
152 
153 #include <Rcpp/internal/na.h>
154 #include <Rcpp/internal/NAComparator.h>
155 #include <Rcpp/internal/NAEquals.h>
156 
157 #include <Rcpp/traits/traits.h>
158 #include <Rcpp/Named.h>
159 
160 #include <Rcpp/internal/caster.h>
161 #include <Rcpp/internal/r_vector.h>
162 #include <Rcpp/r_cast.h>
163 
164 #include <Rcpp/api/bones/bones.h>
165 
166 #include <Rcpp/internal/export.h>
167 #include <Rcpp/internal/r_coerce.h>
168 #include <Rcpp/as.h>
169 #include <Rcpp/InputParameter.h>
170 #include <Rcpp/is.h>
171 
172 #include <Rcpp/vector/VectorBase.h>
173 #include <Rcpp/vector/MatrixBase.h>
174 
175 #include <Rcpp/internal/ListInitialization.h>
176 #include <Rcpp/internal/Proxy_Iterator.h>
177 #include <Rcpp/internal/SEXP_Iterator.h>
178 #include <Rcpp/internal/converter.h>
179 
180 #include <Rcpp/print.h>
181 #include <Rcpp/algo.h>
182 
184 
186 
187 #include <Rcpp/internal/wrap.h>
188 
189 #endif
Named.h
protection.h
proxy.h
exceptions.h
unwindProtect.h
sugar_forward.h
InputParameter.h
Rcpp::Rcpp_PreserveObject
SEXP Rcpp_PreserveObject(SEXP x)
Definition: RcppCommon.h:97
Rcpp::internal::Rcpp_eval_impl
SEXP Rcpp_eval_impl(SEXP expr, SEXP env)
Definition: Rcpp_eval.h:48
MatrixBase.h
as.h
Rcpp::Rcpp_precious_preserve
attribute_hidden SEXP Rcpp_precious_preserve(SEXP object)
Definition: routines.h:152
bones.h
Rcpp::Rcpp_precious_remove
attribute_hidden void Rcpp_precious_remove(SEXP token)
Definition: routines.h:157
Rcpp::Rcpp_ReplaceObject
SEXP Rcpp_ReplaceObject(SEXP x, SEXP y)
Definition: RcppCommon.h:104
headers.h
algo.h
Rcpp::Rcpp_fast_eval
SEXP Rcpp_fast_eval(SEXP expr, SEXP env)
Definition: Rcpp_eval.h:68
traits.h
tinyformat.h
undoRmath.h
complex.h
Rcpp::Rcpp_eval
SEXP Rcpp_eval(SEXP expr, SEXP env)
Definition: Rcpp_eval.h:75
longlong.h
is.h
Rcpp
Rcpp API.
Definition: algo.h:28
Rcpp::Rcpp_PreciousPreserve
SEXP Rcpp_PreciousPreserve(SEXP object)
Definition: RcppCommon.h:115
r_cast.h
Interrupt.h
print.h
barrier.h
sprintf.h
routines.h
Rcpp::Rcpp_PreciousRelease
void Rcpp_PreciousRelease(SEXP token)
Definition: RcppCommon.h:119
Rstreambuf.h
lang.h
storage.h
Rcpp::internal::make_new_object
SEXP make_new_object(Class *ptr)
Definition: Module.h:77
Rcpp::Rcpp_ReleaseObject
void Rcpp_ReleaseObject(SEXP x)
Definition: RcppCommon.h:101
VectorBase.h
Rmath.h