Rcpp Version 1.0.9
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 <utility>
70 #include <Rcpp/sprintf.h>
71 #include <R_ext/Callbacks.h>
72 #include <R_ext/Visibility.h>
73 #include <Rcpp/utils/tinyformat.h>
74 
75 #include <Rmath.h>
76 #include <Rcpp/sugar/undoRmath.h>
77 
78 namespace Rcpp {
79 
80  SEXP Rcpp_fast_eval(SEXP expr_, SEXP env);
81  SEXP Rcpp_eval(SEXP expr_, SEXP env = R_GlobalEnv);
82 
83  SEXP Rcpp_precious_preserve(SEXP object);
84  void Rcpp_precious_remove(SEXP token);
85 
86  namespace internal {
87  SEXP Rcpp_eval_impl(SEXP expr, SEXP env);
88  }
89 
90  class Module;
91 
92  namespace traits {
93  template <typename T> class named_object;
94  }
95 
96  // begin deprecated interface not using precious list
97  // use Rcpp_PreciousPreserve + Rcpp_PreciousRelease below it
98  inline SEXP Rcpp_PreserveObject(SEXP x) {
99  if (x != R_NilValue) R_PreserveObject(x);
100  return x;
101  }
102  inline void Rcpp_ReleaseObject(SEXP x) {
103  if (x != R_NilValue) R_ReleaseObject(x);
104  }
105  inline SEXP Rcpp_ReplaceObject(SEXP x, SEXP y) {
106  // if we are setting to the same SEXP as we already have, do nothing
107  if (x != y) {
110  }
111  return y;
112  }
113  // end deprecated interface not using precious list
114 
115  // new preferred interface using token-based precious list
116  inline SEXP Rcpp_PreciousPreserve(SEXP object) {
117  return Rcpp_precious_preserve(object);
118  }
119 
120  inline void Rcpp_PreciousRelease(SEXP token) {
121  Rcpp_precious_remove(token);
122  }
123 
124 }
125 
126 #include <Rcpp/storage/storage.h>
128 #include <Rcpp/routines.h>
129 #include <Rcpp/exceptions.h>
130 #include <Rcpp/proxy/proxy.h>
131 
132 #ifdef RCPP_USING_UNWIND_PROTECT
133  #include <Rcpp/unwindProtect.h>
134 #endif
135 
136 #include <Rcpp/lang.h>
137 #include <Rcpp/complex.h>
138 #include <Rcpp/barrier.h>
139 
140 #define RcppExport extern "C" attribute_visible
141 
142 #include <Rcpp/Interrupt.h>
143 
144 namespace Rcpp {
145  template <typename T> class object;
146  class String;
147  namespace internal {
148  template <typename Class> SEXP make_new_object(Class* ptr);
149  }
150 }
151 
152 #include <Rcpp/longlong.h>
153 
154 #include <Rcpp/internal/na.h>
155 #include <Rcpp/internal/NAComparator.h>
156 #include <Rcpp/internal/NAEquals.h>
157 
158 #include <Rcpp/traits/traits.h>
159 #include <Rcpp/Named.h>
160 
161 #include <Rcpp/internal/caster.h>
162 #include <Rcpp/internal/r_vector.h>
163 #include <Rcpp/r_cast.h>
164 
165 #include <Rcpp/api/bones/bones.h>
166 
167 #include <Rcpp/internal/export.h>
168 #include <Rcpp/internal/r_coerce.h>
169 #include <Rcpp/as.h>
170 #include <Rcpp/InputParameter.h>
171 #include <Rcpp/is.h>
172 
173 #include <Rcpp/vector/VectorBase.h>
174 #include <Rcpp/vector/MatrixBase.h>
175 
176 #include <Rcpp/internal/ListInitialization.h>
177 #include <Rcpp/internal/Proxy_Iterator.h>
178 #include <Rcpp/internal/SEXP_Iterator.h>
179 #include <Rcpp/internal/converter.h>
180 
181 #include <Rcpp/print.h>
182 #include <Rcpp/algo.h>
183 
185 
187 
188 #include <Rcpp/internal/wrap.h>
189 
190 #endif
SEXP make_new_object(Class *ptr)
Definition: Module.h:77
SEXP Rcpp_eval_impl(SEXP expr, SEXP env)
Definition: Rcpp_eval.h:48
Rcpp API.
Definition: algo.h:28
SEXP Rcpp_PreserveObject(SEXP x)
Definition: RcppCommon.h:98
void Rcpp_ReleaseObject(SEXP x)
Definition: RcppCommon.h:102
SEXP Rcpp_fast_eval(SEXP expr, SEXP env)
Definition: Rcpp_eval.h:68
SEXP Rcpp_eval(SEXP expr, SEXP env)
Definition: Rcpp_eval.h:75
SEXP Rcpp_PreciousPreserve(SEXP object)
Definition: RcppCommon.h:116
void Rcpp_PreciousRelease(SEXP token)
Definition: RcppCommon.h:120
attribute_hidden SEXP Rcpp_precious_preserve(SEXP object)
Definition: routines.h:152
attribute_hidden void Rcpp_precious_remove(SEXP token)
Definition: routines.h:157
SEXP Rcpp_ReplaceObject(SEXP x, SEXP y)
Definition: RcppCommon.h:105