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