Rcpp Version 1.0.14
Loading...
Searching...
No Matches
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#include <Rcpp/r/compat.h>
32
36namespace Rcpp {
37
41 namespace traits {
42 } // traits
43
47 namespace internal {
48 } // internal
49} // Rcpp
50
51#include <iterator>
52#include <exception>
53#include <iostream>
54#include <iomanip>
55#include <sstream>
56#include <string>
57#include <list>
58#include <map>
59#include <set>
60#include <stdexcept>
61#include <vector>
62#include <deque>
63#include <functional>
64#include <numeric>
65#include <algorithm>
66#include <complex>
67#include <cfloat>
68#include <limits>
69#include <typeinfo>
70#include <utility>
71#include <Rcpp/sprintf.h>
72#include <R_ext/Callbacks.h>
73#include <R_ext/Visibility.h>
75
76#include <Rmath.h>
78
79namespace Rcpp {
80
83
85 void Rcpp_precious_remove(SEXP token);
86
87 namespace internal {
89 }
90
91 class Module;
92
93 namespace traits {
94 template <typename T> class named_object;
95 }
96
97 // begin deprecated interface not using precious list
98 // use Rcpp_PreciousPreserve + Rcpp_PreciousRelease below it
100 if (x != R_NilValue) R_PreserveObject(x);
101 return x;
102 }
103 inline void Rcpp_ReleaseObject(SEXP x) {
104 if (x != R_NilValue) R_ReleaseObject(x);
105 }
107 // if we are setting to the same SEXP as we already have, do nothing
108 if (x != y) {
111 }
112 return y;
113 }
114 // end deprecated interface not using precious list
115
116 // new preferred interface using token-based precious list
118 return Rcpp_precious_preserve(object);
119 }
120
121 inline void Rcpp_PreciousRelease(SEXP token) {
123 }
124
125}
126
127#include <Rcpp/storage/storage.h>
129#include <Rcpp/routines.h>
130#include <Rcpp/exceptions.h>
131#include <Rcpp/proxy/proxy.h>
132
133#ifdef RCPP_USING_UNWIND_PROTECT
134 #include <Rcpp/unwindProtect.h>
135#endif
136
137#include <Rcpp/lang.h>
138#include <Rcpp/complex.h>
139#include <Rcpp/barrier.h>
140
141#define RcppExport extern "C" attribute_visible
142
143#include <Rcpp/Interrupt.h>
144
145namespace Rcpp {
146 template <typename T> class object;
147 class String;
148 namespace internal {
149 template <typename Class> SEXP make_new_object(Class* ptr);
150 }
151}
152
153#include <Rcpp/longlong.h>
154
155#include <Rcpp/internal/na.h>
156#include <Rcpp/internal/NAComparator.h>
157#include <Rcpp/internal/NAEquals.h>
158
159#include <Rcpp/traits/traits.h>
160#include <Rcpp/Named.h>
161
162#include <Rcpp/internal/caster.h>
163#include <Rcpp/internal/r_vector.h>
164#include <Rcpp/r_cast.h>
165
166#include <Rcpp/api/bones/bones.h>
167
168#include <Rcpp/internal/export.h>
169#include <Rcpp/internal/r_coerce.h>
170#include <Rcpp/as.h>
171#include <Rcpp/InputParameter.h>
172#include <Rcpp/is.h>
173
176
177#include <Rcpp/internal/ListInitialization.h>
178#include <Rcpp/internal/Proxy_Iterator.h>
179#include <Rcpp/internal/SEXP_Iterator.h>
180#include <Rcpp/internal/converter.h>
181
182#include <Rcpp/print.h>
183#include <Rcpp/algo.h>
184
186
188
189#include <Rcpp/internal/wrap.h>
190
191#endif
T as(SEXP x, ::Rcpp::traits::r_type_primitive_tag)
Definition as.h:43
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:99
void Rcpp_ReleaseObject(SEXP x)
Definition RcppCommon.h:103
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:117
void Rcpp_PreciousRelease(SEXP token)
Definition RcppCommon.h:121
attribute_hidden SEXP Rcpp_precious_preserve(SEXP object)
Definition routines.h:152
T as(SEXP x)
Definition as.h:151
attribute_hidden void Rcpp_precious_remove(SEXP token)
Definition routines.h:157
SEXP Rcpp_ReplaceObject(SEXP x, SEXP y)
Definition RcppCommon.h:106