diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt index 94ae48e992a..81e2b1aeadf 100644 --- a/dev/release/rat_exclude_files.txt +++ b/dev/release/rat_exclude_files.txt @@ -248,6 +248,8 @@ r/man/*.Rd r/cran-comments.md r/vignettes/*.Rmd r/tests/testthat/test-*.txt +r/inst/include/cpp11.hpp +r/inst/include/cpp11/*.hpp .gitattributes ruby/red-arrow/.yardopts rust/arrow/test/data/*.csv diff --git a/r/DESCRIPTION b/r/DESCRIPTION index 5c1b1199f5d..9ef496d4027 100644 --- a/r/DESCRIPTION +++ b/r/DESCRIPTION @@ -23,15 +23,12 @@ Language: en-US LazyData: true SystemRequirements: C++11 Biarch: true -LinkingTo: - Rcpp (>= 1.0.1) Imports: assertthat, bit64, methods, purrr, R6, - Rcpp (>= 1.0.1), rlang, tidyselect, utils, diff --git a/r/NAMESPACE b/r/NAMESPACE index be3d5b43780..8adb10125d9 100644 --- a/r/NAMESPACE +++ b/r/NAMESPACE @@ -253,7 +253,6 @@ export(write_ipc_stream) export(write_parquet) export(write_to_raw) importFrom(R6,R6Class) -importFrom(Rcpp,sourceCpp) importFrom(assertthat,assert_that) importFrom(assertthat,is.string) importFrom(bit64,print.integer64) diff --git a/r/NEWS.md b/r/NEWS.md index 86e15a2d1f4..ca668a7c158 100644 --- a/r/NEWS.md +++ b/r/NEWS.md @@ -35,6 +35,10 @@ * S3 support is now enabled in binary macOS and Windows (Rtools40 only, i.e. R >= 4.0) packages +## Other improvements + +* `arrow` now depends on [`cpp11`](https://cpp11.r-lib.org/), which brings more robust UTF-8 handling and faster compilation + # arrow 1.0.1 ## Bug fixes diff --git a/r/R/arrow-package.R b/r/R/arrow-package.R index 45715a0ed12..5ab67937f32 100644 --- a/r/R/arrow-package.R +++ b/r/R/arrow-package.R @@ -19,7 +19,6 @@ #' @importFrom purrr as_mapper map map2 map_chr map_dfr map_int map_lgl #' @importFrom assertthat assert_that is.string #' @importFrom rlang list2 %||% is_false abort dots_n warn enquo quo_is_null enquos is_integerish quos eval_tidy new_data_mask syms env env_bind as_label set_names -#' @importFrom Rcpp sourceCpp #' @importFrom tidyselect vars_select #' @useDynLib arrow, .registration = TRUE #' @keywords internal diff --git a/r/R/arrowExports.R b/r/R/arrowExports.R index e11b2d24c63..45983a3390a 100644 --- a/r/R/arrowExports.R +++ b/r/R/arrowExports.R @@ -576,8 +576,8 @@ fixed_size_list__ <- function(x, list_size){ .Call(`_arrow_fixed_size_list__` , x, list_size) } -struct_ <- function(fields){ - .Call(`_arrow_struct_` , fields) +struct__ <- function(fields){ + .Call(`_arrow_struct__` , fields) } DataType__ToString <- function(type){ @@ -1012,12 +1012,12 @@ io___BufferOutputStream__Write <- function(stream, bytes){ invisible(.Call(`_arrow_io___BufferOutputStream__Write` , stream, bytes)) } -json___ReadOptions__initialize <- function(options){ - .Call(`_arrow_json___ReadOptions__initialize` , options) +json___ReadOptions__initialize <- function(use_threads, block_size){ + .Call(`_arrow_json___ReadOptions__initialize` , use_threads, block_size) } -json___ParseOptions__initialize <- function(options){ - .Call(`_arrow_json___ParseOptions__initialize` , options) +json___ParseOptions__initialize <- function(newlines_in_values){ + .Call(`_arrow_json___ParseOptions__initialize` , newlines_in_values) } json___TableReader__Make <- function(input, read_options, parse_options){ @@ -1212,12 +1212,12 @@ ExportSchema <- function(schema, ptr){ invisible(.Call(`_arrow_ExportSchema` , schema, ptr)) } -ExportArray <- function(array, ptr, schema_ptr){ - invisible(.Call(`_arrow_ExportArray` , array, ptr, schema_ptr)) +ExportArray <- function(array, array_ptr, schema_ptr){ + invisible(.Call(`_arrow_ExportArray` , array, array_ptr, schema_ptr)) } -ExportRecordBatch <- function(batch, ptr, schema_ptr){ - invisible(.Call(`_arrow_ExportRecordBatch` , batch, ptr, schema_ptr)) +ExportRecordBatch <- function(batch, array_ptr, schema_ptr){ + invisible(.Call(`_arrow_ExportRecordBatch` , batch, array_ptr, schema_ptr)) } RecordBatch__num_columns <- function(x){ @@ -1252,10 +1252,6 @@ RecordBatch__select <- function(batch, indices){ .Call(`_arrow_RecordBatch__select` , batch, indices) } -RecordBatch__from_dataframe <- function(tbl){ - .Call(`_arrow_RecordBatch__from_dataframe` , tbl) -} - RecordBatch__Equals <- function(self, other, check_metadata){ .Call(`_arrow_RecordBatch__Equals` , self, other, check_metadata) } @@ -1440,10 +1436,6 @@ arrow__UnifySchemas <- function(schemas){ .Call(`_arrow_arrow__UnifySchemas` , schemas) } -Table__from_dataframe <- function(tbl){ - .Call(`_arrow_Table__from_dataframe` , tbl) -} - Table__num_columns <- function(x){ .Call(`_arrow_Table__num_columns` , x) } @@ -1504,6 +1496,14 @@ Table__select <- function(table, indices){ .Call(`_arrow_Table__select` , table, indices) } +all_record_batches <- function(lst){ + .Call(`_arrow_all_record_batches` , lst) +} + +Table__from_record_batches <- function(batches, schema_sxp){ + .Call(`_arrow_Table__from_record_batches` , batches, schema_sxp) +} + Table__from_dots <- function(lst, schema_sxp){ .Call(`_arrow_Table__from_dots` , lst, schema_sxp) } diff --git a/r/R/json.R b/r/R/json.R index ea340e3e657..1f05f84cfd0 100644 --- a/r/R/json.R +++ b/r/R/json.R @@ -74,12 +74,7 @@ JsonTableReader$create <- function(file, #' @export JsonReadOptions <- R6Class("JsonReadOptions", inherit = ArrowObject) JsonReadOptions$create <- function(use_threads = option_use_threads(), block_size = 1048576L) { - shared_ptr(JsonReadOptions, json___ReadOptions__initialize( - list( - use_threads = use_threads, - block_size = block_size - ) - )) + shared_ptr(JsonReadOptions, json___ReadOptions__initialize(use_threads, block_size)) } #' @rdname CsvReadOptions @@ -89,9 +84,5 @@ JsonReadOptions$create <- function(use_threads = option_use_threads(), block_siz #' @export JsonParseOptions <- R6Class("JsonParseOptions", inherit = ArrowObject) JsonParseOptions$create <- function(newlines_in_values = FALSE) { - shared_ptr(JsonParseOptions, json___ParseOptions__initialize( - list( - newlines_in_values = newlines_in_values - ) - )) + shared_ptr(JsonParseOptions, json___ParseOptions__initialize(newlines_in_values)) } diff --git a/r/R/parquet.R b/r/R/parquet.R index b44cf189805..15e23014455 100644 --- a/r/R/parquet.R +++ b/r/R/parquet.R @@ -268,7 +268,8 @@ ParquetWriterPropertiesBuilder <- R6Class("ParquetWriterPropertiesBuilder", inhe ) }, set_compression_level = function(table, compression_level){ - assert_that(is_integerish(compression_level)) + # cast to integer but keep names + compression_level <- set_names(as.integer(compression_level), names(compression_level)) private$.set(table, compression_level, parquet___ArrowWriterProperties___Builder__set_compression_levels ) diff --git a/r/R/schema.R b/r/R/schema.R index ddbf30fe93b..ef2598864dc 100644 --- a/r/R/schema.R +++ b/r/R/schema.R @@ -84,10 +84,7 @@ Schema <- R6Class("Schema", ), active = list( names = function() { - out <- Schema__field_names(self) - # Hack: Rcpp should set the encoding - Encoding(out) <- "UTF-8" - out + Schema__field_names(self) }, num_fields = function() Schema__num_fields(self), fields = function() map(Schema__fields(self), shared_ptr, class = Field), diff --git a/r/R/struct.R b/r/R/struct.R index 219fb28ab2a..feda966f56d 100644 --- a/r/R/struct.R +++ b/r/R/struct.R @@ -24,7 +24,7 @@ StructType <- R6Class("StructType", GetFieldIndex = function(name) StructType__GetFieldIndex(self, name) ) ) -StructType$create <- function(...) shared_ptr(StructType, struct_(.fields(list(...)))) +StructType$create <- function(...) shared_ptr(StructType, struct__(.fields(list(...)))) #' @rdname data-type #' @export diff --git a/r/R/table.R b/r/R/table.R index 1391eee4a7d..20eb9bb0a67 100644 --- a/r/R/table.R +++ b/r/R/table.R @@ -192,7 +192,11 @@ Table$create <- function(..., schema = NULL) { names(dots) <- rep_len("", length(dots)) } stopifnot(length(dots) > 0) - shared_ptr(Table, Table__from_dots(dots, schema)) + if (all_record_batches(dots)) { + shared_ptr(Table, Table__from_record_batches(dots, schema)) + } else { + shared_ptr(Table, Table__from_dots(dots, schema)) + } } #' @export diff --git a/r/README.md b/r/README.md index 1d560195676..6fb9cba7f35 100644 --- a/r/README.md +++ b/r/README.md @@ -107,7 +107,7 @@ Note that after any change to the C++ library, you must reinstall it and run `make clean` or `git clean -fdx .` to remove any cached object code in the `r/src/` directory before reinstalling the R package. This is only necessary if you make changes to the C++ library source; you do not -need to manually purge object files if you are only editing R or Rcpp +need to manually purge object files if you are only editing R or C++ code inside `r/`. Once you’ve built the C++ library, you can install the R package and its @@ -120,7 +120,7 @@ R -e 'install.packages(c("devtools", "roxygen2", "pkgdown", "covr")); devtools:: R CMD INSTALL . ``` -If you need to set any compilation flags while building the Rcpp +If you need to set any compilation flags while building the C++ extensions, you can use the `ARROW_R_CXXFLAGS` environment variable. For example, if you are using `perf` to profile the R extensions, you may need to set @@ -149,9 +149,9 @@ For any other build/configuration challenges, see the [C++ developer guide](https://arrow.apache.org/docs/developers/cpp/building.html) and `vignette("install", package = "arrow")`. -### Editing Rcpp code +### Editing C++ code -The `arrow` package uses some customized tools on top of `Rcpp` to +The `arrow` package uses some customized tools on top of `cpp11` to prepare its C++ code in `src/`. If you change C++ code in the R package, you will need to set the `ARROW_R_DEV` environment variable to `TRUE` (optionally, add it to your`~/.Renviron` file to persist across diff --git a/r/data-raw/codegen.R b/r/data-raw/codegen.R index a7f3581aa8d..ede4043c46f 100644 --- a/r/data-raw/codegen.R +++ b/r/data-raw/codegen.R @@ -18,10 +18,10 @@ # This file is used to generate code in the files # src/arrowExports.cpp and R/arrowExports.R # -# This is similar to what Rcpp::compileAttributes() would do, +# This is similar to what compileAttributes() would do, # with some arrow specific changes. # -# Functions are decorated with [[arrow::export]] instead of [[Rcpp::export]] +# Functions are decorated with [[arrow::export]] # and the generated code adds a layer of protection so that # the arrow package can be installed even when libarrow is not # @@ -45,9 +45,6 @@ suppressPackageStartupMessages({ get_exported_functions <- function(decorations, export_tag) { out <- decorations %>% filter(decoration %in% paste0(export_tag, "::export")) %>% - # the three lines below can be expressed with rap() - # more concisely - # rap( ~ decor:::parse_cpp_function(context)) mutate(functions = map(context, decor:::parse_cpp_function)) %>% { vec_cbind(., vec_rbind(!!!pull(., functions))) } %>% select(-functions) %>% @@ -67,7 +64,7 @@ wrap_call <- function(name, return_type, args) { if(return_type == "void") { glue::glue("\t{call};\n\treturn R_NilValue;", .trim = FALSE) } else { - glue::glue("\treturn Rcpp::wrap({call});") + glue::glue("\treturn cpp11::as_sexp({call});") } } @@ -81,13 +78,13 @@ cpp_functions_definitions <- arrow_exports %>% // {basename(file)} #if defined(ARROW_R_WITH_{toupper(decoration)}) {return_type} {name}({real_params}); - RcppExport SEXP _arrow_{name}({sexp_params}){{ - BEGIN_RCPP + extern "C" SEXP _arrow_{name}({sexp_params}){{ + BEGIN_CPP11 {input_params}{return_line}{wrap_call(name, return_type, args)} - END_RCPP + END_CPP11 }} #else - RcppExport SEXP _arrow_{name}({sexp_params}){{ + extern "C" SEXP _arrow_{name}({sexp_params}){{ \tRf_error("Cannot call {name}(). Please use arrow::install_arrow() to install required runtime libraries. "); }} #endif @@ -96,7 +93,7 @@ cpp_functions_definitions <- arrow_exports %>% sep = "\n", real_params = glue_collapse_data(args, "{type} {name}"), sexp_params = glue_collapse_data(args, "SEXP {name}_sexp"), - input_params = glue_collapse_data(args, "\tRcpp::traits::input_parameter<{type}>::type {name}({name}_sexp);", sep = "\n"), + input_params = glue_collapse_data(args, "\tarrow::r::Input<{type}>::type {name}({name}_sexp);", sep = "\n"), return_line = if(nrow(args)) "\n" else "" ) }) %>% @@ -111,10 +108,10 @@ cpp_functions_registration <- arrow_exports %>% writeLines(con = "src/arrowExports.cpp", glue::glue(' // Generated by using data-raw/codegen.R -> do not edit by hand -#include "./arrow_exports.h" -#include +#include +#include -using namespace Rcpp; +#include "./arrow_exports.h" {cpp_functions_definitions} @@ -145,7 +142,7 @@ static const R_CallMethodDef CallEntries[] = {{ \t\t{{NULL, NULL, 0}} }}; -RcppExport void R_init_arrow(DllInfo* dll){{ +extern "C" void R_init_arrow(DllInfo* dll){{ R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); R_useDynamicSymbols(dll, FALSE); }} diff --git a/r/inst/include/cpp11.hpp b/r/inst/include/cpp11.hpp new file mode 100644 index 00000000000..defa6c1b952 --- /dev/null +++ b/r/inst/include/cpp11.hpp @@ -0,0 +1,25 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include "cpp11/R.hpp" +#include "cpp11/altrep.hpp" +#include "cpp11/as.hpp" +#include "cpp11/attribute_proxy.hpp" +#include "cpp11/data_frame.hpp" +#include "cpp11/doubles.hpp" +#include "cpp11/environment.hpp" +#include "cpp11/external_pointer.hpp" +#include "cpp11/function.hpp" +#include "cpp11/integers.hpp" +#include "cpp11/list.hpp" +#include "cpp11/list_of.hpp" +#include "cpp11/logicals.hpp" +#include "cpp11/matrix.hpp" +#include "cpp11/named_arg.hpp" +#include "cpp11/protect.hpp" +#include "cpp11/r_string.hpp" +#include "cpp11/r_vector.hpp" +#include "cpp11/raws.hpp" +#include "cpp11/sexp.hpp" +#include "cpp11/strings.hpp" diff --git a/r/inst/include/cpp11/R.hpp b/r/inst/include/cpp11/R.hpp new file mode 100644 index 00000000000..16fd77fbd6b --- /dev/null +++ b/r/inst/include/cpp11/R.hpp @@ -0,0 +1,49 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include + +#include "R_ext/Arith.h" + +#undef FALSE +#undef TRUE +#undef NA_LOGICAL + +extern "C" { +typedef enum { + FALSE = 0, + TRUE = 1, + NA_LOGICAL = std::numeric_limits::min() +} Rboolean; +} + +#define R_EXT_BOOLEAN_H_ + +#define R_NO_REMAP +#define STRICT_R_HEADERS +#include "Rinternals.h" +#undef STRICT_R_HEADERS +#undef R_NO_REMAP + +// clang-format off +#ifdef __clang__ +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wattributes" +#endif + +#ifdef __GNUC__ +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wattributes" +#endif +// clang-format on + +#include "cpp11/altrep.hpp" + +namespace cpp11 { +namespace literals { + +constexpr R_xlen_t operator"" _xl(unsigned long long int value) { return value; } + +} // namespace literals +} // namespace cpp11 diff --git a/r/inst/include/cpp11/altrep.hpp b/r/inst/include/cpp11/altrep.hpp new file mode 100644 index 00000000000..99bc249d2fa --- /dev/null +++ b/r/inst/include/cpp11/altrep.hpp @@ -0,0 +1,44 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include "Rversion.h" + +#if defined(R_VERSION) && R_VERSION >= R_Version(3, 5, 0) +#define HAS_ALTREP +#endif + +#ifndef HAS_ALTREP + +#define ALTREP(x) false + +#define REAL_ELT(x, i) REAL(x)[i] +#define INTEGER_ELT(x, i) INTEGER(x)[i] +#define LOGICAL_ELT(x, i) LOGICAL(x)[i] +#define RAW_ELT(x, i) RAW(x)[i] + +#define SET_REAL_ELT(x, i, val) REAL(x)[i] = val +#define SET_INTEGER_ELT(x, i, val) INTEGER(x)[i] = val +#define SET_LOGICAL_ELT(x, i, val) LOGICAL(x)[i] = val +#define SET_RAW_ELT(x, i, val) RAW(x)[i] = val + +#define REAL_GET_REGION(...) \ + do { \ + } while (false) + +#define INTEGER_GET_REGION(...) \ + do { \ + } while (false) +#endif + +#if !defined HAS_ALTREP || (defined(R_VERSION) && R_VERSION < R_Version(3, 6, 0)) + +#define LOGICAL_GET_REGION(...) \ + do { \ + } while (false) + +#define RAW_GET_REGION(...) \ + do { \ + } while (false) + +#endif diff --git a/r/inst/include/cpp11/as.hpp b/r/inst/include/cpp11/as.hpp new file mode 100644 index 00000000000..b8934a3711f --- /dev/null +++ b/r/inst/include/cpp11/as.hpp @@ -0,0 +1,339 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for modf +#include // for initializer_list +#include // for std::shared_ptr, std::weak_ptr, std::unique_ptr +#include // for string, basic_string +#include // for decay, enable_if, is_same, is_convertible + +#include "cpp11/R.hpp" // for SEXP, SEXPREC, Rf_xlength, R_xlen_t +#include "cpp11/protect.hpp" // for stop, protect, safe, protect::function + +namespace cpp11 { + +template +using enable_if_t = typename std::enable_if::type; + +template +using decay_t = typename std::decay::type; + +template +struct is_smart_ptr : std::false_type {}; + +template +struct is_smart_ptr> : std::true_type {}; + +template +struct is_smart_ptr> : std::true_type {}; + +template +struct is_smart_ptr> : std::true_type {}; + +template +using enable_if_constructible_from_sexp = + enable_if_t< + !is_smart_ptr::value && // workaround for gcc 4.8 + std::is_class::value && std::is_constructible::value, + R + >; + +template +using enable_if_is_sexp = enable_if_t::value, R>; + +template +using enable_if_convertible_to_sexp = enable_if_t::value, R>; + +template +using disable_if_convertible_to_sexp = + enable_if_t::value, R>; + +template +using enable_if_integral = + enable_if_t::value && !std::is_same::value && + !std::is_same::value, + R>; + +template +using enable_if_floating_point = + typename std::enable_if::value, R>::type; + +template +using enable_if_enum = enable_if_t::value, R>; + +template +using enable_if_bool = enable_if_t::value, R>; + +template +using enable_if_char = enable_if_t::value, R>; + +template +using enable_if_std_string = enable_if_t::value, R>; + +template +using enable_if_c_string = enable_if_t::value, R>; + +// https://stackoverflow.com/a/1521682/2055486 +// +inline bool is_convertable_without_loss_to_integer(double value) { + double int_part; + return std::modf(value, &int_part) == 0.0; +} + +template +enable_if_constructible_from_sexp as_cpp(SEXP from) { + return T(from); +} + +template +enable_if_is_sexp as_cpp(SEXP from) { + return from; +} + +template +enable_if_integral as_cpp(SEXP from) { + if (Rf_isInteger(from)) { + if (Rf_xlength(from) == 1) { + return INTEGER_ELT(from, 0); + } + } else if (Rf_isReal(from)) { + if (Rf_xlength(from) == 1) { + if (ISNA(REAL_ELT(from, 0))) { + return NA_INTEGER; + } + double value = REAL_ELT(from, 0); + if (is_convertable_without_loss_to_integer(value)) { + return value; + } + } + } else if (Rf_isLogical(from)) { + if (Rf_xlength(from) == 1) { + if (LOGICAL_ELT(from, 0) == NA_LOGICAL) { + return NA_INTEGER; + } + } + } + + stop("Expected single integer value"); +} + +template +enable_if_enum as_cpp(SEXP from) { + if (Rf_isInteger(from)) { + using underlying_type = typename std::underlying_type::type; + using int_type = typename std::conditional::value, + int, // as_cpp would trigger + // undesired string conversions + underlying_type>::type; + return static_cast(as_cpp(from)); + } + + stop("Expected single integer value"); +} + +template +enable_if_bool as_cpp(SEXP from) { + if (Rf_isLogical(from)) { + if (Rf_xlength(from) == 1) { + return LOGICAL_ELT(from, 0) == 1; + } + } + + stop("Expected single logical value"); +} + +template +enable_if_floating_point as_cpp(SEXP from) { + if (Rf_isReal(from)) { + if (Rf_xlength(from) == 1) { + return REAL_ELT(from, 0); + } + } + // All 32 bit integers can be coerced to doubles, so we just convert them. + if (Rf_isInteger(from)) { + if (Rf_xlength(from) == 1) { + if (INTEGER_ELT(from, 0) == NA_INTEGER) { + return NA_REAL; + } + return INTEGER_ELT(from, 0); + } + } + + // Also allow NA values + if (Rf_isLogical(from)) { + if (Rf_xlength(from) == 1) { + if (LOGICAL_ELT(from, 0) == NA_LOGICAL) { + return NA_REAL; + } + } + } + + stop("Expected single double value"); +} + +template +enable_if_char as_cpp(SEXP from) { + if (Rf_isString(from)) { + if (Rf_xlength(from) == 1) { + return unwind_protect([&] { return Rf_translateCharUTF8(STRING_ELT(from, 0))[0]; }); + } + } + + stop("Expected string vector of length 1"); +} + +template +enable_if_c_string as_cpp(SEXP from) { + if (Rf_isString(from)) { + if (Rf_xlength(from) == 1) { + // TODO: use vmaxget / vmaxset here? + return {unwind_protect([&] { return Rf_translateCharUTF8(STRING_ELT(from, 0)); })}; + } + } + + stop("Expected string vector of length 1"); +} + +template +enable_if_std_string as_cpp(SEXP from) { + return {as_cpp(from)}; +} + +/// Temporary workaround for compatibility with cpp11 0.1.0 +template +enable_if_t, T>::value, decay_t> as_cpp(SEXP from) { + return as_cpp>(from); +} + +template +enable_if_integral as_sexp(T from) { + return safe[Rf_ScalarInteger](from); +} + +template +enable_if_floating_point as_sexp(T from) { + return safe[Rf_ScalarReal](from); +} + +template +enable_if_bool as_sexp(T from) { + return safe[Rf_ScalarLogical](from); +} + +template +enable_if_c_string as_sexp(T from) { + return unwind_protect([&] { return Rf_ScalarString(Rf_mkCharCE(from, CE_UTF8)); }); +} + +template +enable_if_std_string as_sexp(const T& from) { + return as_sexp(from.c_str()); +} + +template > +enable_if_integral as_sexp(const Container& from) { + R_xlen_t size = from.size(); + SEXP data = safe[Rf_allocVector](INTSXP, size); + + auto it = from.begin(); + int* data_p = INTEGER(data); + for (R_xlen_t i = 0; i < size; ++i, ++it) { + data_p[i] = *it; + } + return data; +} + +inline SEXP as_sexp(std::initializer_list from) { + return as_sexp>(from); +} + +template > +enable_if_floating_point as_sexp(const Container& from) { + R_xlen_t size = from.size(); + SEXP data = safe[Rf_allocVector](REALSXP, size); + + auto it = from.begin(); + double* data_p = REAL(data); + for (R_xlen_t i = 0; i < size; ++i, ++it) { + data_p[i] = *it; + } + return data; +} + +inline SEXP as_sexp(std::initializer_list from) { + return as_sexp>(from); +} + +template > +enable_if_bool as_sexp(const Container& from) { + R_xlen_t size = from.size(); + SEXP data = safe[Rf_allocVector](LGLSXP, size); + + auto it = from.begin(); + int* data_p = LOGICAL(data); + for (R_xlen_t i = 0; i < size; ++i, ++it) { + data_p[i] = *it; + } + return data; +} + +inline SEXP as_sexp(std::initializer_list from) { + return as_sexp>(from); +} + +namespace detail { +template +SEXP as_sexp_strings(const Container& from, AsCstring&& c_str) { + R_xlen_t size = from.size(); + + SEXP data; + try { + data = PROTECT(safe[Rf_allocVector](STRSXP, size)); + + auto it = from.begin(); + for (R_xlen_t i = 0; i < size; ++i, ++it) { + SET_STRING_ELT(data, i, safe[Rf_mkCharCE](c_str(*it), CE_UTF8)); + } + } catch (const unwind_exception& e) { + UNPROTECT(1); + throw e; + } + + UNPROTECT(1); + return data; +} +} // namespace detail + +class r_string; + +template +using disable_if_r_string = enable_if_t::value, R>; + +template > +enable_if_t::value && + !std::is_convertible::value, + SEXP> +as_sexp(const Container& from) { + return detail::as_sexp_strings(from, [](const std::string& s) { return s.c_str(); }); +} + +template +enable_if_c_string as_sexp(const Container& from) { + return detail::as_sexp_strings(from, [](const char* s) { return s; }); +} + +inline SEXP as_sexp(std::initializer_list from) { + return as_sexp>(from); +} + +template > +enable_if_convertible_to_sexp as_sexp(const T& from) { + return from; +} + +} // namespace cpp11 diff --git a/r/inst/include/cpp11/attribute_proxy.hpp b/r/inst/include/cpp11/attribute_proxy.hpp new file mode 100644 index 00000000000..4c6f3b16ccb --- /dev/null +++ b/r/inst/include/cpp11/attribute_proxy.hpp @@ -0,0 +1,50 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for initializer_list +#include // for string, basic_string + +#include "cpp11/R.hpp" // for SEXP, SEXPREC, Rf_install, PROTECT, Rf_... +#include "cpp11/as.hpp" // for as_sexp +#include "cpp11/protect.hpp" // for protect, safe, protect::function + +namespace cpp11 { + +class sexp; + +template +class attribute_proxy { + private: + const T& parent_; + SEXP symbol_; + + public: + attribute_proxy(const T& parent, const char* index) + : parent_(parent), symbol_(safe[Rf_install](index)) {} + + attribute_proxy(const T& parent, const std::string& index) + : parent_(parent), symbol_(safe[Rf_install](index.c_str())) {} + + attribute_proxy(const T& parent, SEXP index) : parent_(parent), symbol_(index) {} + + template + attribute_proxy& operator=(C rhs) { + SEXP value = PROTECT(as_sexp(rhs)); + Rf_setAttrib(parent_.data(), symbol_, value); + UNPROTECT(1); + return *this; + } + + template + attribute_proxy& operator=(std::initializer_list rhs) { + SEXP value = PROTECT(as_sexp(rhs)); + Rf_setAttrib(parent_.data(), symbol_, value); + UNPROTECT(1); + return *this; + } + + operator SEXP() const { return safe[Rf_getAttrib](parent_.data(), symbol_); } +}; + +} // namespace cpp11 diff --git a/r/inst/include/cpp11/data_frame.hpp b/r/inst/include/cpp11/data_frame.hpp new file mode 100644 index 00000000000..a5317ebda37 --- /dev/null +++ b/r/inst/include/cpp11/data_frame.hpp @@ -0,0 +1,102 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for abs +#include +#include // for initializer_list +#include // for string, basic_string +#include // for move + +#include "R_ext/Arith.h" // for NA_INTEGER +#include "cpp11/R.hpp" // for Rf_xlength, SEXP, SEXPREC, INTEGER +#include "cpp11/attribute_proxy.hpp" // for attribute_proxy +#include "cpp11/list.hpp" // for list, r_vector<>::r_vector, r_v... +#include "cpp11/r_vector.hpp" // for r_vector + +namespace cpp11 { + +class named_arg; +namespace writable { +class data_frame; +} // namespace writable + +class data_frame : public list { + using list::list; + + friend class writable::data_frame; + + /* we cannot use Rf_getAttrib because it has a special case for c(NA, -n) and creates + * the full vector */ + static SEXP get_attrib0(SEXP x, SEXP sym) { + for (SEXP attr = ATTRIB(x); attr != R_NilValue; attr = CDR(attr)) { + if (TAG(attr) == sym) { + return CAR(attr); + } + } + + return R_NilValue; + } + + static int calc_nrow(SEXP x) { + auto nms = get_attrib0(x, R_RowNamesSymbol); + bool has_short_rownames = + (Rf_isInteger(nms) && Rf_xlength(nms) == 2 && INTEGER(nms)[0] == NA_INTEGER); + if (has_short_rownames) { + return abs(INTEGER(nms)[1]); + } + + if (!Rf_isNull(nms)) { + return Rf_xlength(nms); + } + + if (Rf_xlength(x) == 0) { + return 0; + } + + return Rf_xlength(VECTOR_ELT(x, 0)); + } + + public: + /* Adapted from + * https://github.com/wch/r-source/blob/f2a0dfab3e26fb42b8b296fcba40cbdbdbec767d/src/main/attrib.c#L198-L207 + */ + R_xlen_t nrow() const { return calc_nrow(*this); } + R_xlen_t ncol() const { return size(); } +}; + +namespace writable { +class data_frame : public cpp11::data_frame { + private: + writable::list set_data_frame_attributes(writable::list&& x) { + x.attr(R_RowNamesSymbol) = {NA_INTEGER, -static_cast(calc_nrow(x))}; + x.attr(R_ClassSymbol) = "data.frame"; + return std::move(x); + } + + public: + data_frame(const SEXP data) : cpp11::data_frame(set_data_frame_attributes(data)) {} + data_frame(const SEXP data, bool is_altrep) + : cpp11::data_frame(set_data_frame_attributes(data), is_altrep) {} + data_frame(std::initializer_list il) + : cpp11::data_frame(set_data_frame_attributes(writable::list(il))) {} + data_frame(std::initializer_list il) + : cpp11::data_frame(set_data_frame_attributes(writable::list(il))) {} + + using cpp11::data_frame::ncol; + using cpp11::data_frame::nrow; + + attribute_proxy attr(const char* name) const { return {*this, name}; } + + attribute_proxy attr(const std::string& name) const { + return {*this, name.c_str()}; + } + + attribute_proxy attr(SEXP name) const { return {*this, name}; } + + attribute_proxy names() const { return {*this, R_NamesSymbol}; } +}; + +} // namespace writable + +} // namespace cpp11 diff --git a/r/inst/include/cpp11/declarations.hpp b/r/inst/include/cpp11/declarations.hpp new file mode 100644 index 00000000000..9d2190c90e9 --- /dev/null +++ b/r/inst/include/cpp11/declarations.hpp @@ -0,0 +1,53 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include +#include +#include + +#ifndef CPP11_PARTIAL +#include "cpp11.hpp" +using namespace cpp11; +namespace writable = cpp11::writable; +#endif + +#include + +namespace cpp11 { +template +T& unmove(T&& t) { + return t; +} +} // namespace cpp11 + +#ifdef HAS_UNWIND_PROTECT +#define CPP11_UNWIND R_ContinueUnwind(err); +#else +#define CPP11_UNWIND \ + do { \ + } while (false); +#endif + +#define BEGIN_CPP11 \ + SEXP err = R_NilValue; \ + const size_t ERROR_SIZE = 8192; \ + char buf[ERROR_SIZE] = ""; \ + try { +#define END_CPP11 \ + } \ + catch (cpp11::unwind_exception & e) { \ + err = e.token; \ + } \ + catch (std::exception & e) { \ + strncpy(buf, e.what(), ERROR_SIZE - 1); \ + } \ + catch (...) { \ + strncpy(buf, "C++ error (unknown cause)", ERROR_SIZE - 1); \ + } \ + if (buf[0] != '\0') { \ + Rf_error("%s", buf); \ + } else if (err != R_NilValue) { \ + CPP11_UNWIND \ + } \ + return R_NilValue; diff --git a/r/inst/include/cpp11/doubles.hpp b/r/inst/include/cpp11/doubles.hpp new file mode 100644 index 00000000000..5f2f7f447e8 --- /dev/null +++ b/r/inst/include/cpp11/doubles.hpp @@ -0,0 +1,136 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for min +#include // for array +#include // for initializer_list + +#include "R_ext/Arith.h" // for ISNA +#include "cpp11/R.hpp" // for SEXP, SEXPREC, Rf_allocVector, REAL +#include "cpp11/as.hpp" // for as_sexp +#include "cpp11/named_arg.hpp" // for named_arg +#include "cpp11/protect.hpp" // for SEXP, SEXPREC, REAL_ELT, R_Preserve... +#include "cpp11/r_vector.hpp" // for vector, vector<>::proxy, vector<>::... +#include "cpp11/sexp.hpp" // for sexp +// Specializations for doubles + +namespace cpp11 { + +template <> +inline SEXP r_vector::valid_type(SEXP data) { + if (TYPEOF(data) != REALSXP) { + throw type_error(REALSXP, TYPEOF(data)); + } + return data; +} + +template <> +inline double r_vector::operator[](const R_xlen_t pos) const { + // NOPROTECT: likely too costly to unwind protect every elt + return is_altrep_ ? REAL_ELT(data_, pos) : data_p_[pos]; +} + +template <> +inline double* r_vector::get_p(bool is_altrep, SEXP data) { + if (is_altrep) { + return nullptr; + } else { + return REAL(data); + } +} + +template <> +inline void r_vector::const_iterator::fill_buf(R_xlen_t pos) { + length_ = std::min(64_xl, data_->size() - pos); + REAL_GET_REGION(data_->data_, pos, length_, buf_.data()); + block_start_ = pos; +} + +typedef r_vector doubles; + +namespace writable { + +template <> +inline typename r_vector::proxy& r_vector::proxy::operator=( + const double& rhs) { + if (is_altrep_) { + // NOPROTECT: likely too costly to unwind protect every set elt + SET_REAL_ELT(data_, index_, rhs); + } else { + *p_ = rhs; + } + return *this; +} + +template <> +inline r_vector::proxy::operator double() const { + if (p_ == nullptr) { + // NOPROTECT: likely too costly to unwind protect every elt + return REAL_ELT(data_, index_); + } else { + return *p_; + } +} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(as_sexp(il)), capacity_(il.size()) {} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(safe[Rf_allocVector](REALSXP, il.size())), + capacity_(il.size()) { + protect_ = protect_sexp(data_); + int n_protected = 0; + + try { + unwind_protect([&] { + Rf_setAttrib(data_, R_NamesSymbol, Rf_allocVector(STRSXP, capacity_)); + SEXP names = PROTECT(Rf_getAttrib(data_, R_NamesSymbol)); + ++n_protected; + auto it = il.begin(); + for (R_xlen_t i = 0; i < capacity_; ++i, ++it) { + data_p_[i] = REAL_ELT(it->value(), 0); + SET_STRING_ELT(names, i, Rf_mkCharCE(it->name(), CE_UTF8)); + } + UNPROTECT(n_protected); + }); + } catch (const unwind_exception& e) { + release_protect(protect_); + UNPROTECT(n_protected); + throw e; + } +} + +template <> +inline void r_vector::reserve(R_xlen_t new_capacity) { + data_ = data_ == R_NilValue ? safe[Rf_allocVector](REALSXP, new_capacity) + : safe[Rf_xlengthgets](data_, new_capacity); + SEXP old_protect = protect_; + protect_ = protect_sexp(data_); + release_protect(old_protect); + + data_p_ = REAL(data_); + capacity_ = new_capacity; +} + +template <> +inline void r_vector::push_back(double value) { + while (length_ >= capacity_) { + reserve(capacity_ == 0 ? 1 : capacity_ *= 2); + } + if (is_altrep_) { + SET_REAL_ELT(data_, length_, value); + } else { + data_p_[length_] = value; + } + ++length_; +} + +typedef r_vector doubles; + +} // namespace writable + +inline bool is_na(double x) { return ISNA(x); } +} // namespace cpp11 diff --git a/r/inst/include/cpp11/environment.hpp b/r/inst/include/cpp11/environment.hpp new file mode 100644 index 00000000000..ec6ab6e9d56 --- /dev/null +++ b/r/inst/include/cpp11/environment.hpp @@ -0,0 +1,75 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for string, basic_string + +#include "Rversion.h" // for R_VERSION, R_Version +#include "cpp11/R.hpp" // for SEXP, SEXPREC, Rf_install, Rf_findVarIn... +#include "cpp11/as.hpp" // for as_sexp +#include "cpp11/protect.hpp" // for protect, protect::function, safe, unwin... +#include "cpp11/sexp.hpp" // for sexp + +#if R_VERSION >= R_Version(4, 0, 0) +#define HAS_REMOVE_VAR_FROM_FRAME +#endif + +#ifndef HAS_REMOVE_VAR_FROM_FRAME +#include "cpp11/function.hpp" +#endif + +namespace cpp11 { + +class environment { + private: + sexp env_; + + class proxy { + SEXP parent_; + SEXP name_; + + public: + proxy(SEXP parent, SEXP name) : parent_(parent), name_(name) {} + + template + proxy& operator=(T value) { + safe[Rf_defineVar](name_, as_sexp(value), parent_); + return *this; + } + operator SEXP() const { return safe[Rf_findVarInFrame3](parent_, name_, TRUE); }; + operator sexp() const { return SEXP(); }; + }; + + public: + environment(SEXP env) : env_(env) {} + proxy operator[](SEXP name) const { return {env_, name}; } + proxy operator[](const char* name) const { return operator[](safe[Rf_install](name)); } + proxy operator[](const std::string& name) const { return operator[](name.c_str()); } + + bool exists(SEXP name) const { + SEXP res = safe[Rf_findVarInFrame3](env_, name, FALSE); + return res != R_UnboundValue; + } + bool exists(const char* name) const { return exists(safe[Rf_install](name)); } + + bool exists(const std::string& name) const { return exists(name.c_str()); } + + void remove(SEXP name) { + PROTECT(name); +#ifdef HAS_REMOVE_VAR_FROM_FRAME + R_removeVarFromFrame(name, env_); +#else + auto remove = package("base")["remove"]; + remove(name, "envir"_nm = env_); +#endif + UNPROTECT(1); + } + + void remove(const char* name) { remove(safe[Rf_install](name)); } + + R_xlen_t size() const { return Rf_xlength(env_); } + + operator SEXP() const { return env_; } +}; + +} // namespace cpp11 diff --git a/r/inst/include/cpp11/external_pointer.hpp b/r/inst/include/cpp11/external_pointer.hpp new file mode 100644 index 00000000000..ab8f11a6770 --- /dev/null +++ b/r/inst/include/cpp11/external_pointer.hpp @@ -0,0 +1,165 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for nullptr_t, NULL +#include // for bad_weak_ptr +#include // for add_lvalue_reference + +#include "cpp11/R.hpp" // for SEXP, SEXPREC, TYPEOF, R_NilValue, R_C... +#include "cpp11/protect.hpp" // for protect, safe, protect::function +#include "cpp11/r_vector.hpp" // for type_error +#include "cpp11/sexp.hpp" // for sexp + +namespace cpp11 { + +template +void default_deleter(T* obj) { + delete obj; +} + +template > +class external_pointer { + private: + sexp data_ = R_NilValue; + + static SEXP valid_type(SEXP data) { + if (TYPEOF(data) != EXTPTRSXP) { + throw type_error(EXTPTRSXP, TYPEOF(data)); + } + + return data; + } + + static void r_deleter(SEXP p) { + if (TYPEOF(p) != EXTPTRSXP) return; + + T* ptr = static_cast(R_ExternalPtrAddr(p)); + + if (ptr == NULL) { + return; + } + + R_ClearExternalPtr(p); + + Deleter(ptr); + } + + public: + using pointer = T*; + + external_pointer() noexcept {} + external_pointer(std::nullptr_t) noexcept {} + + external_pointer(SEXP data) : data_(valid_type(data)) {} + + external_pointer(pointer p, bool use_deleter = true, bool finalize_on_exit = true) + : data_(safe[R_MakeExternalPtr]((void*)p, R_NilValue, R_NilValue)) { + if (use_deleter) { + R_RegisterCFinalizerEx(data_, r_deleter, static_cast(finalize_on_exit)); + } + } + + external_pointer(const external_pointer& rhs) { + data_ = safe[Rf_shallow_duplicate](rhs.data_); + } + + external_pointer(external_pointer&& rhs) { reset(rhs.release()); } + + external_pointer& operator=(external_pointer&& rhs) noexcept { reset(rhs.release()); } + + external_pointer& operator=(std::nullptr_t) noexcept { reset(); }; + + operator SEXP() const noexcept { return data_; } + + pointer get() const noexcept { + pointer addr = static_cast(R_ExternalPtrAddr(data_)); + if (addr == nullptr) { + return nullptr; + } + return addr; + } + + typename std::add_lvalue_reference::type operator*() { + pointer addr = get(); + if (addr == nullptr) { + throw std::bad_weak_ptr(); + } + return *get(); + } + + pointer operator->() const { + pointer addr = get(); + if (addr == nullptr) { + throw std::bad_weak_ptr(); + } + return get(); + } + + pointer release() noexcept { + if (get() == nullptr) { + return nullptr; + } + pointer ptr = get(); + R_ClearExternalPtr(data_); + + return ptr; + } + + void reset(pointer ptr = pointer()) { + SEXP old_data = data_; + data_ = safe[R_MakeExternalPtr]((void*)ptr, R_NilValue, R_NilValue); + r_deleter(old_data); + } + + void swap(external_pointer& other) noexcept { + SEXP tmp = other.data_; + other.data_ = data_; + data_ = tmp; + } + + operator bool() noexcept { return data_ != nullptr; } +}; + +template +void swap(external_pointer& lhs, external_pointer& rhs) noexcept { + lhs.swap(rhs); +} + +template +bool operator==(const external_pointer& x, + const external_pointer& y) { + return x.data_ == y.data_; +} + +template +bool operator!=(const external_pointer& x, + const external_pointer& y) { + return x.data_ != y.data_; +} + +template +bool operator<(const external_pointer& x, + const external_pointer& y) { + return x.data_ < y.data_; +} + +template +bool operator<=(const external_pointer& x, + const external_pointer& y) { + return x.data_ <= y.data_; +} + +template +bool operator>(const external_pointer& x, + const external_pointer& y) { + return x.data_ > y.data_; +} + +template +bool operator>=(const external_pointer& x, + const external_pointer& y) { + return x.data_ >= y.data_; +} + +} // namespace cpp11 diff --git a/r/inst/include/cpp11/function.hpp b/r/inst/include/cpp11/function.hpp new file mode 100644 index 00000000000..b0951cb87dc --- /dev/null +++ b/r/inst/include/cpp11/function.hpp @@ -0,0 +1,78 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for strcmp + +#include // for string, basic_string +#include // for forward + +#include "cpp11/R.hpp" // for SEXP, SEXPREC, CDR, Rf_install, SETCAR +#include "cpp11/as.hpp" // for as_sexp +#include "cpp11/named_arg.hpp" // for named_arg +#include "cpp11/protect.hpp" // for protect, protect::function, safe +#include "cpp11/sexp.hpp" // for sexp + +namespace cpp11 { + +class function { + public: + function(SEXP data) : data_(data) {} + + template + sexp operator()(Args&&... args) const { + // Size of the arguments plus one for the function name itself + R_xlen_t num_args = sizeof...(args) + 1; + + sexp call(safe[Rf_allocVector](LANGSXP, num_args)); + + construct_call(call, data_, std::forward(args)...); + + return safe[Rf_eval](call, R_GlobalEnv); + } + + private: + SEXP data_; + + template + SEXP construct_call(SEXP val, const named_arg& arg, Args&&... args) const { + SETCAR(val, arg.value()); + SET_TAG(val, safe[Rf_install](arg.name())); + val = CDR(val); + return construct_call(val, std::forward(args)...); + } + + // Construct the call recursively, each iteration adds an Arg to the pairlist. + // We need + template + SEXP construct_call(SEXP val, const T& arg, Args&&... args) const { + SETCAR(val, as_sexp(arg)); + val = CDR(val); + return construct_call(val, std::forward(args)...); + } + + // Base case, just return + SEXP construct_call(SEXP val) const { return val; } +}; + +class package { + public: + package(const char* name) : data_(get_namespace(name)) {} + package(const std::string& name) : data_(get_namespace(name.c_str())) {} + function operator[](const char* name) { + return safe[Rf_findFun](safe[Rf_install](name), data_); + } + function operator[](const std::string& name) { return operator[](name.c_str()); } + + private: + static SEXP get_namespace(const char* name) { + if (strcmp(name, "base") == 0) { + return R_BaseEnv; + } + sexp name_sexp = safe[Rf_install](name); + return safe[Rf_findVarInFrame](R_NamespaceRegistry, name_sexp); + } + + SEXP data_; +}; +} // namespace cpp11 diff --git a/r/inst/include/cpp11/integers.hpp b/r/inst/include/cpp11/integers.hpp new file mode 100644 index 00000000000..fc6b63d05e4 --- /dev/null +++ b/r/inst/include/cpp11/integers.hpp @@ -0,0 +1,142 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for min +#include // for array +#include // for initializer_list + +#include "R_ext/Arith.h" // for NA_INTEGER +#include "cpp11/R.hpp" // for SEXP, SEXPREC, Rf_allocVector +#include "cpp11/as.hpp" // for as_sexp +#include "cpp11/attribute_proxy.hpp" // for attribute_proxy +#include "cpp11/named_arg.hpp" // for named_arg +#include "cpp11/protect.hpp" // for protect_sexp, release_protect +#include "cpp11/r_vector.hpp" // for r_vector, r_vector<>::proxy +#include "cpp11/sexp.hpp" // for sexp + +// Specializations for integers + +namespace cpp11 { + +template <> +inline SEXP r_vector::valid_type(SEXP data) { + if (TYPEOF(data) != INTSXP) { + throw type_error(INTSXP, TYPEOF(data)); + } + return data; +} + +template <> +inline int r_vector::operator[](const R_xlen_t pos) const { + // NOPROTECT: likely too costly to unwind protect every elt + return is_altrep_ ? INTEGER_ELT(data_, pos) : data_p_[pos]; +} + +template <> +inline int* r_vector::get_p(bool is_altrep, SEXP data) { + if (is_altrep) { + return nullptr; + } else { + return INTEGER(data); + } +} + +template <> +inline void r_vector::const_iterator::fill_buf(R_xlen_t pos) { + length_ = std::min(64_xl, data_->size() - pos); + unwind_protect([&] { INTEGER_GET_REGION(data_->data_, pos, length_, buf_.data()); }); + block_start_ = pos; +} + +typedef r_vector integers; + +namespace writable { + +template <> +inline typename r_vector::proxy& r_vector::proxy::operator=(const int& rhs) { + if (is_altrep_) { + // NOPROTECT: likely too costly to unwind protect every set elt + SET_INTEGER_ELT(data_, index_, rhs); + } else { + *p_ = rhs; + } + return *this; +} + +template <> +inline r_vector::proxy::operator int() const { + if (p_ == nullptr) { + // NOPROTECT: likely too costly to unwind protect every elt + return INTEGER_ELT(data_, index_); + } else { + return *p_; + } +} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(as_sexp(il)), capacity_(il.size()) {} + +template <> +inline void r_vector::reserve(R_xlen_t new_capacity) { + data_ = data_ == R_NilValue ? safe[Rf_allocVector](INTSXP, new_capacity) + : safe[Rf_xlengthgets](data_, new_capacity); + SEXP old_protect = protect_; + + // Protect the new data + protect_ = protect_sexp(data_); + + // Release the old protection; + release_protect(old_protect); + + data_p_ = INTEGER(data_); + capacity_ = new_capacity; +} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(safe[Rf_allocVector](INTSXP, il.size())), + capacity_(il.size()) { + protect_ = protect_sexp(data_); + int n_protected = 0; + + try { + unwind_protect([&] { + Rf_setAttrib(data_, R_NamesSymbol, Rf_allocVector(STRSXP, capacity_)); + SEXP names = PROTECT(Rf_getAttrib(data_, R_NamesSymbol)); + ++n_protected; + auto it = il.begin(); + for (R_xlen_t i = 0; i < capacity_; ++i, ++it) { + data_p_[i] = INTEGER_ELT(it->value(), 0); + SET_STRING_ELT(names, i, Rf_mkCharCE(it->name(), CE_UTF8)); + } + UNPROTECT(n_protected); + }); + } catch (const unwind_exception& e) { + release_protect(protect_); + UNPROTECT(n_protected); + throw e; + } +} + +template <> +inline void r_vector::push_back(int value) { + while (length_ >= capacity_) { + reserve(capacity_ == 0 ? 1 : capacity_ *= 2); + } + if (is_altrep_) { + // NOPROTECT: likely too costly to unwind protect every elt + SET_INTEGER_ELT(data_, length_, value); + } else { + data_p_[length_] = value; + } + ++length_; +} + +typedef r_vector integers; + +} // namespace writable + +inline bool is_na(int x) { return x == NA_INTEGER; } +} // namespace cpp11 diff --git a/r/inst/include/cpp11/list.hpp b/r/inst/include/cpp11/list.hpp new file mode 100644 index 00000000000..5500f7779b6 --- /dev/null +++ b/r/inst/include/cpp11/list.hpp @@ -0,0 +1,138 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for initializer_list + +#include "cpp11/R.hpp" // for SEXP, SEXPREC, SET_VECTOR_ELT +#include "cpp11/attribute_proxy.hpp" // for attribute_proxy +#include "cpp11/named_arg.hpp" // for named_arg +#include "cpp11/protect.hpp" // for protect_sexp, release_protect +#include "cpp11/r_string.hpp" // for r_string +#include "cpp11/r_vector.hpp" // for r_vector, r_vector<>::proxy +#include "cpp11/sexp.hpp" // for sexp + +// Specializations for list + +namespace cpp11 { + +template <> +inline SEXP r_vector::valid_type(SEXP data) { + if (TYPEOF(data) != VECSXP) { + throw type_error(VECSXP, TYPEOF(data)); + } + return data; +} + +template <> +inline SEXP r_vector::operator[](const R_xlen_t pos) const { + return VECTOR_ELT(data_, pos); +} + +template <> +inline SEXP r_vector::operator[](const r_string& name) const { + SEXP names = this->names(); + R_xlen_t size = Rf_xlength(names); + + for (R_xlen_t pos = 0; pos < size; ++pos) { + auto cur = Rf_translateCharUTF8(STRING_ELT(names, pos)); + if (name == cur) { + return operator[](pos); + } + } + return R_NilValue; +} + +template <> +inline SEXP* r_vector::get_p(bool, SEXP) { + return nullptr; +} + +template <> +inline void r_vector::const_iterator::fill_buf(R_xlen_t) { + return; +} + +template <> +inline SEXP r_vector::const_iterator::operator*() { + return VECTOR_ELT(data_->data(), pos_); +} + +typedef r_vector list; + +namespace writable { + +template <> +inline typename r_vector::proxy& r_vector::proxy::operator=(const SEXP& rhs) { + SET_VECTOR_ELT(data_, index_, rhs); + return *this; +} + +template <> +inline r_vector::proxy::operator SEXP() const { + return VECTOR_ELT(data_, index_); +} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(safe[Rf_allocVector](VECSXP, il.size())), + capacity_(il.size()) { + protect_ = protect_sexp(data_); + auto it = il.begin(); + for (R_xlen_t i = 0; i < capacity_; ++i, ++it) { + SET_VECTOR_ELT(data_, i, *it); + } +} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(safe[Rf_allocVector](VECSXP, il.size())), + capacity_(il.size()) { + protect_ = protect_sexp(data_); + int n_protected = 0; + + try { + unwind_protect([&] { + Rf_setAttrib(data_, R_NamesSymbol, Rf_allocVector(STRSXP, capacity_)); + SEXP names = PROTECT(Rf_getAttrib(data_, R_NamesSymbol)); + ++n_protected; + auto it = il.begin(); + for (R_xlen_t i = 0; i < capacity_; ++i, ++it) { + SET_VECTOR_ELT(data_, i, it->value()); + SET_STRING_ELT(names, i, Rf_mkCharCE(it->name(), CE_UTF8)); + } + UNPROTECT(n_protected); + }); + } catch (const unwind_exception& e) { + release_protect(protect_); + UNPROTECT(n_protected); + throw e; + } +} + +template <> +inline void r_vector::reserve(R_xlen_t new_capacity) { + data_ = data_ == R_NilValue ? safe[Rf_allocVector](VECSXP, new_capacity) + : safe[Rf_xlengthgets](data_, new_capacity); + + SEXP old_protect = protect_; + protect_ = protect_sexp(data_); + release_protect(old_protect); + + capacity_ = new_capacity; +} + +template <> +inline void r_vector::push_back(SEXP value) { + while (length_ >= capacity_) { + reserve(capacity_ == 0 ? 1 : capacity_ *= 2); + } + SET_VECTOR_ELT(data_, length_, value); + ++length_; +} + +typedef r_vector list; + +} // namespace writable + +} // namespace cpp11 diff --git a/r/inst/include/cpp11/list_of.hpp b/r/inst/include/cpp11/list_of.hpp new file mode 100644 index 00000000000..5f77a9345cb --- /dev/null +++ b/r/inst/include/cpp11/list_of.hpp @@ -0,0 +1,53 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for string, basic_string + +#include "cpp11/R.hpp" // for R_xlen_t, SEXP, SEXPREC, LONG_VECTOR_SUPPORT +#include "cpp11/list.hpp" // for list + +namespace cpp11 { + +template +class list_of : public list { + public: + list_of(const list& data) : list(data) {} + +#ifdef LONG_VECTOR_SUPPORT + T operator[](int pos) { return operator[](static_cast(pos)); } +#endif + + T operator[](R_xlen_t pos) { return list::operator[](pos); } + + T operator[](const char* pos) { return list::operator[](pos); } + + T operator[](const std::string& pos) { return list::operator[](pos.c_str()); } +}; + +namespace writable { +template +class list_of : public writable::list { + public: + list_of(const list& data) : writable::list(data) {} + list_of(R_xlen_t n) : writable::list(n) {} + +#ifdef LONG_VECTOR_SUPPORT + T operator[](int pos) { return operator[](static_cast(pos)); } +#endif + + T operator[](R_xlen_t pos) { + return static_cast(writable::list::operator[](pos)); + } + + T operator[](const char* pos) { + return static_cast(writable::list::operator[](pos)); + } + + T operator[](const std::string& pos) { + return static_cast(writable::list::operator[](pos.c_str())); + } +}; +} // namespace writable + +} // namespace cpp11 diff --git a/r/inst/include/cpp11/logicals.hpp b/r/inst/include/cpp11/logicals.hpp new file mode 100644 index 00000000000..85fbde51d6b --- /dev/null +++ b/r/inst/include/cpp11/logicals.hpp @@ -0,0 +1,140 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for min +#include // for array +#include // for initializer_list + +#include "cpp11/R.hpp" // for Rboolean, SEXP, SEXPREC, Rf_all... +#include "cpp11/attribute_proxy.hpp" // for attribute_proxy +#include "cpp11/named_arg.hpp" // for named_arg +#include "cpp11/protect.hpp" // for protect_sexp, release_protect +#include "cpp11/r_vector.hpp" // for r_vector, r_vector<>::proxy +#include "cpp11/sexp.hpp" // for sexp + +// Specializations for logicals + +namespace cpp11 { + +template <> +inline SEXP r_vector::valid_type(SEXP data) { + if (TYPEOF(data) != LGLSXP) { + throw type_error(LGLSXP, TYPEOF(data)); + } + return data; +} + +template <> +inline Rboolean r_vector::operator[](const R_xlen_t pos) const { + return is_altrep_ ? static_cast(LOGICAL_ELT(data_, pos)) : data_p_[pos]; +} + +template <> +inline Rboolean* r_vector::get_p(bool is_altrep, SEXP data) { + if (is_altrep) { + return nullptr; + } else { + return reinterpret_cast(LOGICAL(data)); + } +} + +template <> +inline void r_vector::const_iterator::fill_buf(R_xlen_t pos) { + length_ = std::min(64_xl, data_->size() - pos); + LOGICAL_GET_REGION(data_->data_, pos, length_, reinterpret_cast(buf_.data())); + block_start_ = pos; +} + +typedef r_vector logicals; + +namespace writable { + +template <> +inline typename r_vector::proxy& r_vector::proxy::operator=( + const Rboolean& rhs) { + if (is_altrep_) { + SET_LOGICAL_ELT(data_, index_, rhs); + } else { + *p_ = rhs; + } + return *this; +} + +template <> +inline r_vector::proxy::operator Rboolean() const { + if (p_ == nullptr) { + return static_cast(LOGICAL_ELT(data_, index_)); + } else { + return *p_; + } +} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(Rf_allocVector(LGLSXP, il.size())), capacity_(il.size()) { + protect_ = protect_sexp(data_); + auto it = il.begin(); + for (R_xlen_t i = 0; i < capacity_; ++i, ++it) { + SET_LOGICAL_ELT(data_, i, *it); + } +} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(safe[Rf_allocVector](LGLSXP, il.size())), + capacity_(il.size()) { + protect_ = protect_sexp(data_); + int n_protected = 0; + + try { + unwind_protect([&] { + Rf_setAttrib(data_, R_NamesSymbol, Rf_allocVector(STRSXP, capacity_)); + SEXP names = PROTECT(Rf_getAttrib(data_, R_NamesSymbol)); + ++n_protected; + auto it = il.begin(); + for (R_xlen_t i = 0; i < capacity_; ++i, ++it) { + data_p_[i] = static_cast(LOGICAL_ELT(it->value(), 0)); + SET_STRING_ELT(names, i, Rf_mkCharCE(it->name(), CE_UTF8)); + } + UNPROTECT(n_protected); + }); + } catch (const unwind_exception& e) { + release_protect(protect_); + UNPROTECT(n_protected); + throw e; + } +} + +template <> +inline void r_vector::reserve(R_xlen_t new_capacity) { + data_ = data_ == R_NilValue ? safe[Rf_allocVector](LGLSXP, new_capacity) + : safe[Rf_xlengthgets](data_, new_capacity); + SEXP old_protect = protect_; + protect_ = protect_sexp(data_); + + release_protect(old_protect); + + data_p_ = reinterpret_cast(LOGICAL(data_)); + capacity_ = new_capacity; +} + +template <> +inline void r_vector::push_back(Rboolean value) { + while (length_ >= capacity_) { + reserve(capacity_ == 0 ? 1 : capacity_ *= 2); + } + if (is_altrep_) { + SET_LOGICAL_ELT(data_, length_, value); + } else { + data_p_[length_] = value; + } + ++length_; +} + +typedef r_vector logicals; + +} // namespace writable + +inline bool is_na(Rboolean x) { return x == NA_LOGICAL; } +} // namespace cpp11 diff --git a/r/inst/include/cpp11/matrix.hpp b/r/inst/include/cpp11/matrix.hpp new file mode 100644 index 00000000000..0a99943ec8e --- /dev/null +++ b/r/inst/include/cpp11/matrix.hpp @@ -0,0 +1,111 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for string + +#include "cpp11/R.hpp" // for SEXP, SEXPREC, R_xlen_t, Rboolean, INT... +#include "cpp11/r_string.hpp" // for r_string +#include "cpp11/r_vector.hpp" // for r_vector +#include "cpp11/sexp.hpp" // for sexp + +namespace cpp11 { +template +class matrix { + private: + V vector_; + int nrow_; + + public: + class row { + private: + matrix& parent_; + int row_; + + public: + row(matrix& parent, R_xlen_t row) : parent_(parent), row_(row) {} + T operator[](const int pos) { return parent_.vector_[row_ + (pos * parent_.nrow_)]; } + + class iterator { + private: + row& row_; + int pos_; + + public: + iterator(row& row, R_xlen_t pos) : row_(row), pos_(pos) {} + iterator begin() const { return row_.parent_.vector_iterator(&this, 0); } + iterator end() const { return iterator(&this, row_.size()); } + inline iterator& operator++() { + ++pos_; + return *this; + } + bool operator!=(const iterator& rhs) { + return !(pos_ == rhs.pos_ && row_.row_ == rhs.row_.row_); + } + T operator*() const { return row_[pos_]; }; + }; + + iterator begin() { return iterator(*this, 0); } + iterator end() { return iterator(*this, size()); } + R_xlen_t size() const { return parent_.vector_.size() / parent_.nrow_; } + bool operator!=(const row& rhs) { return row_ != rhs.row_; } + row& operator++() { + ++row_; + return *this; + } + row& operator*() { return *this; } + }; + friend row; + + public: + matrix(SEXP data) : vector_(data), nrow_(INTEGER_ELT(vector_.attr("dim"), 0)) {} + + template + matrix(const cpp11::matrix& rhs) : vector_(rhs), nrow_(rhs.nrow()) {} + + matrix(int nrow, int ncol) : vector_(R_xlen_t(nrow * ncol)), nrow_(nrow) { + vector_.attr("dim") = {nrow, ncol}; + } + + int nrow() const { return nrow_; } + + int ncol() const { return size() / nrow_; } + + SEXP data() const { return vector_.data(); } + + R_xlen_t size() const { return vector_.size(); } + + operator SEXP() const { return SEXP(vector_); } + + // operator sexp() { return sexp(vector_); } + + sexp attr(const char* name) const { return SEXP(vector_.attr(name)); } + + sexp attr(const std::string& name) const { return SEXP(vector_.attr(name)); } + + sexp attr(SEXP name) const { return SEXP(vector_.attr(name)); } + + r_vector names() const { return SEXP(vector_.names()); } + + row operator[](const int pos) { return {*this, pos}; } + + T operator()(int row, int col) { return vector_[row + (col * nrow_)]; } + + row begin() { return {*this, 0}; } + row end() { return {*this, nrow_}; } +}; + +using doubles_matrix = matrix, double>; +using integers_matrix = matrix, int>; +using logicals_matrix = matrix, Rboolean>; +using strings_matrix = matrix, r_string>; + +namespace writable { +using doubles_matrix = matrix, r_vector::proxy>; +using integers_matrix = matrix, r_vector::proxy>; +using logicals_matrix = matrix, r_vector::proxy>; +using strings_matrix = matrix, r_vector::proxy>; +} // namespace writable + +// TODO: Add tests for Matrix class +} // namespace cpp11 diff --git a/r/inst/include/cpp11/named_arg.hpp b/r/inst/include/cpp11/named_arg.hpp new file mode 100644 index 00000000000..fd6b4c13785 --- /dev/null +++ b/r/inst/include/cpp11/named_arg.hpp @@ -0,0 +1,51 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for size_t + +#include // for initializer_list + +#include "cpp11/R.hpp" // for SEXP, SEXPREC, literals +#include "cpp11/as.hpp" // for as_sexp + +namespace cpp11 { +class named_arg { + public: + constexpr explicit named_arg(const char* name) : name_(name), value_(nullptr) {} + named_arg& operator=(std::initializer_list il) { + value_ = as_sexp(il); + return *this; + } + + template + named_arg& operator=(T rhs) { + value_ = as_sexp(rhs); + return *this; + } + + template + named_arg& operator=(std::initializer_list rhs) { + value_ = as_sexp(rhs); + return *this; + } + + const char* name() const { return name_; } + SEXP value() const { return value_; } + + private: + const char* name_; + SEXP value_; +}; + +namespace literals { + +constexpr named_arg operator"" _nm(const char* name, std::size_t) { + return named_arg(name); +} + +} // namespace literals + +using namespace literals; + +} // namespace cpp11 diff --git a/r/inst/include/cpp11/protect.hpp b/r/inst/include/cpp11/protect.hpp new file mode 100644 index 00000000000..21a18a8e347 --- /dev/null +++ b/r/inst/include/cpp11/protect.hpp @@ -0,0 +1,286 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for longjmp, setjmp, jmp_buf +#include // for exception +#include // for std::runtime_error +#include // for string, basic_string +#include // for tuple, make_tuple + +// NB: cpp11/R.hpp must precede R_ext includes so our definition of Rboolean is used +#include "cpp11/R.hpp" // for SEXP, SEXPREC, CDR, R_NilValue, CAR, R_Pres... + +#include "R_ext/Error.h" // for Rf_error, Rf_warning +#include "R_ext/Print.h" // for REprintf +#include "R_ext/Utils.h" // for R_CheckUserInterrupt +#include "Rversion.h" // for R_VERSION, R_Version + +#if defined(R_VERSION) && R_VERSION >= R_Version(3, 5, 0) +#define HAS_UNWIND_PROTECT +#endif + +namespace cpp11 { +class unwind_exception : public std::exception { + public: + SEXP token; + unwind_exception(SEXP token_) : token(token_) {} +}; + +static SEXP preserve(SEXP obj) { + PROTECT(obj); + R_PreserveObject(obj); + UNPROTECT(1); + return obj; +} + +static SEXP protect_list = preserve(Rf_cons(R_NilValue, R_NilValue)); + +inline SEXP protect_sexp(SEXP obj) { + if (obj == R_NilValue) { + return R_NilValue; + } +#ifdef CPP11_USE_PRESERVE_OBJECT + R_PreserveObject(obj); + return obj; +#endif + PROTECT(obj); + + // Add a new cell that points to the previous end. + SEXP cell = PROTECT(Rf_cons(protect_list, CDR(protect_list))); + SET_TAG(cell, obj); + + SETCDR(protect_list, cell); + if (CDR(cell) != R_NilValue) { + SETCAR(CDR(cell), cell); + } + + UNPROTECT(2); + + return cell; +} + +inline void print_protect() { + SEXP head = protect_list; + while (head != R_NilValue) { + REprintf("%x CAR: %x CDR: %x TAG: %x\n", head, CAR(head), CDR(head), TAG(head)); + head = CDR(head); + } + REprintf("---\n"); +} + +/* This is currently unused, but client packages could use it to free leaked resources in + * older R versions if needed */ +inline void release_existing_protections() { +#if !defined(CPP11_USE_PRESERVE_OBJECT) + SEXP first = CDR(protect_list); + if (first != R_NilValue) { + SETCAR(first, R_NilValue); + SETCDR(protect_list, R_NilValue); + } +#endif +} + +inline void release_protect(SEXP protect) { + if (protect == R_NilValue) { + return; + } +#ifdef CPP11_USE_PRESERVE_OBJECT + R_ReleaseObject(protect); + return; +#endif + + SEXP before = CAR(protect); + SEXP after = CDR(protect); + + if (before == R_NilValue && after == R_NilValue) { + Rf_error("should never happen"); + } + + SETCDR(before, after); + if (after != R_NilValue) { + SETCAR(after, before); + } +} + +#ifdef HAS_UNWIND_PROTECT + +/// Unwind Protection from C longjmp's, like those used in R error handling +/// +/// @param code The code to which needs to be protected, as a nullary callable +template ()()), SEXP>::value>::type> +SEXP unwind_protect(Fun&& code) { + static SEXP token = [] { + SEXP res = R_MakeUnwindCont(); + R_PreserveObject(res); + return res; + }(); + + std::jmp_buf jmpbuf; + if (setjmp(jmpbuf)) { + throw unwind_exception(token); + } + + return R_UnwindProtect( + [](void* data) -> SEXP { + auto callback = static_cast(data); + return static_cast(*callback)(); + }, + &code, + [](void* jmpbuf, Rboolean jump) { + if (jump) { + // We need to first jump back into the C++ stacks because you can't safely throw + // exceptions from C stack frames. + longjmp(*static_cast(jmpbuf), 1); + } + }, + &jmpbuf, token); +} + +template ()()), void>::value>::type> +void unwind_protect(Fun&& code) { + (void)unwind_protect([&] { + std::forward(code)(); + return R_NilValue; + }); +} + +template ()())> +typename std::enable_if::value && !std::is_same::value, + R>::type +unwind_protect(Fun&& code) { + R out; + (void)unwind_protect([&] { + out = std::forward(code)(); + return R_NilValue; + }); + return out; +} + +#else +// Don't do anything if we don't have unwind protect. This will leak C++ resources, +// including those held by cpp11 objects, but the other alternatives are also not great. +template +decltype(std::declval()()) unwind_protect(Fun&& code) { + return std::forward(code)(); +} +#endif + +namespace detail { + +template +struct index_sequence { + using type = index_sequence; +}; + +template +struct appended_sequence; + +template +struct appended_sequence, J> : index_sequence {}; + +template +struct make_index_sequence + : appended_sequence::type, N - 1> {}; + +template <> +struct make_index_sequence<0> : index_sequence<> {}; + +template +decltype(std::declval()(std::declval()...)) apply( + F&& f, std::tuple&& a, const index_sequence&) { + return std::forward(f)(std::get(std::move(a))...); +} + +template +decltype(std::declval()(std::declval()...)) apply(F&& f, + std::tuple&& a) { + return apply(std::forward(f), std::move(a), make_index_sequence{}); +} + +// overload to silence a compiler warning that the (empty) tuple parameter is set but +// unused +template +decltype(std::declval()()) apply(F&& f, std::tuple<>&&) { + return std::forward(f)(); +} + +template +struct closure { + decltype(std::declval()(std::declval()...)) operator()() && { + return apply(ptr_, std::move(arefs_)); + } + F* ptr_; + std::tuple arefs_; +}; + +} // namespace detail + +struct protect { + template + struct function { + template + decltype(std::declval()(std::declval()...)) operator()(A&&... a) const { + // workaround to support gcc4.8, which can't capture a parameter pack + return unwind_protect( + detail::closure{ptr_, std::forward_as_tuple(std::forward(a)...)}); + } + + F* ptr_; + }; + + /// May not be applied to a function bearing attributes, which interfere with linkage on + /// some compilers; use an appropriately attributed alternative. (For example, Rf_error + /// bears the [[noreturn]] attribute and must be protected with safe.noreturn rather + /// than safe.operator[]). + template + constexpr function operator[](F* raw) const { + return {raw}; + } + + template + struct noreturn_function { + template + void operator() [[noreturn]] (A&&... a) const { + // workaround to support gcc4.8, which can't capture a parameter pack + unwind_protect( + detail::closure{ptr_, std::forward_as_tuple(std::forward(a)...)}); + // Compiler hint to allow [[noreturn]] attribute; this is never executed since + // the above call will not return. + throw std::runtime_error("[[noreturn]]"); + } + F* ptr_; + }; + + template + constexpr noreturn_function noreturn(F* raw) const { + return {raw}; + } +}; +constexpr struct protect safe = {}; + +inline void check_user_interrupt() { safe[R_CheckUserInterrupt](); } + +template +void stop [[noreturn]] (const char* fmt, Args... args) { + safe.noreturn(Rf_error)(fmt, args...); +} + +template +void stop [[noreturn]] (const std::string& fmt, Args... args) { + safe.noreturn(Rf_error)(fmt.c_str(), args...); +} + +template +void warning(const char* fmt, Args... args) { + safe[Rf_warning](fmt, args...); +} + +template +void warning(const std::string& fmt, Args... args) { + safe[Rf_warning](fmt.c_str(), args...); +} + +} // namespace cpp11 diff --git a/r/inst/include/cpp11/r_string.hpp b/r/inst/include/cpp11/r_string.hpp new file mode 100644 index 00000000000..954976ddc07 --- /dev/null +++ b/r/inst/include/cpp11/r_string.hpp @@ -0,0 +1,92 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for string, basic_string, operator== +#include // for is_convertible, enable_if + +#include "R_ext/Memory.h" // for vmaxget, vmaxset +#include "cpp11/R.hpp" // for SEXP, SEXPREC, Rf_mkCharCE, Rf_translat... +#include "cpp11/as.hpp" // for as_sexp +#include "cpp11/protect.hpp" // for unwind_protect, protect, protect::function +#include "cpp11/sexp.hpp" // for sexp +namespace cpp11 { + +class r_string { + public: + r_string() = default; + r_string(SEXP data) : data_(data) {} + r_string(const char* data) : data_(safe[Rf_mkCharCE](data, CE_UTF8)) {} + r_string(const std::string& data) : data_(safe[Rf_mkCharCE](data.c_str(), CE_UTF8)) {} + + operator SEXP() const { return data_; } + operator sexp() const { return data_; } + operator std::string() const { + std::string res; + res.reserve(size()); + + void* vmax = vmaxget(); + unwind_protect([&] { res.assign(Rf_translateCharUTF8(data_)); }); + vmaxset(vmax); + + return res; + } + + bool operator==(const r_string& rhs) const { return data_.data() == rhs.data_.data(); } + + bool operator==(const SEXP rhs) const { return data_.data() == rhs; } + + bool operator==(const char* rhs) const { + return static_cast(*this) == rhs; + } + + bool operator==(const std::string& rhs) const { + return static_cast(*this) == rhs; + } + + R_xlen_t size() const { return Rf_xlength(data_); } + + private: + sexp data_ = R_NilValue; +}; + +inline SEXP as_sexp(std::initializer_list il) { + R_xlen_t size = il.size(); + + sexp data; + unwind_protect([&] { + data = Rf_allocVector(STRSXP, size); + auto it = il.begin(); + for (R_xlen_t i = 0; i < size; ++i, ++it) { + if (*it == NA_STRING) { + SET_STRING_ELT(data, i, *it); + } else { + SET_STRING_ELT(data, i, Rf_mkCharCE(Rf_translateCharUTF8(*it), CE_UTF8)); + } + } + }); + return data; +} + +inline bool is_na(const r_string& x) { return x == NA_STRING; } + +template +using enable_if_r_string = enable_if_t::value, R>; + +template +enable_if_r_string as_sexp(T from) { + r_string str(from); + sexp res; + unwind_protect([&] { + res = Rf_allocVector(STRSXP, 1); + + if (str == NA_STRING) { + SET_STRING_ELT(res, 0, str); + } else { + SET_STRING_ELT(res, 0, Rf_mkCharCE(Rf_translateCharUTF8(str), CE_UTF8)); + } + }); + + return res; +} +} // namespace cpp11 diff --git a/r/inst/include/cpp11/r_vector.hpp b/r/inst/include/cpp11/r_vector.hpp new file mode 100644 index 00000000000..7ac480d0d72 --- /dev/null +++ b/r/inst/include/cpp11/r_vector.hpp @@ -0,0 +1,986 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for ptrdiff_t, size_t + +#include // for max +#include // for array +#include // for snprintf +#include // for exception +#include // for initializer_list +#include // for forward_iterator_tag, random_ac... +#include // for out_of_range +#include // for string, basic_string +#include // for decay, is_same, enable_if, is_c... +#include // for declval + +#include "cpp11/R.hpp" // for R_xlen_t, SEXP, SEXPREC, Rf_xle... +#include "cpp11/attribute_proxy.hpp" // for attribute_proxy +#include "cpp11/protect.hpp" // for protect_sexp, release_protect +#include "cpp11/r_string.hpp" // for r_string +#include "cpp11/sexp.hpp" // for sexp + +namespace cpp11 { + +using namespace cpp11::literals; + +class type_error : public std::exception { + public: + type_error(int expected, int actual) : expected_(expected), actual_(actual) {} + virtual const char* what() const noexcept { + snprintf(str_, 64, "Invalid input type, expected '%s' actual '%s'", + Rf_type2char(expected_), Rf_type2char(actual_)); + return str_; + } + + private: + int expected_; + int actual_; + mutable char str_[64]; +}; + +// Forward Declarations +class named_arg; + +namespace writable { +template +class r_vector; +} // namespace writable + +// Declarations +template +class r_vector { + public: + typedef ptrdiff_t difference_type; + typedef size_t size_type; + typedef T value_type; + typedef T* pointer; + typedef T& reference; + + r_vector() = default; + + r_vector(SEXP data); + + r_vector(SEXP data, bool is_altrep); + +#ifdef LONG_VECTOR_SUPPORT + T operator[](const int pos) const; + T at(const int pos) const; +#endif + T operator[](const R_xlen_t pos) const; + T operator[](const size_type pos) const; + T operator[](const r_string& name) const; + + T at(const R_xlen_t pos) const; + T at(const size_type pos) const; + T at(const r_string& name) const; + + bool contains(const r_string& name) const; + + r_vector& operator=(const r_vector& rhs) { + SEXP old_protect = protect_; + + data_ = rhs.data_; + protect_ = protect_sexp(data_); + is_altrep_ = rhs.is_altrep_; + data_p_ = rhs.data_p_; + length_ = rhs.length_; + + release_protect(old_protect); + + return *this; + }; + + r_vector(const r_vector& rhs) { + SEXP old_protect = protect_; + + data_ = rhs.data_; + protect_ = protect_sexp(data_); + is_altrep_ = rhs.is_altrep_; + data_p_ = rhs.data_p_; + length_ = rhs.length_; + + release_protect(old_protect); + }; + + bool is_altrep() const; + + R_xlen_t size() const; + + operator SEXP() const; + + operator sexp() const; + + /// Provide access to the underlying data, mainly for interface + /// compatibility with std::vector + SEXP data() const; + + sexp attr(const char* name) const { + return SEXP(attribute_proxy>(*this, name)); + } + + sexp attr(const std::string& name) const { + return SEXP(attribute_proxy>(*this, name.c_str())); + } + + sexp attr(SEXP name) const { return SEXP(attribute_proxy>(*this, name)); } + + r_vector names() const { + SEXP nms = SEXP(attribute_proxy>(*this, R_NamesSymbol)); + if (nms == R_NilValue) { + return r_vector(); + } + + return nms; + } + + class const_iterator { + public: + using difference_type = ptrdiff_t; + using value_type = T; + using pointer = T*; + using reference = T&; + using iterator_category = std::random_access_iterator_tag; + + const_iterator(const r_vector* data, R_xlen_t pos); + + inline const_iterator& operator+(R_xlen_t pos); + inline ptrdiff_t operator-(const const_iterator& other) const; + + inline const_iterator& operator++(); + inline const_iterator& operator--(); + + inline const_iterator& operator+=(R_xlen_t pos); + inline const_iterator& operator-=(R_xlen_t pos); + + inline bool operator!=(const const_iterator& other) const; + inline bool operator==(const const_iterator& other) const; + + inline T operator*(); + + friend class writable::r_vector::iterator; + + private: + const r_vector* data_; + void fill_buf(R_xlen_t pos); + + R_xlen_t pos_; + std::array buf_; + R_xlen_t block_start_ = 0; + R_xlen_t length_ = 0; + }; + + public: + const_iterator begin() const; + const_iterator end() const; + + const_iterator cbegin() const; + const_iterator cend() const; + + const_iterator find(const r_string& name) const; + + ~r_vector() { release_protect(protect_); } + + private: + SEXP data_ = R_NilValue; + SEXP protect_ = R_NilValue; + bool is_altrep_ = false; + T* data_p_ = nullptr; + R_xlen_t length_ = 0; + + static T* get_p(bool is_altrep, SEXP data); + + static SEXP valid_type(SEXP data); + + friend class writable::r_vector; +}; + +namespace writable { + +template +using has_begin_fun = std::decay()))>; + +/// Read/write access to new or copied r_vectors +template +class r_vector : public cpp11::r_vector { + private: + SEXP protect_ = R_NilValue; + + // These are necessary because type names are not directly accessible in + // template inheritance + using cpp11::r_vector::data_; + using cpp11::r_vector::data_p_; + using cpp11::r_vector::is_altrep_; + using cpp11::r_vector::length_; + + R_xlen_t capacity_ = 0; + + public: + class proxy { + private: + const SEXP data_; + const R_xlen_t index_; + T* const p_; + bool is_altrep_; + + public: + proxy(SEXP data, const R_xlen_t index, T* const p, bool is_altrep); + + proxy& operator=(const T& rhs); + proxy& operator+=(const T& rhs); + proxy& operator-=(const T& rhs); + proxy& operator*=(const T& rhs); + proxy& operator/=(const T& rhs); + proxy& operator++(int); + proxy& operator--(int); + + void operator++(); + void operator--(); + + operator T() const; + }; + + typedef ptrdiff_t difference_type; + typedef size_t size_type; + typedef proxy value_type; + typedef proxy* pointer; + typedef proxy& reference; + + class iterator : public cpp11::r_vector::const_iterator { + private: + const r_vector& data_; + using cpp11::r_vector::const_iterator::block_start_; + using cpp11::r_vector::const_iterator::pos_; + using cpp11::r_vector::const_iterator::buf_; + using cpp11::r_vector::const_iterator::length_; + using cpp11::r_vector::const_iterator::fill_buf; + + public: + using difference_type = ptrdiff_t; + using value_type = proxy; + using pointer = proxy*; + using reference = proxy&; + using iterator_category = std::forward_iterator_tag; + + iterator(const r_vector& data, R_xlen_t pos); + + inline iterator& operator++(); + + inline proxy operator*(); + + using cpp11::r_vector::const_iterator::operator!=; + + inline iterator& operator+(R_xlen_t rhs); + }; + + r_vector() = default; + r_vector(const SEXP& data); + r_vector(SEXP&& data); + r_vector(const SEXP& data, bool is_altrep); + r_vector(SEXP&& data, bool is_altrep); + r_vector(std::initializer_list il); + r_vector(std::initializer_list il); + r_vector(std::initializer_list il); + r_vector(std::initializer_list il); + + template + r_vector(Iter first, Iter last); + + template > + r_vector(const V& obj); + + r_vector(const R_xlen_t size); + + ~r_vector(); + + r_vector(const r_vector& rhs); + r_vector(r_vector&& rhs); + + r_vector(const cpp11::r_vector& rhs); + + r_vector& operator=(const r_vector& rhs); + r_vector& operator=(r_vector&& rhs); + +#ifdef LONG_VECTOR_SUPPORT + proxy operator[](const int pos) const; + proxy at(const int pos) const; +#endif + proxy operator[](const R_xlen_t pos) const; + proxy operator[](const size_type pos) const; + proxy operator[](const r_string& name) const; + + proxy at(const R_xlen_t pos) const; + proxy at(const size_type pos) const; + proxy at(const r_string& name) const; + + void push_back(T value); + void push_back(const named_arg& value); + void pop_back(); + + void resize(R_xlen_t count); + + void reserve(R_xlen_t new_capacity); + + iterator insert(R_xlen_t pos, T value); + iterator erase(R_xlen_t pos); + + void clear(); + + iterator begin() const; + iterator end() const; + + using cpp11::r_vector::cbegin; + using cpp11::r_vector::cend; + using cpp11::r_vector::size; + + iterator find(const r_string& name) const; + + attribute_proxy> attr(const char* name) const { + return attribute_proxy>(*this, name); + } + + attribute_proxy> attr(const std::string& name) const { + return attribute_proxy>(*this, name.c_str()); + } + + attribute_proxy> attr(SEXP name) const { + return attribute_proxy>(*this, name); + } + + attribute_proxy> names() const { + return attribute_proxy>(*this, R_NamesSymbol); + } + + operator SEXP() const; +}; +} // namespace writable + +// Implementations below + +template +inline r_vector::r_vector(const SEXP data) + : data_(valid_type(data)), + protect_(protect_sexp(data)), + is_altrep_(ALTREP(data)), + data_p_(get_p(ALTREP(data), data)), + length_(Rf_xlength(data)) {} + +template +inline r_vector::r_vector(const SEXP data, bool is_altrep) + : data_(valid_type(data)), + protect_(protect_sexp(data)), + is_altrep_(is_altrep), + data_p_(get_p(is_altrep, data)), + length_(Rf_xlength(data)) {} + +template +inline bool r_vector::is_altrep() const { + return is_altrep_; +} + +template +inline R_xlen_t r_vector::size() const { + return length_; +} + +template +inline r_vector::operator SEXP() const { + return data_; +} + +template +inline r_vector::operator sexp() const { + return data_; +} + +/// Provide access to the underlying data, mainly for interface +/// compatibility with std::vector +template +inline SEXP r_vector::data() const { + return data_; +} + +template +inline typename r_vector::const_iterator r_vector::begin() const { + return const_iterator(this, 0); +} + +template +inline typename r_vector::const_iterator r_vector::end() const { + return const_iterator(this, length_); +} + +template +inline typename r_vector::const_iterator r_vector::cbegin() const { + return const_iterator(this, 0); +} + +template +inline typename r_vector::const_iterator r_vector::cend() const { + return const_iterator(this, length_); +} + +template +r_vector::const_iterator::const_iterator(const r_vector* data, R_xlen_t pos) + : data_(data), pos_(pos), buf_() { + if (data_->is_altrep()) { + fill_buf(pos); + } +} + +template +inline typename r_vector::const_iterator& r_vector::const_iterator::operator++() { + ++pos_; + if (data_->is_altrep() && pos_ >= block_start_ + length_) { + fill_buf(pos_); + } + return *this; +} + +template +inline typename r_vector::const_iterator& r_vector::const_iterator::operator--() { + --pos_; + if (data_->is_altrep() && pos_ > 0 && pos_ < block_start_) { + fill_buf(std::max(0_xl, pos_ - 64)); + } + return *this; +} + +template +inline typename r_vector::const_iterator& r_vector::const_iterator::operator+=( + R_xlen_t i) { + pos_ += i; + if (data_->is_altrep() && pos_ >= block_start_ + length_) { + fill_buf(pos_); + } + return *this; +} + +template +inline typename r_vector::const_iterator& r_vector::const_iterator::operator-=( + R_xlen_t i) { + pos_ -= i; + if (data_->is_altrep() && pos_ >= block_start_ + length_) { + fill_buf(std::max(0_xl, pos_ - 64)); + } + return *this; +} + +template +inline bool r_vector::const_iterator::operator!=( + const r_vector::const_iterator& other) const { + return pos_ != other.pos_; +} + +template +inline bool r_vector::const_iterator::operator==( + const r_vector::const_iterator& other) const { + return pos_ == other.pos_; +} + +template +inline ptrdiff_t r_vector::const_iterator::operator-( + const r_vector::const_iterator& other) const { + return pos_ - other.pos_; +} + +template +inline typename r_vector::const_iterator& r_vector::const_iterator::operator+( + R_xlen_t rhs) { + pos_ += rhs; + if (data_->is_altrep() && pos_ >= block_start_ + length_) { + fill_buf(pos_); + } + return *this; +} + +template +inline T cpp11::r_vector::at(R_xlen_t pos) const { + if (pos < 0 || pos >= length_) { + throw std::out_of_range("r_vector"); + } + + return operator[](pos); +} + +template +inline T cpp11::r_vector::at(size_type pos) const { + return at(static_cast(pos)); +} + +template +inline T cpp11::r_vector::operator[](const r_string& name) const { + SEXP names = this->names(); + R_xlen_t size = Rf_xlength(names); + + for (R_xlen_t pos = 0; pos < size; ++pos) { + auto cur = Rf_translateCharUTF8(STRING_ELT(names, pos)); + if (name == cur) { + return operator[](pos); + } + } + + throw std::out_of_range("r_vector"); +} + +template +inline bool cpp11::r_vector::contains(const r_string& name) const { + SEXP names = this->names(); + R_xlen_t size = Rf_xlength(names); + + for (R_xlen_t pos = 0; pos < size; ++pos) { + auto cur = Rf_translateCharUTF8(STRING_ELT(names, pos)); + if (name == cur) { + return true; + } + } + + return false; +} + +template +inline typename cpp11::r_vector::const_iterator cpp11::r_vector::find( + const r_string& name) const { + SEXP names = this->names(); + R_xlen_t size = Rf_xlength(names); + + for (R_xlen_t pos = 0; pos < size; ++pos) { + auto cur = Rf_translateCharUTF8(STRING_ELT(names, pos)); + if (name == cur) { + return begin() + pos; + } + } + + return end(); +} + +template +inline T r_vector::const_iterator::operator*() { + if (data_->is_altrep()) { + return buf_[pos_ - block_start_]; + } else { + return data_->data_p_[pos_]; + } +} + +#ifdef LONG_VECTOR_SUPPORT +template +inline T r_vector::operator[](const int pos) const { + return operator[](static_cast(pos)); +} + +template +inline T r_vector::at(const int pos) const { + return at(static_cast(pos)); +} +#endif + +template +inline T r_vector::operator[](size_type pos) const { + return operator[](static_cast(pos)); +} + +namespace writable { + +template +r_vector::proxy::proxy(SEXP data, const R_xlen_t index, T* const p, bool is_altrep) + : data_(data), index_(index), p_(p), is_altrep_(is_altrep) {} + +template +inline typename r_vector::proxy r_vector::iterator::operator*() { + if (data_.is_altrep()) { + return proxy(data_.data(), pos_, &buf_[pos_ - block_start_], true); + } else { + return proxy(data_.data(), pos_, + data_.data_p_ != nullptr ? &data_.data_p_[pos_] : nullptr, false); + } +} + +template +r_vector::iterator::iterator(const r_vector& data, R_xlen_t pos) + : r_vector::const_iterator(&data, pos), data_(data) {} + +template +inline typename r_vector::iterator& r_vector::iterator::operator++() { + ++pos_; + if (data_.is_altrep() && pos_ >= block_start_ + length_) { + fill_buf(pos_); + } + return *this; +} + +template +inline typename r_vector::iterator& r_vector::iterator::operator+(R_xlen_t rhs) { + pos_ += rhs; + if (data_.is_altrep() && pos_ >= block_start_ + length_) { + fill_buf(pos_); + } + return *this; +} + +template +inline typename r_vector::iterator r_vector::begin() const { + return iterator(*this, 0); +} + +template +inline typename r_vector::iterator r_vector::end() const { + return iterator(*this, length_); +} + +template +inline r_vector::r_vector(const SEXP& data) + : cpp11::r_vector(safe[Rf_shallow_duplicate](data)), + protect_(protect_sexp(data_)), + capacity_(length_) {} + +template +inline r_vector::r_vector(const SEXP& data, bool is_altrep) + : cpp11::r_vector(safe[Rf_shallow_duplicate](data), is_altrep), + protect_(protect_sexp(data_)), + capacity_(length_) {} + +template +inline r_vector::r_vector(SEXP&& data) + : cpp11::r_vector(data), protect_(protect_sexp(data_)), capacity_(length_) {} + +template +inline r_vector::r_vector(SEXP&& data, bool is_altrep) + : cpp11::r_vector(data, is_altrep), + protect_(protect_sexp(data_)), + capacity_(length_) {} + +template +template +inline r_vector::r_vector(Iter first, Iter last) : r_vector() { + reserve(last - first); + while (first != last) { + push_back(*first); + ++first; + } +} + +template +template +inline r_vector::r_vector(const V& obj) : r_vector() { + auto first = obj.begin(); + auto last = obj.end(); + reserve(last - first); + while (first != last) { + push_back(*first); + ++first; + } +} + +template +inline r_vector::r_vector(R_xlen_t size) : r_vector() { + resize(size); +} + +template +inline r_vector::~r_vector() { + release_protect(protect_); +} + +#ifdef LONG_VECTOR_SUPPORT +template +inline typename r_vector::proxy r_vector::operator[](const int pos) const { + return operator[](static_cast(pos)); +} + +template +inline typename r_vector::proxy r_vector::at(const int pos) const { + return at(static_cast(pos)); +} +#endif + +template +inline typename r_vector::proxy r_vector::operator[](const R_xlen_t pos) const { + if (is_altrep_) { + return {data_, pos, nullptr, true}; + } + return {data_, pos, data_p_ != nullptr ? &data_p_[pos] : nullptr, false}; +} + +template +inline typename r_vector::proxy r_vector::operator[](size_type pos) const { + return operator[](static_cast(pos)); +} + +template +inline typename r_vector::proxy r_vector::at(const R_xlen_t pos) const { + if (pos < 0 || pos >= length_) { + throw std::out_of_range("r_vector"); + } + return operator[](static_cast(pos)); +} + +template +inline typename r_vector::proxy r_vector::at(size_type pos) const { + return at(static_cast(pos)); +} + +template +inline typename r_vector::proxy r_vector::operator[](const r_string& name) const { + SEXP names = PROTECT(this->names()); + R_xlen_t size = Rf_xlength(names); + + for (R_xlen_t pos = 0; pos < size; ++pos) { + auto cur = Rf_translateCharUTF8(STRING_ELT(names, pos)); + if (name == cur) { + UNPROTECT(1); + return operator[](pos); + } + } + + UNPROTECT(1); + throw std::out_of_range("r_vector"); +} + +template +inline typename r_vector::proxy r_vector::at(const r_string& name) const { + return operator[](name); +} + +template +inline typename r_vector::iterator r_vector::find(const r_string& name) const { + SEXP names = PROTECT(this->names()); + R_xlen_t size = Rf_xlength(names); + + for (R_xlen_t pos = 0; pos < size; ++pos) { + auto cur = Rf_translateCharUTF8(STRING_ELT(names, pos)); + if (name == cur) { + UNPROTECT(1); + return begin() + pos; + } + } + + UNPROTECT(1); + return end(); +} + +template +inline r_vector::r_vector(const r_vector& rhs) + : cpp11::r_vector(safe[Rf_shallow_duplicate](rhs)), + protect_(protect_sexp(data_)), + capacity_(rhs.capacity_) {} + +template +inline r_vector::r_vector(r_vector&& rhs) + : cpp11::r_vector(rhs), protect_(protect_sexp(data_)), capacity_(rhs.capacity_) { + rhs.data_ = R_NilValue; + rhs.protect_ = R_NilValue; +} + +template +inline r_vector::r_vector(const cpp11::r_vector& rhs) + : cpp11::r_vector(safe[Rf_shallow_duplicate](rhs)), + protect_(protect_sexp(data_)), + capacity_(rhs.length_) {} + +// We don't release the old object until the end in case we throw an exception +// during the duplicate. +template +inline r_vector& r_vector::operator=(const r_vector& rhs) { + if (data_ == rhs.data_) { + return *this; + } + + cpp11::r_vector::operator=(rhs); + + auto old_protect = protect_; + + data_ = safe[Rf_shallow_duplicate](rhs.data_); + protect_ = protect_sexp(data_); + + release_protect(old_protect); + + capacity_ = rhs.capacity_; + + return *this; +} + +template +inline r_vector& r_vector::operator=(r_vector&& rhs) { + if (data_ == rhs.data_) { + return *this; + } + + cpp11::r_vector::operator=(rhs); + + SEXP old_protect = protect_; + + data_ = rhs.data_; + protect_ = protect_sexp(data_); + + release_protect(old_protect); + + capacity_ = rhs.capacity_; + + rhs.data_ = R_NilValue; + rhs.protect_ = R_NilValue; + + return *this; +} + +template +inline void r_vector::pop_back() { + --length_; +} + +template +inline void r_vector::resize(R_xlen_t count) { + reserve(count); + length_ = count; +} + +template +inline typename r_vector::iterator r_vector::insert(R_xlen_t pos, T value) { + push_back(value); + + R_xlen_t i = length_ - 1; + while (i > pos) { + operator[](i) = (T) operator[](i - 1); + --i; + }; + operator[](pos) = value; + + return begin() + pos; +} + +template +inline typename r_vector::iterator r_vector::erase(R_xlen_t pos) { + R_xlen_t i = pos; + while (i < length_ - 1) { + operator[](i) = (T) operator[](i + 1); + ++i; + } + pop_back(); + + return begin() + pos; +} + +template +inline void r_vector::clear() { + length_ = 0; +} + +template +inline r_vector::operator SEXP() const { + if (length_ < capacity_) { + SETLENGTH(data_, length_); + } + return data_; +} + +template +inline typename r_vector::proxy& r_vector::proxy::operator+=(const T& rhs) { + operator=(static_cast(*this) + rhs); + return *this; +} + +template +inline typename r_vector::proxy& r_vector::proxy::operator-=(const T& rhs) { + operator=(static_cast(*this) - rhs); + return *this; +} + +template +inline typename r_vector::proxy& r_vector::proxy::operator*=(const T& rhs) { + operator=(static_cast(*this) * rhs); + return *this; +} + +template +inline typename r_vector::proxy& r_vector::proxy::operator/=(const T& rhs) { + operator=(static_cast(*this) / rhs); + return *this; +} + +template +inline typename r_vector::proxy& r_vector::proxy::operator++(int) { + operator=(static_cast(*this) + 1); + return *this; +} + +template +inline typename r_vector::proxy& r_vector::proxy::operator--(int) { + operator=(static_cast(*this) - 1); + return *this; +} + +template +inline void r_vector::proxy::operator--() { + operator=(static_cast(*this) - 1); +} + +template +inline void r_vector::proxy::operator++() { + operator=(static_cast(*this) + 1); +} + +} // namespace writable + +// TODO: is there a better condition we could use, e.g. assert something true +// rather than three things false? +template +using is_container_but_not_sexp_or_string = typename std::enable_if< + !std::is_constructible::value && + !std::is_same::type, std::string>::value && + !std::is_same::type, std::string>::value, + typename std::decay::type>::type; + +template ::type::value_type> +// typename T = typename C::value_type> +is_container_but_not_sexp_or_string as_cpp(SEXP from) { + auto obj = cpp11::r_vector(from); + return {obj.begin(), obj.end()}; +} + +// TODO: could we make this generalize outside of std::string? +template +using is_vector_of_strings = typename std::enable_if< + std::is_same::type, std::string>::value, + typename std::decay::type>::type; + +template ::type::value_type> +// typename T = typename C::value_type> +is_vector_of_strings as_cpp(SEXP from) { + auto obj = cpp11::r_vector(from); + typename std::decay::type res; + auto it = obj.begin(); + while (it != obj.end()) { + r_string s = *it; + res.emplace_back(static_cast(s)); + ++it; + } + return res; +} + +template +bool operator==(const r_vector& lhs, const r_vector& rhs) { + if (lhs.size() != rhs.size()) { + return false; + } + + auto lhs_it = lhs.begin(); + auto rhs_it = rhs.begin(); + + auto end = lhs.end(); + while (lhs_it != end) { + if (!(*lhs_it == *rhs_it)) { + return false; + } + ++lhs_it; + ++rhs_it; + } + return true; +} + +template +bool operator!=(const r_vector& lhs, const r_vector& rhs) { + return !(lhs == rhs); +} + +} // namespace cpp11 diff --git a/r/inst/include/cpp11/raws.hpp b/r/inst/include/cpp11/raws.hpp new file mode 100644 index 00000000000..e3a38394e02 --- /dev/null +++ b/r/inst/include/cpp11/raws.hpp @@ -0,0 +1,148 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for min +#include // for array +#include // for uint8_t +#include // for initializer_list + +#include "cpp11/R.hpp" // for RAW, SEXP, SEXPREC, Rf_allocVector +#include "cpp11/attribute_proxy.hpp" // for attribute_proxy +#include "cpp11/named_arg.hpp" // for named_arg +#include "cpp11/protect.hpp" // for protect_sexp, release_protect +#include "cpp11/r_vector.hpp" // for r_vector, r_vector<>::proxy +#include "cpp11/sexp.hpp" // for sexp + +// Specializations for raws + +namespace cpp11 { + +template <> +inline SEXP r_vector::valid_type(SEXP data) { + if (TYPEOF(data) != RAWSXP) { + throw type_error(RAWSXP, TYPEOF(data)); + } + return data; +} + +template <> +inline uint8_t r_vector::operator[](const R_xlen_t pos) const { + // NOPROTECT: likely too costly to unwind protect every elt + return is_altrep_ ? RAW_ELT(data_, pos) : data_p_[pos]; +} + +template <> +inline uint8_t* r_vector::get_p(bool is_altrep, SEXP data) { + if (is_altrep) { + return nullptr; + } else { + return reinterpret_cast(RAW(data)); + } +} + +template <> +inline void r_vector::const_iterator::fill_buf(R_xlen_t pos) { + using namespace cpp11::literals; + length_ = std::min(64_xl, data_->size() - pos); + unwind_protect( + [&] { RAW_GET_REGION(data_->data_, pos, length_, (uint8_t*)buf_.data()); }); + block_start_ = pos; +} + +typedef r_vector raws; + +namespace writable { + +template <> +inline typename r_vector::proxy& r_vector::proxy::operator=( + const uint8_t& rhs) { + if (is_altrep_) { + // NOPROTECT: likely too costly to unwind protect every set elt + RAW(data_)[index_] = rhs; + } else { + *p_ = rhs; + } + return *this; +} + +template <> +inline r_vector::proxy::operator uint8_t() const { + if (p_ == nullptr) { + // NOPROTECT: likely too costly to unwind protect every elt + return RAW(data_)[index_]; + } else { + return *p_; + } +} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(safe[Rf_allocVector](RAWSXP, il.size())), + capacity_(il.size()) { + protect_ = protect_sexp(data_); + auto it = il.begin(); + for (R_xlen_t i = 0; i < capacity_; ++i, ++it) { + data_p_[i] = *it; + } +} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(safe[Rf_allocVector](RAWSXP, il.size())), + capacity_(il.size()) { + protect_ = protect_sexp(data_); + int n_protected = 0; + + try { + unwind_protect([&] { + Rf_setAttrib(data_, R_NamesSymbol, Rf_allocVector(STRSXP, capacity_)); + SEXP names = PROTECT(Rf_getAttrib(data_, R_NamesSymbol)); + ++n_protected; + + auto it = il.begin(); + for (R_xlen_t i = 0; i < capacity_; ++i, ++it) { + data_p_[i] = RAW_ELT(it->value(), 0); + SET_STRING_ELT(names, i, Rf_mkCharCE(it->name(), CE_UTF8)); + } + UNPROTECT(n_protected); + }); + } catch (const unwind_exception& e) { + release_protect(protect_); + UNPROTECT(n_protected); + throw e; + } +} + +template <> +inline void r_vector::reserve(R_xlen_t new_capacity) { + data_ = data_ == R_NilValue ? safe[Rf_allocVector](RAWSXP, new_capacity) + : safe[Rf_xlengthgets](data_, new_capacity); + + SEXP old_protect = protect_; + protect_ = protect_sexp(data_); + release_protect(old_protect); + + data_p_ = reinterpret_cast(RAW(data_)); + capacity_ = new_capacity; +} + +template <> +inline void r_vector::push_back(uint8_t value) { + while (length_ >= capacity_) { + reserve(capacity_ == 0 ? 1 : capacity_ *= 2); + } + if (is_altrep_) { + // NOPROTECT: likely too costly to unwind protect every elt + RAW(data_)[length_] = value; + } else { + data_p_[length_] = value; + } + ++length_; +} + +typedef r_vector raws; + +} // namespace writable + +} // namespace cpp11 diff --git a/r/inst/include/cpp11/sexp.hpp b/r/inst/include/cpp11/sexp.hpp new file mode 100644 index 00000000000..4c1ef58c097 --- /dev/null +++ b/r/inst/include/cpp11/sexp.hpp @@ -0,0 +1,79 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for size_t + +#include // for string, basic_string + +#include "cpp11/R.hpp" // for SEXP, SEXPREC, REAL_ELT, R_NilV... +#include "cpp11/attribute_proxy.hpp" // for attribute_proxy +#include "cpp11/protect.hpp" // for protect_sexp, release_protect + +namespace cpp11 { + +/// Converting to SEXP +class sexp { + private: + SEXP data_ = R_NilValue; + SEXP protect_ = R_NilValue; + + public: + sexp() = default; + sexp(SEXP data) : data_(data), protect_(protect_sexp(data_)) { + // REprintf("created %x %x : %i\n", data_, protect_, protect_head_size()); + } + sexp(const sexp& rhs) { + data_ = rhs.data_; + protect_ = protect_sexp(data_); + // REprintf("copied %x new protect %x : %i\n", rhs.data_, protect_, + // protect_head_size()); + } + sexp(sexp&& rhs) { + data_ = rhs.data_; + protect_ = rhs.protect_; + + rhs.data_ = R_NilValue; + rhs.protect_ = R_NilValue; + + // REprintf("moved %x : %i\n", rhs.data_, protect_head_size()); + } + sexp& operator=(const sexp& rhs) { + data_ = rhs.data_; + protect_ = protect_sexp(data_); + // REprintf("assigned %x : %i\n", rhs.data_, protect_head_size()); + return *this; + } + + // void swap(sexp& rhs) { + // sexp tmp(rhs); + // rhs = *this; + //*this = tmp; + //} + + ~sexp() { release_protect(protect_); } + + attribute_proxy attr(const char* name) const { + return attribute_proxy(*this, name); + } + + attribute_proxy attr(const std::string& name) const { + return attribute_proxy(*this, name.c_str()); + } + + attribute_proxy attr(SEXP name) const { + return attribute_proxy(*this, name); + } + + attribute_proxy names() const { + return attribute_proxy(*this, R_NamesSymbol); + } + + operator SEXP() const { return data_; } + operator double() const { return REAL_ELT(data_, 0); } + operator size_t() const { return REAL_ELT(data_, 0); } + operator bool() const { return LOGICAL_ELT(data_, 0); } + SEXP data() const { return data_; } +}; + +} // namespace cpp11 diff --git a/r/inst/include/cpp11/strings.hpp b/r/inst/include/cpp11/strings.hpp new file mode 100644 index 00000000000..e54e9296992 --- /dev/null +++ b/r/inst/include/cpp11/strings.hpp @@ -0,0 +1,187 @@ +// cpp11 version: 0.2.1.9000 +// vendored on: 2020-08-20 +#pragma once + +#include // for initializer_list +#include // for string, basic_string + +#include "cpp11/R.hpp" // for SEXP, TYPEOF, SEXPREC, SET_STRI... +#include "cpp11/as.hpp" // for as_sexp +#include "cpp11/attribute_proxy.hpp" // for attribute_proxy +#include "cpp11/named_arg.hpp" // for named_arg +#include "cpp11/protect.hpp" // for protect_sexp, unwind_protect +#include "cpp11/r_string.hpp" // for r_string +#include "cpp11/r_vector.hpp" // for r_vector, r_vector<>::proxy +#include "cpp11/sexp.hpp" // for sexp + +// Specializations for strings + +namespace cpp11 { + +template <> +inline SEXP r_vector::valid_type(SEXP data) { + if (TYPEOF(data) != STRSXP) { + throw type_error(STRSXP, TYPEOF(data)); + } + return data; +} + +template <> +inline r_string r_vector::operator[](const R_xlen_t pos) const { + // NOPROTECT: likely too costly to unwind protect every elt + return STRING_ELT(data_, pos); +} + +template <> +inline r_string* r_vector::get_p(bool, SEXP) { + return nullptr; +} + +template <> +inline void r_vector::const_iterator::fill_buf(R_xlen_t) { + return; +} + +template <> +inline r_string r_vector::const_iterator::operator*() { + return STRING_ELT(data_->data(), pos_); +} + +typedef r_vector strings; + +namespace writable { + +template <> +inline typename r_vector::proxy& r_vector::proxy::operator=( + const r_string& rhs) { + unwind_protect([&] { SET_STRING_ELT(data_, index_, rhs); }); + return *this; +} + +template <> +inline r_vector::proxy::operator r_string() const { + // NOPROTECT: likely too costly to unwind protect every elt + return STRING_ELT(data_, index_); +} + +inline bool operator==(const r_vector::proxy& lhs, r_string rhs) { + return static_cast(lhs).operator==(static_cast(rhs).c_str()); +} + +inline SEXP alloc_or_copy(const SEXP data) { + switch (TYPEOF(data)) { + case CHARSXP: + return cpp11::r_vector(safe[Rf_allocVector](STRSXP, 1)); + case STRSXP: + return safe[Rf_shallow_duplicate](data); + default: + throw type_error(STRSXP, TYPEOF(data)); + } +} + +inline SEXP alloc_if_charsxp(const SEXP data) { + switch (TYPEOF(data)) { + case CHARSXP: + return cpp11::r_vector(safe[Rf_allocVector](STRSXP, 1)); + case STRSXP: + return data; + default: + throw type_error(STRSXP, TYPEOF(data)); + } +} + +template <> +inline r_vector::r_vector(const SEXP& data) + : cpp11::r_vector(alloc_or_copy(data)), + protect_(protect_sexp(data_)), + capacity_(length_) { + if (TYPEOF(data) == CHARSXP) { + SET_STRING_ELT(data_, 0, data); + } +} + +template <> +inline r_vector::r_vector(SEXP&& data) + : cpp11::r_vector(alloc_if_charsxp(data)), + protect_(protect_sexp(data_)), + capacity_(length_) { + if (TYPEOF(data) == CHARSXP) { + SET_STRING_ELT(data_, 0, data); + } +} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(as_sexp(il)), capacity_(il.size()) {} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(as_sexp(il)), capacity_(il.size()) {} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(as_sexp(il)), capacity_(il.size()) {} + +template <> +inline r_vector::r_vector(std::initializer_list il) + : cpp11::r_vector(safe[Rf_allocVector](STRSXP, il.size())), + capacity_(il.size()) { + protect_ = protect_sexp(data_); + int n_protected = 0; + + try { + unwind_protect([&] { + Rf_setAttrib(data_, R_NamesSymbol, Rf_allocVector(STRSXP, capacity_)); + SEXP names = PROTECT(Rf_getAttrib(data_, R_NamesSymbol)); + ++n_protected; + auto it = il.begin(); + for (R_xlen_t i = 0; i < capacity_; ++i, ++it) { + SET_STRING_ELT(data_, i, STRING_ELT(it->value(), 0)); + SET_STRING_ELT(names, i, Rf_mkCharCE(it->name(), CE_UTF8)); + } + UNPROTECT(n_protected); + }); + } catch (const unwind_exception& e) { + release_protect(protect_); + UNPROTECT(n_protected); + throw e; + } +} + +template <> +inline void r_vector::reserve(R_xlen_t new_capacity) { + data_ = data_ == R_NilValue ? safe[Rf_allocVector](STRSXP, new_capacity) + : safe[Rf_xlengthgets](data_, new_capacity); + + SEXP old_protect = protect_; + protect_ = protect_sexp(data_); + release_protect(old_protect); + + capacity_ = new_capacity; +} + +template <> +inline void r_vector::push_back(r_string value) { + while (length_ >= capacity_) { + reserve(capacity_ == 0 ? 1 : capacity_ *= 2); + } + unwind_protect([&] { SET_STRING_ELT(data_, length_, value); }); + ++length_; +} + +typedef r_vector strings; + +template +inline void r_vector::push_back(const named_arg& value) { + push_back(value.value()); + if (Rf_xlength(names()) == 0) { + cpp11::writable::strings new_nms(size()); + names() = new_nms; + } + cpp11::writable::strings nms(names()); + nms[size() - 1] = value.name(); +} + +} // namespace writable + +} // namespace cpp11 diff --git a/r/src/Makevars.in b/r/src/Makevars.in index 9a9191dca86..ec61ef89af9 100644 --- a/r/src/Makevars.in +++ b/r/src/Makevars.in @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -PKG_CPPFLAGS=@cflags@ +PKG_CPPFLAGS=@cflags@ -I../inst/include/ # `-fvisibility=hidden` does not play well with UBSAN: # https://bugs.llvm.org/show_bug.cgi?id=39191 # https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg534862.html diff --git a/r/src/array.cpp b/r/src/array.cpp index 5879dc91675..844ac2a704d 100644 --- a/r/src/array.cpp +++ b/r/src/array.cpp @@ -17,48 +17,45 @@ #include "./arrow_types.h" -using Rcpp::LogicalVector; -using Rcpp::no_init; - #if defined(ARROW_R_WITH_ARROW) #include #include -void arrow::r::validate_slice_offset(int offset, int len) { +void arrow::r::validate_slice_offset(R_xlen_t offset, int64_t len) { if (offset == NA_INTEGER) { - Rcpp::stop("Slice 'offset' cannot be NA"); + cpp11::stop("Slice 'offset' cannot be NA"); } if (offset < 0) { - Rcpp::stop("Slice 'offset' cannot be negative"); + cpp11::stop("Slice 'offset' cannot be negative"); } if (offset > len) { - Rcpp::stop("Slice 'offset' greater than array length"); + cpp11::stop("Slice 'offset' greater than array length"); } } -void arrow::r::validate_slice_length(int length, int available) { +void arrow::r::validate_slice_length(R_xlen_t length, int64_t available) { if (length == NA_INTEGER) { - Rcpp::stop("Slice 'length' cannot be NA"); + cpp11::stop("Slice 'length' cannot be NA"); } if (length < 0) { - Rcpp::stop("Slice 'length' cannot be negative"); + cpp11::stop("Slice 'length' cannot be negative"); } if (length > available) { - Rcpp::warning("Slice 'length' greater than available length"); + cpp11::warning("Slice 'length' greater than available length"); } } // [[arrow::export]] std::shared_ptr Array__Slice1(const std::shared_ptr& array, - int offset) { + R_xlen_t offset) { arrow::r::validate_slice_offset(offset, array->length()); return array->Slice(offset); } // [[arrow::export]] std::shared_ptr Array__Slice2(const std::shared_ptr& array, - int offset, int length) { + R_xlen_t offset, R_xlen_t length) { arrow::r::validate_slice_offset(offset, array->length()); arrow::r::validate_slice_length(length, array->length() - offset); return array->Slice(offset, length); @@ -66,21 +63,21 @@ std::shared_ptr Array__Slice2(const std::shared_ptr& void arrow::r::validate_index(int i, int len) { if (i == NA_INTEGER) { - Rcpp::stop("'i' cannot be NA"); + cpp11::stop("'i' cannot be NA"); } if (i < 0 || i >= len) { - Rcpp::stop("subscript out of bounds"); + cpp11::stop("subscript out of bounds"); } } // [[arrow::export]] -bool Array__IsNull(const std::shared_ptr& x, int i) { +bool Array__IsNull(const std::shared_ptr& x, R_xlen_t i) { arrow::r::validate_index(i, x->length()); return x->IsNull(i); } // [[arrow::export]] -bool Array__IsValid(const std::shared_ptr& x, int i) { +bool Array__IsValid(const std::shared_ptr& x, R_xlen_t i) { arrow::r::validate_index(i, x->length()); return x->IsValid(i); } @@ -129,16 +126,16 @@ std::shared_ptr Array__data( // [[arrow::export]] bool Array__RangeEquals(const std::shared_ptr& self, - const std::shared_ptr& other, int start_idx, - int end_idx, int other_start_idx) { + const std::shared_ptr& other, R_xlen_t start_idx, + R_xlen_t end_idx, R_xlen_t other_start_idx) { if (start_idx == NA_INTEGER) { - Rcpp::stop("'start_idx' cannot be NA"); + cpp11::stop("'start_idx' cannot be NA"); } if (end_idx == NA_INTEGER) { - Rcpp::stop("'end_idx' cannot be NA"); + cpp11::stop("'end_idx' cannot be NA"); } if (other_start_idx == NA_INTEGER) { - Rcpp::stop("'other_start_idx' cannot be NA"); + cpp11::stop("'other_start_idx' cannot be NA"); } return self->RangeEquals(*other, start_idx, end_idx, other_start_idx); } @@ -245,17 +242,17 @@ int64_t FixedSizeListArray__value_offset( } // [[arrow::export]] -Rcpp::IntegerVector ListArray__raw_value_offsets( +cpp11::writable::integers ListArray__raw_value_offsets( const std::shared_ptr& array) { auto offsets = array->raw_value_offsets(); - return Rcpp::IntegerVector(offsets, offsets + array->length()); + return cpp11::writable::integers(offsets, offsets + array->length()); } // [[arrow::export]] -Rcpp::IntegerVector LargeListArray__raw_value_offsets( +cpp11::writable::integers LargeListArray__raw_value_offsets( const std::shared_ptr& array) { auto offsets = array->raw_value_offsets(); - return Rcpp::IntegerVector(offsets, offsets + array->length()); + return cpp11::writable::integers(offsets, offsets + array->length()); } #endif diff --git a/r/src/array_from_vector.cpp b/r/src/array_from_vector.cpp index 4711c4b730a..ed3df89b242 100644 --- a/r/src/array_from_vector.cpp +++ b/r/src/array_from_vector.cpp @@ -170,16 +170,13 @@ struct VectorToArrayConverter { R_xlen_t n = XLENGTH(x); RETURN_NOT_OK(builder->Reserve(n)); for (R_xlen_t i = 0; i < n; i++) { - SEXP s = STRING_ELT(x, i); - if (s == NA_STRING) { + SEXP si = STRING_ELT(x, i); + if (si == NA_STRING) { RETURN_NOT_OK(binary_builder->AppendNull()); continue; - } else { - // Make sure we're ingesting UTF-8 - s = Rf_mkCharCE(Rf_translateCharUTF8(s), CE_UTF8); } - - RETURN_NOT_OK(binary_builder->Append(CHAR(s), LENGTH(s))); + std::string s = cpp11::r_string(si); + RETURN_NOT_OK(binary_builder->Append(s.c_str(), s.size())); } return Status::OK(); @@ -339,7 +336,7 @@ struct VectorToArrayConverter { }; template -std::shared_ptr MakeFactorArrayImpl(Rcpp::IntegerVector_ factor, +std::shared_ptr MakeFactorArrayImpl(cpp11::integers factor, const std::shared_ptr& type) { using value_type = typename arrow::TypeTraits::ArrayType::value_type; auto n = factor.size(); @@ -393,7 +390,7 @@ std::shared_ptr MakeFactorArrayImpl(Rcpp::IntegerVector_ factor, return ValueOrStop(DictionaryArray::FromArrays(type, array_indices, dict)); } -std::shared_ptr MakeFactorArray(Rcpp::IntegerVector_ factor, +std::shared_ptr MakeFactorArray(cpp11::integers factor, const std::shared_ptr& type) { const auto& dict_type = checked_cast(*type); switch (dict_type.index_type()->id()) { @@ -406,9 +403,11 @@ std::shared_ptr MakeFactorArray(Rcpp::IntegerVector_ factor, case Type::INT64: return MakeFactorArrayImpl(factor, type); default: - Rcpp::stop(tfm::format("Cannot convert to dictionary with index_type %s", - dict_type.index_type()->ToString())); + break; } + + cpp11::stop("Cannot convert to dictionary with index_type '%s'", + dict_type.index_type()->ToString().c_str()); } std::shared_ptr MakeStructArray(SEXP df, const std::shared_ptr& type) { @@ -586,9 +585,8 @@ struct Unbox> { break; } - return Status::Invalid( - tfm::format("Cannot convert R vector of type %s to integer Arrow array", - Rcpp::type2name(obj))); + return Status::Invalid("Cannot convert R vector of type <", Rf_type2char(TYPEOF(obj)), + "> to integer Arrow array"); } template @@ -1064,42 +1062,40 @@ class FixedSizeBinaryVectorConverter : public VectorConverter { FixedSizeBinaryBuilder* typed_builder_; }; -template +template class StringVectorConverter : public VectorConverter { public: ~StringVectorConverter() {} Status Init(ArrayBuilder* builder) { - typed_builder_ = checked_cast(builder); + typed_builder_ = checked_cast(builder); return Status::OK(); } Status Ingest(SEXP obj) { ARROW_RETURN_IF(TYPEOF(obj) != STRSXP, Status::RError("Expecting a character vector")); - R_xlen_t n = XLENGTH(obj); - // Reserve enough space before appending - int64_t size = 0; - for (R_xlen_t i = 0; i < n; i++) { - SEXP string_i = STRING_ELT(obj, i); - if (string_i != NA_STRING) { - size += XLENGTH(Rf_mkCharCE(Rf_translateCharUTF8(string_i), CE_UTF8)); - } + cpp11::strings s(arrow::r::utf8_strings(obj)); + RETURN_NOT_OK(typed_builder_->Reserve(s.size())); + + // we know all the R strings are utf8 already, so we can get + // a definite size and then use UnsafeAppend*() + int64_t total_length = 0; + for (cpp11::r_string si : s) { + total_length += cpp11::is_na(si) ? 0 : si.size(); } - RETURN_NOT_OK(typed_builder_->Reserve(size)); + RETURN_NOT_OK(typed_builder_->ReserveData(total_length)); // append - for (R_xlen_t i = 0; i < n; i++) { - SEXP string_i = STRING_ELT(obj, i); - if (string_i == NA_STRING) { - RETURN_NOT_OK(typed_builder_->AppendNull()); + for (cpp11::r_string si : s) { + if (si == NA_STRING) { + typed_builder_->UnsafeAppendNull(); } else { - // Make sure we're ingesting UTF-8 - string_i = Rf_mkCharCE(Rf_translateCharUTF8(string_i), CE_UTF8); - RETURN_NOT_OK(typed_builder_->Append(CHAR(string_i), XLENGTH(string_i))); + typed_builder_->UnsafeAppend(CHAR(si), si.size()); } } + return Status::OK(); } @@ -1108,7 +1104,7 @@ class StringVectorConverter : public VectorConverter { } private: - Builder* typed_builder_; + StringBuilder* typed_builder_; }; #define NUMERIC_CONVERTER(TYPE_ENUM, TYPE) \ @@ -1191,17 +1187,16 @@ std::shared_ptr InferArrowTypeFromFactor(SEXP factor) { template std::shared_ptr InferArrowTypeFromVector(SEXP x) { - Rcpp::stop("Unknown vector type: ", VectorType); + cpp11::stop("Unknown vector type: ", VectorType); } template <> std::shared_ptr InferArrowTypeFromVector(SEXP x) { if (Rf_inherits(x, "Array")) { - Rcpp::ConstReferenceSmartPtrInputParameter> array(x); - return static_cast>(array)->type(); + return cpp11::as_cpp>(x)->type(); } - Rcpp::stop("Unrecognized vector instance for type ENVSXP"); + cpp11::stop("Unrecognized vector instance for type ENVSXP"); } template <> @@ -1250,32 +1245,30 @@ std::shared_ptr InferArrowTypeFromVector(SEXP x) { template <> std::shared_ptr InferArrowTypeFromVector(SEXP x) { - // See how big the character vector is - R_xlen_t n = XLENGTH(x); - int64_t size = 0; - for (R_xlen_t i = 0; i < n; i++) { - SEXP string_i = STRING_ELT(x, i); - if (string_i != NA_STRING) { - size += XLENGTH(Rf_mkCharCE(Rf_translateCharUTF8(string_i), CE_UTF8)); - } - if (size > arrow::kBinaryMemoryLimit) { - // Exceeds 2GB capacity of utf8 type, so use large - return large_utf8(); + return cpp11::unwind_protect([&] { + R_xlen_t n = XLENGTH(x); + + int64_t size = 0; + + for (R_xlen_t i = 0; i < n; i++) { + size += arrow::r::unsafe::r_string_size(STRING_ELT(x, i)); + if (size > arrow::kBinaryMemoryLimit) { + // Exceeds 2GB capacity of utf8 type, so use large + return large_utf8(); + } } - } - return utf8(); + return utf8(); + }); } -static inline std::shared_ptr InferArrowTypeFromDataFrame(SEXP x) { - R_xlen_t n = XLENGTH(x); - SEXP names = Rf_getAttrib(x, R_NamesSymbol); +static inline std::shared_ptr InferArrowTypeFromDataFrame( + cpp11::list x) { + R_xlen_t n = x.size(); + cpp11::strings names(x.attr(R_NamesSymbol)); std::vector> fields(n); for (R_xlen_t i = 0; i < n; i++) { - // Make sure we're ingesting UTF-8 - const auto* field_name = - CHAR(Rf_mkCharCE(Rf_translateCharUTF8(STRING_ELT(names, i)), CE_UTF8)); - fields[i] = arrow::field(field_name, InferArrowType(VECTOR_ELT(x, i))); + fields[i] = arrow::field(names[i], InferArrowType(x[i])); } return arrow::struct_(std::move(fields)); } @@ -1290,7 +1283,7 @@ std::shared_ptr InferArrowTypeFromVector(SEXP x) { SEXP byte_width = Rf_getAttrib(x, symbols::byte_width); if (Rf_isNull(byte_width) || TYPEOF(byte_width) != INTSXP || XLENGTH(byte_width) != 1) { - Rcpp::stop("malformed arrow_fixed_size_binary object"); + cpp11::stop("malformed arrow_fixed_size_binary object"); } return arrow::fixed_size_binary(INTEGER(byte_width)[0]); } @@ -1306,7 +1299,7 @@ std::shared_ptr InferArrowTypeFromVector(SEXP x) { SEXP ptype = Rf_getAttrib(x, symbols::ptype); if (Rf_isNull(ptype)) { if (XLENGTH(x) == 0) { - Rcpp::stop( + cpp11::stop( "Requires at least one element to infer the values' type of a list vector"); } @@ -1337,7 +1330,7 @@ std::shared_ptr InferArrowType(SEXP x) { break; } - Rcpp::stop("Cannot infer type from vector"); + cpp11::stop("Cannot infer type from vector"); } // in some situations we can just use the memory of the R object in an RBuffer @@ -1360,15 +1353,15 @@ bool can_reuse_memory(SEXP x, const std::shared_ptr& type) { // this is only used on some special cases when the arrow Array can just use the memory of // the R object, via an RBuffer, hence be zero copy -template +template std::shared_ptr MakeSimpleArray(SEXP x) { using value_type = typename arrow::TypeTraits::ArrayType::value_type; - Rcpp::Vector vec(x); + RVector vec(x); auto n = vec.size(); - auto p_vec_start = reinterpret_cast(vec.begin()); + auto p_vec_start = reinterpret_cast(DATAPTR(vec)); auto p_vec_end = p_vec_start + n; std::vector> buffers{nullptr, - std::make_shared>(vec)}; + std::make_shared>(vec)}; int null_count = 0; @@ -1410,16 +1403,16 @@ std::shared_ptr Array__from_vector_reuse_memory(SEXP x) { auto type = TYPEOF(x); if (type == INTSXP) { - return MakeSimpleArray(x); + return MakeSimpleArray(x); } else if (type == REALSXP && Rf_inherits(x, "integer64")) { - return MakeSimpleArray(x); + return MakeSimpleArray(x); } else if (type == REALSXP) { - return MakeSimpleArray(x); + return MakeSimpleArray(x); } else if (type == RAWSXP) { - return MakeSimpleArray(x); + return MakeSimpleArray(x); } - Rcpp::stop("Unreachable: you might need to fix can_reuse_memory()"); + cpp11::stop("Unreachable: you might need to fix can_reuse_memory()"); } bool CheckCompatibleFactor(SEXP obj, const std::shared_ptr& type) { @@ -1450,25 +1443,28 @@ arrow::Status CheckCompatibleStruct(SEXP obj, // the columns themselves are not checked against the // types of the fields, because Array__from_vector will error // when not compatible. - SEXP names = Rf_getAttrib(obj, R_NamesSymbol); - SEXP name_i; - for (int i = 0; i < num_fields; i++) { - name_i = Rf_mkCharCE(Rf_translateCharUTF8(STRING_ELT(names, i)), CE_UTF8); - if (type->field(i)->name() != CHAR(name_i)) { - return Status::RError("Field name in position ", i, " (", type->field(i)->name(), - ") does not match the name of the column of the data frame (", - CHAR(name_i), ")"); + cpp11::strings names = Rf_getAttrib(obj, R_NamesSymbol); + + return cpp11::unwind_protect([&] { + for (int i = 0; i < num_fields; i++) { + const char* name_i = arrow::r::unsafe::utf8_string(names[i]); + auto field_name = type->field(i)->name(); + if (field_name != name_i) { + return Status::RError( + "Field name in position ", i, " (", field_name, + ") does not match the name of the column of the data frame (", name_i, ")"); + } } - } - return Status::OK(); + return Status::OK(); + }); } std::shared_ptr Array__from_vector( SEXP x, const std::shared_ptr& type, bool type_inferred) { // short circuit if `x` is already an Array if (Rf_inherits(x, "Array")) { - return Rcpp::ConstReferenceSmartPtrInputParameter>(x); + return cpp11::as_cpp>(x); } // special case when we can just use the data from the R vector @@ -1487,7 +1483,7 @@ std::shared_ptr Array__from_vector( return arrow::r::MakeFactorArray(x, type); } - Rcpp::stop("Object incompatible with dictionary type"); + cpp11::stop("Object incompatible with dictionary type"); } if (type->id() == Type::LIST || type->id() == Type::LARGE_LIST || @@ -1543,14 +1539,14 @@ std::shared_ptr Array__from_vector(SEXP x, SEXP s_type) { if (type_inferred) { type = arrow::r::InferArrowType(x); } else { - type = arrow::r::extract(s_type); + type = cpp11::as_cpp>(s_type); } return arrow::r::Array__from_vector(x, type, type_inferred); } // [[arrow::export]] -std::shared_ptr ChunkedArray__from_list(Rcpp::List chunks, +std::shared_ptr ChunkedArray__from_list(cpp11::list chunks, SEXP s_type) { std::vector> vec; @@ -1562,11 +1558,11 @@ std::shared_ptr ChunkedArray__from_list(Rcpp::List chunks, std::shared_ptr type; if (type_inferred) { if (n == 0) { - Rcpp::stop("type must be specified for empty list"); + cpp11::stop("type must be specified for empty list"); } type = arrow::r::InferArrowType(VECTOR_ELT(chunks, 0)); } else { - type = arrow::r::extract(s_type); + type = cpp11::as_cpp>(s_type); } if (n == 0) { @@ -1580,11 +1576,10 @@ std::shared_ptr ChunkedArray__from_list(Rcpp::List chunks, // because we might have inferred the type from the first element of the list // // this only really matters for dictionary arrays - vec.push_back( - arrow::r::Array__from_vector(VECTOR_ELT(chunks, 0), type, type_inferred)); + vec.push_back(arrow::r::Array__from_vector(chunks[0], type, type_inferred)); for (R_xlen_t i = 1; i < n; i++) { - vec.push_back(arrow::r::Array__from_vector(VECTOR_ELT(chunks, i), type, false)); + vec.push_back(arrow::r::Array__from_vector(chunks[i], type, false)); } } diff --git a/r/src/array_to_vector.cpp b/r/src/array_to_vector.cpp index 8be2d02384f..272ce2cb59a 100644 --- a/r/src/array_to_vector.cpp +++ b/r/src/array_to_vector.cpp @@ -35,13 +35,6 @@ using internal::IntegersCanFit; namespace r { -using Rcpp::default_value; -using Rcpp::IntegerVector; -using Rcpp::LogicalVector_; -using Rcpp::no_init; -using Rcpp::Shield; -using Rcpp::StringVector_; - class Converter { public: explicit Converter(ArrayVector arrays) : arrays_(std::move(arrays)) {} @@ -92,7 +85,7 @@ class Converter { // // for each array, add a task to the task group // - // The task group is Finish() iun the caller + // The task group is Finish() in the caller void IngestParallel(SEXP data, const std::shared_ptr& tg) { R_xlen_t k = 0, i = 0; for (const auto& array : arrays_) { @@ -111,105 +104,148 @@ class Converter { ArrayVector arrays_; }; -// data[start:(start+n)] = NA -template -Status AllNull_Ingest(SEXP data, R_xlen_t start, R_xlen_t n) { - auto p_data = Rcpp::internal::r_vector_start(data) + start; - std::fill_n(p_data, n, Rcpp::default_value()); - return Status::OK(); -} - -// ingest the data from `array` into a slice of `data` -// -// each element goes through `lambda` when some conversion is needed -template -Status SomeNull_Ingest(SEXP data, R_xlen_t start, R_xlen_t n, - const array_value_type* p_values, - const std::shared_ptr& array, Lambda lambda) { - if (!p_values) { - return Status::Invalid("Invalid data buffer"); - } - auto p_data = Rcpp::internal::r_vector_start(data) + start; - - if (array->null_count()) { - arrow::internal::BitmapReader bitmap_reader(array->null_bitmap()->data(), - array->offset(), n); - for (R_xlen_t i = 0; i < n; i++, bitmap_reader.Next(), ++p_data, ++p_values) { - *p_data = bitmap_reader.IsSet() ? lambda(*p_values) : default_value(); - } - } else { - std::transform(p_values, p_values + n, p_data, lambda); - } - - return Status::OK(); -} - -template -Status IngestSome(const std::shared_ptr& array, R_xlen_t n, Lambda lambda) { +template +Status IngestSome(const std::shared_ptr& array, R_xlen_t n, + SetNonNull&& set_non_null, SetNull&& set_null) { if (array->null_count()) { internal::BitmapReader bitmap_reader(array->null_bitmap()->data(), array->offset(), n); for (R_xlen_t i = 0; i < n; i++, bitmap_reader.Next()) { - if (bitmap_reader.IsSet()) RETURN_NOT_OK(lambda(i)); + if (bitmap_reader.IsSet()) { + RETURN_NOT_OK(set_non_null(i)); + } else { + RETURN_NOT_OK(set_null(i)); + } } } else { for (R_xlen_t i = 0; i < n; i++) { - RETURN_NOT_OK(lambda(i)); + RETURN_NOT_OK(set_non_null(i)); } } return Status::OK(); } +template +Status IngestSome(const std::shared_ptr& array, R_xlen_t n, + SetNonNull&& set_non_null) { + auto nothing = [](R_xlen_t i) { return Status::OK(); }; + return IngestSome(array, n, std::forward(set_non_null), nothing); +} + // Allocate + Ingest SEXP ArrayVector__as_vector(R_xlen_t n, const std::shared_ptr& type, const ArrayVector& arrays) { auto converter = Converter::Make(type, arrays); - Shield data(converter->Allocate(n)); + SEXP data = PROTECT(converter->Allocate(n)); StopIfNotOk(converter->IngestSerial(data)); + UNPROTECT(1); return data; } -template -class Converter_SimpleArray : public Converter { - using Vector = Rcpp::Vector; - using value_type = typename Vector::stored_type; +template +class Converter_Int : public Converter { + using value_type = typename TypeTraits::ArrayType::value_type; public: - explicit Converter_SimpleArray(const ArrayVector& arrays) : Converter(arrays) {} + explicit Converter_Int(const ArrayVector& arrays) : Converter(arrays) {} - SEXP Allocate(R_xlen_t n) const { return Vector(no_init(n)); } + SEXP Allocate(R_xlen_t n) const { return Rf_allocVector(INTSXP, n); } Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const { - return AllNull_Ingest(data, start, n); + std::fill_n(INTEGER(data) + start, n, NA_INTEGER); + return Status::OK(); } Status Ingest_some_nulls(SEXP data, const std::shared_ptr& array, R_xlen_t start, R_xlen_t n, size_t chunk_index) const { auto p_values = array->data()->GetValues(1); - auto echo = [](value_type value) { return value; }; - return SomeNull_Ingest(data, start, n, p_values, array, echo); + if (!p_values) { + return Status::Invalid("Invalid data buffer"); + } + auto p_data = INTEGER(data) + start; + auto ingest_one = [&](R_xlen_t i) { + p_data[i] = static_cast(p_values[i]); + return Status::OK(); + }; + auto null_one = [&](R_xlen_t i) { + p_data[i] = NA_INTEGER; + return Status::OK(); + }; + + return IngestSome(array, n, ingest_one, null_one); } }; -class Converter_Date32 : public Converter_SimpleArray { +template +class Converter_Double : public Converter { + using value_type = typename TypeTraits::ArrayType::value_type; + public: - explicit Converter_Date32(const ArrayVector& arrays) - : Converter_SimpleArray(arrays) {} + explicit Converter_Double(const ArrayVector& arrays) : Converter(arrays) {} + + SEXP Allocate(R_xlen_t n) const { return Rf_allocVector(REALSXP, n); } + + Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const { + std::fill_n(REAL(data) + start, n, NA_REAL); + return Status::OK(); + } + + Status Ingest_some_nulls(SEXP data, const std::shared_ptr& array, + R_xlen_t start, R_xlen_t n, size_t chunk_index) const { + auto p_values = array->data()->GetValues(1); + if (!p_values) { + return Status::Invalid("Invalid data buffer"); + } + auto p_data = REAL(data) + start; + auto ingest_one = [&](R_xlen_t i) { + p_data[i] = static_cast(p_values[i]); + return Status::OK(); + }; + auto null_one = [&](R_xlen_t i) { + p_data[i] = NA_REAL; + return Status::OK(); + }; + + return IngestSome(array, n, ingest_one, null_one); + } +}; + +class Converter_Date32 : public Converter { + public: + explicit Converter_Date32(const ArrayVector& arrays) : Converter(arrays) {} SEXP Allocate(R_xlen_t n) const { - Rcpp::NumericVector data(no_init(n)); - data.attr("class") = "Date"; + SEXP data = PROTECT(Rf_allocVector(REALSXP, n)); + Rf_classgets(data, Rf_mkString("Date")); + UNPROTECT(1); return data; } + Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const { + std::fill_n(REAL(data) + start, n, NA_REAL); + return Status::OK(); + } + Status Ingest_some_nulls(SEXP data, const std::shared_ptr& array, R_xlen_t start, R_xlen_t n, size_t chunk_index) const { - auto convert = [](int days) { return static_cast(days); }; - return SomeNull_Ingest(data, start, n, array->data()->GetValues(1), - array, convert); + auto p_values = array->data()->GetValues(1); + if (!p_values) { + return Status::Invalid("Invalid data buffer"); + } + auto p_data = REAL(data) + start; + auto ingest_one = [&](R_xlen_t i) { + p_data[i] = static_cast(p_values[i]); + return Status::OK(); + }; + auto null_one = [&](R_xlen_t i) { + p_data[i] = NA_REAL; + return Status::OK(); + }; + + return IngestSome(array, n, ingest_one, null_one); } }; @@ -218,10 +254,13 @@ struct Converter_String : public Converter { public: explicit Converter_String(const ArrayVector& arrays) : Converter(arrays) {} - SEXP Allocate(R_xlen_t n) const { return StringVector_(no_init(n)); } + SEXP Allocate(R_xlen_t n) const { return Rf_allocVector(STRSXP, n); } Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const { - return AllNull_Ingest(data, start, n); + for (R_xlen_t i = 0; i < n; i++) { + SET_STRING_ELT(data, i + start, NA_STRING); + } + return Status::OK(); } Status Ingest_some_nulls(SEXP data, const std::shared_ptr& array, @@ -255,7 +294,7 @@ struct Converter_String : public Converter { array->offset(), n); for (int i = 0; i < n; i++, null_reader.Next()) { if (null_reader.IsSet()) { - SET_STRING_ELT(data, start + i, r_string(string_array->GetString(i))); + SET_STRING_ELT(data, start + i, cpp11::r_string(string_array->GetString(i))); } else { SET_STRING_ELT(data, start + i, NA_STRING); } @@ -263,7 +302,7 @@ struct Converter_String : public Converter { } else { for (int i = 0; i < n; i++) { - SET_STRING_ELT(data, start + i, r_string(string_array->GetString(i))); + SET_STRING_ELT(data, start + i, cpp11::r_string(string_array->GetString(i))); } } @@ -271,45 +310,41 @@ struct Converter_String : public Converter { } bool Parallel() const { return false; } - - inline SEXP r_string(const arrow::util::string_view& view) const { - return Rf_mkCharLenCE(view.data(), view.size(), CE_UTF8); - } }; class Converter_Boolean : public Converter { public: explicit Converter_Boolean(const ArrayVector& arrays) : Converter(arrays) {} - SEXP Allocate(R_xlen_t n) const { return LogicalVector_(no_init(n)); } + SEXP Allocate(R_xlen_t n) const { return Rf_allocVector(LGLSXP, n); } Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const { - return AllNull_Ingest(data, start, n); + std::fill_n(LOGICAL(data) + start, n, NA_LOGICAL); + return Status::OK(); } Status Ingest_some_nulls(SEXP data, const std::shared_ptr& array, R_xlen_t start, R_xlen_t n, size_t chunk_index) const { - auto p_data = Rcpp::internal::r_vector_start(data) + start; + auto p_data = LOGICAL(data) + start; auto p_bools = array->data()->GetValues(1, 0); if (!p_bools) { return Status::Invalid("Invalid data buffer"); } arrow::internal::BitmapReader data_reader(p_bools, array->offset(), n); - if (array->null_count()) { - arrow::internal::BitmapReader null_reader(array->null_bitmap()->data(), - array->offset(), n); + auto ingest_one = [&](R_xlen_t i) { + p_data[i] = data_reader.IsSet(); + data_reader.Next(); + return Status::OK(); + }; - for (R_xlen_t i = 0; i < n; i++, data_reader.Next(), null_reader.Next(), ++p_data) { - *p_data = null_reader.IsSet() ? data_reader.IsSet() : NA_LOGICAL; - } - } else { - for (R_xlen_t i = 0; i < n; i++, data_reader.Next(), ++p_data) { - *p_data = data_reader.IsSet(); - } - } + auto null_one = [&](R_xlen_t i) { + data_reader.Next(); + p_data[i] = NA_LOGICAL; + return Status::OK(); + }; - return Status::OK(); + return IngestSome(array, n, ingest_one, null_one); } }; @@ -347,7 +382,7 @@ class Converter_Binary : public Converter { SEXP raw = PROTECT(Rf_allocVector(RAWSXP, ni)); std::copy(value, value + ni, RAW(raw)); - SET_VECTOR_ELT(data, i, raw); + SET_VECTOR_ELT(data, i + start, raw); UNPROTECT(1); return Status::OK(); @@ -385,7 +420,7 @@ class Converter_FixedSizeBinary : public Converter { SEXP raw = PROTECT(Rf_allocVector(RAWSXP, byte_width)); std::copy(value, value + byte_width, RAW(raw)); - SET_VECTOR_ELT(data, i, raw); + SET_VECTOR_ELT(data, i + start, raw); UNPROTECT(1); return Status::OK(); @@ -437,8 +472,8 @@ class Converter_Dictionary : public Converter { // TODO: also add int64, uint32, uint64 downcasts, if possible break; default: - Rcpp::stop("Cannot convert Dictionary Array of type `%s` to R", - dict_array.type()->ToString()); + cpp11::stop("Cannot convert Dictionary Array of type `%s` to R", + dict_array.type()->ToString().c_str()); } dictionary_ = dict_array.dictionary(); @@ -446,7 +481,7 @@ class Converter_Dictionary : public Converter { } SEXP Allocate(R_xlen_t n) const { - IntegerVector data(no_init(n)); + cpp11::writable::integers data(n); data.attr("levels") = GetLevels(); if (GetOrdered()) { Rf_classgets(data, arrow::r::data::classes_ordered); @@ -456,8 +491,11 @@ class Converter_Dictionary : public Converter { return data; } + virtual bool Parallel() const { return false; } + Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const { - return AllNull_Ingest(data, start, n); + std::fill_n(INTEGER(data) + start, n, NA_INTEGER); + return Status::OK(); } Status Ingest_some_nulls(SEXP data, const std::shared_ptr& array, @@ -495,20 +533,31 @@ class Converter_Dictionary : public Converter { auto indices = checked_cast(*array).indices(); auto raw_indices = indices->data()->GetValues(1); + auto p_data = INTEGER(data) + start; + auto null_one = [&](R_xlen_t i) { + p_data[i] = NA_INTEGER; + return Status::OK(); + }; + // convert the 0-based indices from the arrow Array // to 1-based indices used in R factors if (need_unification_) { // transpose the indices before converting auto transposed = reinterpret_cast(arrays_transpose_[chunk_index]->data()); - auto transpose_convert = [=](index_type i) { return transposed[i] + 1; }; - return SomeNull_Ingest(data, start, n, raw_indices, indices, - transpose_convert); - } else { - auto convert = [](index_type i) { return static_cast(i) + 1; }; + auto ingest_one = [&](R_xlen_t i) { + p_data[i] = transposed[raw_indices[i]] + 1; + return Status::OK(); + }; - return SomeNull_Ingest(data, start, n, raw_indices, indices, convert); + return IngestSome(array, n, ingest_one, null_one); + } else { + auto ingest_one = [&](R_xlen_t i) { + p_data[i] = static_cast(raw_indices[i]) + 1; + return Status::OK(); + }; + return IngestSome(array, n, ingest_one, null_one); } } @@ -537,10 +586,9 @@ class Converter_Dictionary : public Converter { // Alternative: preserve the logical type of the dictionary values // (e.g. if dict is timestamp, return a POSIXt R vector, not factor) if (dictionary_->type_id() != Type::STRING) { - Rcpp::warning( - "Coercing dictionary values from type %s to R character factor levels", - dictionary_->type()->ToString()); + cpp11::warning("Coercing dictionary values to R character factor levels"); } + SEXP vec = PROTECT(ArrayVector__as_vector(dictionary_->length(), dictionary_->type(), {dictionary_})); SEXP strings_vec = PROTECT(Rf_coerceVector(vec, STRSXP)); @@ -564,21 +612,17 @@ class Converter_Struct : public Converter { // allocate a data frame column to host each array auto first_array = checked_cast(this->arrays_[0].get()); auto type = first_array->struct_type(); - int nf = first_array->num_fields(); - Rcpp::List out(nf); - Rcpp::CharacterVector colnames(nf); - for (int i = 0; i < nf; i++) { - out[i] = converters[i]->Allocate(n); - colnames[i] = Rcpp::String(type->field(i)->name(), CE_UTF8); - } + auto out = + arrow::r::to_r_list(converters, [n](const std::shared_ptr& converter) { + return converter->Allocate(n); + }); + auto colnames = arrow::r::to_r_strings( + type->fields(), + [](const std::shared_ptr& field) { return field->name(); }); + out.attr(symbols::row_names) = arrow::r::short_row_names(n); + out.attr(R_NamesSymbol) = colnames; + out.attr(R_ClassSymbol) = arrow::r::data::classes_tbl_df; - IntegerVector rn(2); - rn[0] = NA_INTEGER; - rn[1] = -n; - Rf_setAttrib(out, symbols::row_names, rn); - Rf_setAttrib(out, R_NamesSymbol, colnames); - Rf_setAttrib(out, R_ClassSymbol, - Rcpp::CharacterVector::create("tbl_df", "tbl", "data.frame")); return out; } @@ -615,49 +659,29 @@ class Converter_Date64 : public Converter { explicit Converter_Date64(const ArrayVector& arrays) : Converter(arrays) {} SEXP Allocate(R_xlen_t n) const { - Rcpp::NumericVector data(no_init(n)); + cpp11::writable::doubles data(n); Rf_classgets(data, arrow::r::data::classes_POSIXct); return data; } Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const { - return AllNull_Ingest(data, start, n); - } - - Status Ingest_some_nulls(SEXP data, const std::shared_ptr& array, - R_xlen_t start, R_xlen_t n, size_t chunk_index) const { - auto convert = [](int64_t ms) { return static_cast(ms / 1000); }; - return SomeNull_Ingest( - data, start, n, array->data()->GetValues(1), array, convert); - } -}; - -template -class Converter_Promotion : public Converter { - using r_stored_type = typename Rcpp::Vector::stored_type; - using value_type = typename TypeTraits::ArrayType::value_type; - - public: - explicit Converter_Promotion(const ArrayVector& arrays) : Converter(arrays) {} - - SEXP Allocate(R_xlen_t n) const { - return Rcpp::Vector(no_init(n)); - } - - Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const { - return AllNull_Ingest(data, start, n); + std::fill_n(REAL(data) + start, n, NA_REAL); + return Status::OK(); } Status Ingest_some_nulls(SEXP data, const std::shared_ptr& array, R_xlen_t start, R_xlen_t n, size_t chunk_index) const { - auto convert = [](value_type value) { return static_cast(value); }; - return SomeNull_Ingest( - data, start, n, array->data()->GetValues(1), array, convert); - } - - private: - static r_stored_type value_convert(value_type value) { - return static_cast(value); + auto p_data = REAL(data) + start; + auto p_values = array->data()->GetValues(1); + auto ingest_one = [&](R_xlen_t i) { + p_data[i] = static_cast(p_values[i] / 1000); + return Status::OK(); + }; + auto null_one = [&](R_xlen_t i) { + p_data[i] = NA_REAL; + return Status::OK(); + }; + return IngestSome(array, n, ingest_one, null_one); } }; @@ -667,25 +691,34 @@ class Converter_Time : public Converter { explicit Converter_Time(const ArrayVector& arrays) : Converter(arrays) {} SEXP Allocate(R_xlen_t n) const { - Rcpp::NumericVector data(no_init(n)); - data.attr("class") = Rcpp::CharacterVector::create("hms", "difftime"); + cpp11::writable::doubles data(n); + data.attr("class") = cpp11::writable::strings({"hms", "difftime"}); + // hms difftime is always stored as "seconds" - data.attr("units") = Rcpp::CharacterVector::create("secs"); + data.attr("units") = cpp11::writable::strings({"secs"}); return data; } Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const { - return AllNull_Ingest(data, start, n); + std::fill_n(REAL(data) + start, n, NA_REAL); + return Status::OK(); } Status Ingest_some_nulls(SEXP data, const std::shared_ptr& array, R_xlen_t start, R_xlen_t n, size_t chunk_index) const { int multiplier = TimeUnit_multiplier(array); - auto convert = [=](value_type value) { - return static_cast(value) / multiplier; + + auto p_data = REAL(data) + start; + auto p_values = array->data()->GetValues(1); + auto ingest_one = [&](R_xlen_t i) { + p_data[i] = static_cast(p_values[i]) / multiplier; + return Status::OK(); + }; + auto null_one = [&](R_xlen_t i) { + p_data[i] = NA_REAL; + return Status::OK(); }; - return SomeNull_Ingest( - data, start, n, array->data()->GetValues(1), array, convert); + return IngestSome(array, n, ingest_one, null_one); } private: @@ -713,7 +746,7 @@ class Converter_Timestamp : public Converter_Time { : Converter_Time(arrays) {} SEXP Allocate(R_xlen_t n) const { - Rcpp::NumericVector data(no_init(n)); + cpp11::writable::doubles data(n); Rf_classgets(data, arrow::r::data::classes_POSIXct); auto array = checked_cast(this->arrays_[0].get()); auto array_type = checked_cast(array->type().get()); @@ -729,32 +762,28 @@ class Converter_Decimal : public Converter { public: explicit Converter_Decimal(const ArrayVector& arrays) : Converter(arrays) {} - SEXP Allocate(R_xlen_t n) const { return Rcpp::NumericVector_(no_init(n)); } + SEXP Allocate(R_xlen_t n) const { return Rf_allocVector(REALSXP, n); } Status Ingest_all_nulls(SEXP data, R_xlen_t start, R_xlen_t n) const { - return AllNull_Ingest(data, start, n); + std::fill_n(REAL(data) + start, n, NA_REAL); + return Status::OK(); } Status Ingest_some_nulls(SEXP data, const std::shared_ptr& array, R_xlen_t start, R_xlen_t n, size_t chunk_index) const { - auto p_data = Rcpp::internal::r_vector_start(data) + start; + auto p_data = REAL(data) + start; const auto& decimals_arr = checked_cast(*array); - if (array->null_count()) { - internal::BitmapReader bitmap_reader(array->null_bitmap()->data(), array->offset(), - n); - - for (R_xlen_t i = 0; i < n; i++, bitmap_reader.Next(), ++p_data) { - *p_data = bitmap_reader.IsSet() ? std::stod(decimals_arr.FormatValue(i).c_str()) - : NA_REAL; - } - } else { - for (R_xlen_t i = 0; i < n; i++, ++p_data) { - *p_data = std::stod(decimals_arr.FormatValue(i).c_str()); - } - } + auto ingest_one = [&](R_xlen_t i) { + p_data[i] = std::stod(decimals_arr.FormatValue(i).c_str()); + return Status::OK(); + }; + auto null_one = [&](R_xlen_t i) { + p_data[i] = NA_REAL; + return Status::OK(); + }; - return Status::OK(); + return IngestSome(array, n, ingest_one, null_one); } }; @@ -769,12 +798,10 @@ class Converter_List : public Converter { : Converter(arrays), value_type_(value_type) {} SEXP Allocate(R_xlen_t n) const { - Rcpp::List res(no_init(n)); - if (std::is_same::value) { - Rf_setAttrib(res, R_ClassSymbol, arrow::r::data::classes_arrow_list); - } else { - Rf_setAttrib(res, R_ClassSymbol, arrow::r::data::classes_arrow_large_list); - } + cpp11::writable::list res(n); + res.attr(R_ClassSymbol) = std::is_same::value + ? arrow::r::data::classes_arrow_list + : arrow::r::data::classes_arrow_large_list; // Build an empty array to match value_type std::unique_ptr builder; @@ -784,8 +811,7 @@ class Converter_List : public Converter { StopIfNotOk(builder->Finish(&array)); // convert to an R object to store as the list' ptype - SEXP ptype = Array__as_vector(array); - Rf_setAttrib(res, arrow::r::symbols::ptype, ptype); + res.attr(arrow::r::symbols::ptype) = Array__as_vector(array); return res; } @@ -824,9 +850,9 @@ class Converter_FixedSizeList : public Converter { : Converter(arrays), value_type_(value_type), list_size_(list_size) {} SEXP Allocate(R_xlen_t n) const { - Rcpp::List res(no_init(n)); + cpp11::writable::list res(n); Rf_classgets(res, arrow::r::data::classes_arrow_fixed_size_list); - Rf_setAttrib(res, arrow::r::symbols::list_size, Rf_ScalarInteger(list_size_)); + res.attr(arrow::r::symbols::list_size) = Rf_ScalarInteger(list_size_); // Build an empty array to match value_type std::unique_ptr builder; @@ -836,8 +862,7 @@ class Converter_FixedSizeList : public Converter { StopIfNotOk(builder->Finish(&array)); // convert to an R object to store as the list' ptype - SEXP ptype = Array__as_vector(array); - Rf_setAttrib(res, arrow::r::symbols::ptype, ptype); + res.attr(arrow::r::symbols::ptype) = Array__as_vector(array); return res; } @@ -868,7 +893,7 @@ class Converter_Int64 : public Converter { explicit Converter_Int64(const ArrayVector& arrays) : Converter(arrays) {} SEXP Allocate(R_xlen_t n) const { - Rcpp::NumericVector data(no_init(n)); + cpp11::writable::doubles data(n); data.attr("class") = "integer64"; return data; } @@ -907,8 +932,10 @@ class Converter_Null : public Converter { explicit Converter_Null(const ArrayVector& arrays) : Converter(arrays) {} SEXP Allocate(R_xlen_t n) const { - Rcpp::LogicalVector data(n, NA_LOGICAL); - data.attr("class") = "vctrs_unspecified"; + SEXP data = PROTECT(Rf_allocVector(LGLSXP, n)); + std::fill_n(LOGICAL(data), n, NA_LOGICAL); + Rf_classgets(data, Rf_mkString("vctrs_unspecified")); + UNPROTECT(1); return data; } @@ -944,10 +971,11 @@ std::shared_ptr Converter::Make(const std::shared_ptr& type switch (type->id()) { // direct support case Type::INT32: - return std::make_shared>(std::move(arrays)); + return std::make_shared>( + std::move(arrays)); case Type::DOUBLE: - return std::make_shared>( + return std::make_shared>( std::move(arrays)); // need to handle 1-bit case @@ -987,47 +1015,46 @@ std::shared_ptr Converter::Make(const std::shared_ptr& type // promotions to integer vector case Type::INT8: - return std::make_shared>( + return std::make_shared>( std::move(arrays)); case Type::UINT8: - return std::make_shared>( + return std::make_shared>( std::move(arrays)); case Type::INT16: - return std::make_shared>( + return std::make_shared>( std::move(arrays)); case Type::UINT16: - return std::make_shared>( + return std::make_shared>( std::move(arrays)); // promotions to numeric vector, if they don't fit into int32 case Type::UINT32: if (ArraysCanFitInteger(arrays)) { - return std::make_shared>( + return std::make_shared>( std::move(arrays)); } else { - return std::make_shared< - arrow::r::Converter_Promotion>(std::move(arrays)); + return std::make_shared>( + std::move(arrays)); } case Type::UINT64: if (ArraysCanFitInteger(arrays)) { - return std::make_shared>( + return std::make_shared>( std::move(arrays)); } else { - return std::make_shared< - arrow::r::Converter_Promotion>(std::move(arrays)); + return std::make_shared>( + std::move(arrays)); } case Type::HALF_FLOAT: - return std::make_shared< - arrow::r::Converter_Promotion>( + return std::make_shared>( std::move(arrays)); case Type::FLOAT: - return std::make_shared>( + return std::make_shared>( std::move(arrays)); // time32 and time64 @@ -1043,7 +1070,7 @@ std::shared_ptr Converter::Make(const std::shared_ptr& type case Type::INT64: // Prefer integer if it fits if (ArraysCanFitInteger(arrays)) { - return std::make_shared>( + return std::make_shared>( std::move(arrays)); } else { return std::make_shared(std::move(arrays)); @@ -1079,29 +1106,27 @@ std::shared_ptr Converter::Make(const std::shared_ptr& type break; } - Rcpp::stop(tfm::format("cannot handle Array of type %s", type->name())); - return nullptr; + cpp11::stop("cannot handle Array of type ", type->name().c_str()); } -Rcpp::List to_dataframe_serial( - int64_t nr, int64_t nc, const Rcpp::CharacterVector& names, +cpp11::writable::list to_dataframe_serial( + int64_t nr, int64_t nc, const cpp11::writable::strings& names, const std::vector>& converters) { - Rcpp::List tbl(nc); - + cpp11::writable::list tbl(nc); for (int i = 0; i < nc; i++) { SEXP column = tbl[i] = converters[i]->Allocate(nr); StopIfNotOk(converters[i]->IngestSerial(column)); } - tbl.attr("names") = names; - tbl.attr("class") = Rcpp::CharacterVector::create("tbl_df", "tbl", "data.frame"); - tbl.attr("row.names") = Rcpp::IntegerVector::create(NA_INTEGER, -nr); + tbl.attr(R_NamesSymbol) = names; + tbl.attr(R_ClassSymbol) = arrow::r::data::classes_tbl_df; + tbl.attr(R_RowNamesSymbol) = arrow::r::short_row_names(nr); return tbl; } -Rcpp::List to_dataframe_parallel( - int64_t nr, int64_t nc, const Rcpp::CharacterVector& names, +cpp11::writable::list to_dataframe_parallel( + int64_t nr, int64_t nc, const cpp11::writable::strings& names, const std::vector>& converters) { - Rcpp::List tbl(nc); + cpp11::writable::list tbl(nc); // task group to ingest data in parallel auto tg = arrow::internal::TaskGroup::MakeThreaded(arrow::internal::GetCpuThreadPool()); @@ -1133,9 +1158,9 @@ Rcpp::List to_dataframe_parallel( StopIfNotOk(status); - tbl.attr("names") = names; - tbl.attr("class") = Rcpp::CharacterVector::create("tbl_df", "tbl", "data.frame"); - tbl.attr("row.names") = IntegerVector::create(NA_INTEGER, -nr); + tbl.attr(R_NamesSymbol) = names; + tbl.attr(R_ClassSymbol) = arrow::r::data::classes_tbl_df; + tbl.attr(R_RowNamesSymbol) = arrow::r::short_row_names(nr); return tbl; } @@ -1155,16 +1180,16 @@ SEXP ChunkedArray__as_vector(const std::shared_ptr& chunked } // [[arrow::export]] -Rcpp::List RecordBatch__to_dataframe(const std::shared_ptr& batch, - bool use_threads) { +cpp11::writable::list RecordBatch__to_dataframe( + const std::shared_ptr& batch, bool use_threads) { int64_t nc = batch->num_columns(); int64_t nr = batch->num_rows(); - Rcpp::CharacterVector names(nc); + cpp11::writable::strings names(nc); std::vector arrays(nc); std::vector> converters(nc); - for (int64_t i = 0; i < nc; i++) { - names[i] = Rcpp::String(batch->column_name(i), CE_UTF8); + for (R_xlen_t i = 0; i < nc; i++) { + names[i] = batch->column_name(i); arrays[i] = {batch->column(i)}; converters[i] = arrow::r::Converter::Make(batch->column(i)->type(), arrays[i]); } @@ -1177,17 +1202,17 @@ Rcpp::List RecordBatch__to_dataframe(const std::shared_ptr& } // [[arrow::export]] -Rcpp::List Table__to_dataframe(const std::shared_ptr& table, - bool use_threads) { +cpp11::writable::list Table__to_dataframe(const std::shared_ptr& table, + bool use_threads) { int64_t nc = table->num_columns(); int64_t nr = table->num_rows(); - Rcpp::CharacterVector names(nc); + cpp11::writable::strings names(nc); std::vector> converters(nc); - for (int64_t i = 0; i < nc; i++) { + for (R_xlen_t i = 0; i < nc; i++) { converters[i] = arrow::r::Converter::Make(table->column(i)->type(), table->column(i)->chunks()); - names[i] = Rcpp::String(table->field(i)->name(), CE_UTF8); + names[i] = table->field(i)->name(); } if (use_threads) { diff --git a/r/src/arraydata.cpp b/r/src/arraydata.cpp index c1194d76eeb..a8ee60f36a0 100644 --- a/r/src/arraydata.cpp +++ b/r/src/arraydata.cpp @@ -17,9 +17,6 @@ #include "./arrow_types.h" -using Rcpp::List; -using Rcpp::wrap; - #if defined(ARROW_R_WITH_ARROW) #include @@ -45,8 +42,8 @@ int ArrayData__get_offset(const std::shared_ptr& x) { } // [[arrow::export]] -List ArrayData__buffers(const std::shared_ptr& x) { - return wrap(x->buffers); +cpp11::list ArrayData__buffers(const std::shared_ptr& x) { + return cpp11::as_sexp(x->buffers); } #endif diff --git a/r/src/arrowExports.cpp b/r/src/arrowExports.cpp index 17f97cb2c96..96d096e1616 100644 --- a/r/src/arrowExports.cpp +++ b/r/src/arrowExports.cpp @@ -1,70 +1,70 @@ // Generated by using data-raw/codegen.R -> do not edit by hand -#include "./arrow_exports.h" -#include +#include +#include -using namespace Rcpp; +#include "./arrow_exports.h" // array.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr Array__Slice1(const std::shared_ptr& array, int offset); -RcppExport SEXP _arrow_Array__Slice1(SEXP array_sexp, SEXP offset_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter::type offset(offset_sexp); - return Rcpp::wrap(Array__Slice1(array, offset)); -END_RCPP +std::shared_ptr Array__Slice1(const std::shared_ptr& array, R_xlen_t offset); +extern "C" SEXP _arrow_Array__Slice1(SEXP array_sexp, SEXP offset_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input::type offset(offset_sexp); + return cpp11::as_sexp(Array__Slice1(array, offset)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__Slice1(SEXP array_sexp, SEXP offset_sexp){ +extern "C" SEXP _arrow_Array__Slice1(SEXP array_sexp, SEXP offset_sexp){ Rf_error("Cannot call Array__Slice1(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // array.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr Array__Slice2(const std::shared_ptr& array, int offset, int length); -RcppExport SEXP _arrow_Array__Slice2(SEXP array_sexp, SEXP offset_sexp, SEXP length_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter::type offset(offset_sexp); - Rcpp::traits::input_parameter::type length(length_sexp); - return Rcpp::wrap(Array__Slice2(array, offset, length)); -END_RCPP +std::shared_ptr Array__Slice2(const std::shared_ptr& array, R_xlen_t offset, R_xlen_t length); +extern "C" SEXP _arrow_Array__Slice2(SEXP array_sexp, SEXP offset_sexp, SEXP length_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input::type offset(offset_sexp); + arrow::r::Input::type length(length_sexp); + return cpp11::as_sexp(Array__Slice2(array, offset, length)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__Slice2(SEXP array_sexp, SEXP offset_sexp, SEXP length_sexp){ +extern "C" SEXP _arrow_Array__Slice2(SEXP array_sexp, SEXP offset_sexp, SEXP length_sexp){ Rf_error("Cannot call Array__Slice2(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // array.cpp #if defined(ARROW_R_WITH_ARROW) -bool Array__IsNull(const std::shared_ptr& x, int i); -RcppExport SEXP _arrow_Array__IsNull(SEXP x_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(Array__IsNull(x, i)); -END_RCPP +bool Array__IsNull(const std::shared_ptr& x, R_xlen_t i); +extern "C" SEXP _arrow_Array__IsNull(SEXP x_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(Array__IsNull(x, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__IsNull(SEXP x_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_Array__IsNull(SEXP x_sexp, SEXP i_sexp){ Rf_error("Cannot call Array__IsNull(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // array.cpp #if defined(ARROW_R_WITH_ARROW) -bool Array__IsValid(const std::shared_ptr& x, int i); -RcppExport SEXP _arrow_Array__IsValid(SEXP x_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(Array__IsValid(x, i)); -END_RCPP +bool Array__IsValid(const std::shared_ptr& x, R_xlen_t i); +extern "C" SEXP _arrow_Array__IsValid(SEXP x_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(Array__IsValid(x, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__IsValid(SEXP x_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_Array__IsValid(SEXP x_sexp, SEXP i_sexp){ Rf_error("Cannot call Array__IsValid(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -72,14 +72,14 @@ RcppExport SEXP _arrow_Array__IsValid(SEXP x_sexp, SEXP i_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) int Array__length(const std::shared_ptr& x); -RcppExport SEXP _arrow_Array__length(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(Array__length(x)); -END_RCPP +extern "C" SEXP _arrow_Array__length(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(Array__length(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__length(SEXP x_sexp){ +extern "C" SEXP _arrow_Array__length(SEXP x_sexp){ Rf_error("Cannot call Array__length(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -87,14 +87,14 @@ RcppExport SEXP _arrow_Array__length(SEXP x_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) int Array__offset(const std::shared_ptr& x); -RcppExport SEXP _arrow_Array__offset(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(Array__offset(x)); -END_RCPP +extern "C" SEXP _arrow_Array__offset(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(Array__offset(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__offset(SEXP x_sexp){ +extern "C" SEXP _arrow_Array__offset(SEXP x_sexp){ Rf_error("Cannot call Array__offset(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -102,14 +102,14 @@ RcppExport SEXP _arrow_Array__offset(SEXP x_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) int Array__null_count(const std::shared_ptr& x); -RcppExport SEXP _arrow_Array__null_count(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(Array__null_count(x)); -END_RCPP +extern "C" SEXP _arrow_Array__null_count(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(Array__null_count(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__null_count(SEXP x_sexp){ +extern "C" SEXP _arrow_Array__null_count(SEXP x_sexp){ Rf_error("Cannot call Array__null_count(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -117,14 +117,14 @@ RcppExport SEXP _arrow_Array__null_count(SEXP x_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Array__type(const std::shared_ptr& x); -RcppExport SEXP _arrow_Array__type(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(Array__type(x)); -END_RCPP +extern "C" SEXP _arrow_Array__type(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(Array__type(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__type(SEXP x_sexp){ +extern "C" SEXP _arrow_Array__type(SEXP x_sexp){ Rf_error("Cannot call Array__type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -132,14 +132,14 @@ RcppExport SEXP _arrow_Array__type(SEXP x_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) std::string Array__ToString(const std::shared_ptr& x); -RcppExport SEXP _arrow_Array__ToString(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(Array__ToString(x)); -END_RCPP +extern "C" SEXP _arrow_Array__ToString(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(Array__ToString(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__ToString(SEXP x_sexp){ +extern "C" SEXP _arrow_Array__ToString(SEXP x_sexp){ Rf_error("Cannot call Array__ToString(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -147,14 +147,14 @@ RcppExport SEXP _arrow_Array__ToString(SEXP x_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) arrow::Type::type Array__type_id(const std::shared_ptr& x); -RcppExport SEXP _arrow_Array__type_id(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(Array__type_id(x)); -END_RCPP +extern "C" SEXP _arrow_Array__type_id(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(Array__type_id(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__type_id(SEXP x_sexp){ +extern "C" SEXP _arrow_Array__type_id(SEXP x_sexp){ Rf_error("Cannot call Array__type_id(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -162,15 +162,15 @@ RcppExport SEXP _arrow_Array__type_id(SEXP x_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) bool Array__Equals(const std::shared_ptr& lhs, const std::shared_ptr& rhs); -RcppExport SEXP _arrow_Array__Equals(SEXP lhs_sexp, SEXP rhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - return Rcpp::wrap(Array__Equals(lhs, rhs)); -END_RCPP +extern "C" SEXP _arrow_Array__Equals(SEXP lhs_sexp, SEXP rhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + return cpp11::as_sexp(Array__Equals(lhs, rhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__Equals(SEXP lhs_sexp, SEXP rhs_sexp){ +extern "C" SEXP _arrow_Array__Equals(SEXP lhs_sexp, SEXP rhs_sexp){ Rf_error("Cannot call Array__Equals(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -178,15 +178,15 @@ RcppExport SEXP _arrow_Array__Equals(SEXP lhs_sexp, SEXP rhs_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) bool Array__ApproxEquals(const std::shared_ptr& lhs, const std::shared_ptr& rhs); -RcppExport SEXP _arrow_Array__ApproxEquals(SEXP lhs_sexp, SEXP rhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - return Rcpp::wrap(Array__ApproxEquals(lhs, rhs)); -END_RCPP +extern "C" SEXP _arrow_Array__ApproxEquals(SEXP lhs_sexp, SEXP rhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + return cpp11::as_sexp(Array__ApproxEquals(lhs, rhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__ApproxEquals(SEXP lhs_sexp, SEXP rhs_sexp){ +extern "C" SEXP _arrow_Array__ApproxEquals(SEXP lhs_sexp, SEXP rhs_sexp){ Rf_error("Cannot call Array__ApproxEquals(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -194,33 +194,33 @@ RcppExport SEXP _arrow_Array__ApproxEquals(SEXP lhs_sexp, SEXP rhs_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Array__data(const std::shared_ptr& array); -RcppExport SEXP _arrow_Array__data(SEXP array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - return Rcpp::wrap(Array__data(array)); -END_RCPP +extern "C" SEXP _arrow_Array__data(SEXP array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + return cpp11::as_sexp(Array__data(array)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__data(SEXP array_sexp){ +extern "C" SEXP _arrow_Array__data(SEXP array_sexp){ Rf_error("Cannot call Array__data(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // array.cpp #if defined(ARROW_R_WITH_ARROW) -bool Array__RangeEquals(const std::shared_ptr& self, const std::shared_ptr& other, int start_idx, int end_idx, int other_start_idx); -RcppExport SEXP _arrow_Array__RangeEquals(SEXP self_sexp, SEXP other_sexp, SEXP start_idx_sexp, SEXP end_idx_sexp, SEXP other_start_idx_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type self(self_sexp); - Rcpp::traits::input_parameter&>::type other(other_sexp); - Rcpp::traits::input_parameter::type start_idx(start_idx_sexp); - Rcpp::traits::input_parameter::type end_idx(end_idx_sexp); - Rcpp::traits::input_parameter::type other_start_idx(other_start_idx_sexp); - return Rcpp::wrap(Array__RangeEquals(self, other, start_idx, end_idx, other_start_idx)); -END_RCPP +bool Array__RangeEquals(const std::shared_ptr& self, const std::shared_ptr& other, R_xlen_t start_idx, R_xlen_t end_idx, R_xlen_t other_start_idx); +extern "C" SEXP _arrow_Array__RangeEquals(SEXP self_sexp, SEXP other_sexp, SEXP start_idx_sexp, SEXP end_idx_sexp, SEXP other_start_idx_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type self(self_sexp); + arrow::r::Input&>::type other(other_sexp); + arrow::r::Input::type start_idx(start_idx_sexp); + arrow::r::Input::type end_idx(end_idx_sexp); + arrow::r::Input::type other_start_idx(other_start_idx_sexp); + return cpp11::as_sexp(Array__RangeEquals(self, other, start_idx, end_idx, other_start_idx)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__RangeEquals(SEXP self_sexp, SEXP other_sexp, SEXP start_idx_sexp, SEXP end_idx_sexp, SEXP other_start_idx_sexp){ +extern "C" SEXP _arrow_Array__RangeEquals(SEXP self_sexp, SEXP other_sexp, SEXP start_idx_sexp, SEXP end_idx_sexp, SEXP other_start_idx_sexp){ Rf_error("Cannot call Array__RangeEquals(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -228,15 +228,15 @@ RcppExport SEXP _arrow_Array__RangeEquals(SEXP self_sexp, SEXP other_sexp, SEXP // array.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Array__View(const std::shared_ptr& array, const std::shared_ptr& type); -RcppExport SEXP _arrow_Array__View(SEXP array_sexp, SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(Array__View(array, type)); -END_RCPP +extern "C" SEXP _arrow_Array__View(SEXP array_sexp, SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(Array__View(array, type)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__View(SEXP array_sexp, SEXP type_sexp){ +extern "C" SEXP _arrow_Array__View(SEXP array_sexp, SEXP type_sexp){ Rf_error("Cannot call Array__View(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -244,15 +244,15 @@ RcppExport SEXP _arrow_Array__View(SEXP array_sexp, SEXP type_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) void Array__Validate(const std::shared_ptr& array); -RcppExport SEXP _arrow_Array__Validate(SEXP array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); +extern "C" SEXP _arrow_Array__Validate(SEXP array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); Array__Validate(array); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_Array__Validate(SEXP array_sexp){ +extern "C" SEXP _arrow_Array__Validate(SEXP array_sexp){ Rf_error("Cannot call Array__Validate(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -260,14 +260,14 @@ RcppExport SEXP _arrow_Array__Validate(SEXP array_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr DictionaryArray__indices(const std::shared_ptr& array); -RcppExport SEXP _arrow_DictionaryArray__indices(SEXP array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - return Rcpp::wrap(DictionaryArray__indices(array)); -END_RCPP +extern "C" SEXP _arrow_DictionaryArray__indices(SEXP array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + return cpp11::as_sexp(DictionaryArray__indices(array)); +END_CPP11 } #else -RcppExport SEXP _arrow_DictionaryArray__indices(SEXP array_sexp){ +extern "C" SEXP _arrow_DictionaryArray__indices(SEXP array_sexp){ Rf_error("Cannot call DictionaryArray__indices(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -275,14 +275,14 @@ RcppExport SEXP _arrow_DictionaryArray__indices(SEXP array_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr DictionaryArray__dictionary(const std::shared_ptr& array); -RcppExport SEXP _arrow_DictionaryArray__dictionary(SEXP array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - return Rcpp::wrap(DictionaryArray__dictionary(array)); -END_RCPP +extern "C" SEXP _arrow_DictionaryArray__dictionary(SEXP array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + return cpp11::as_sexp(DictionaryArray__dictionary(array)); +END_CPP11 } #else -RcppExport SEXP _arrow_DictionaryArray__dictionary(SEXP array_sexp){ +extern "C" SEXP _arrow_DictionaryArray__dictionary(SEXP array_sexp){ Rf_error("Cannot call DictionaryArray__dictionary(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -290,15 +290,15 @@ RcppExport SEXP _arrow_DictionaryArray__dictionary(SEXP array_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr StructArray__field(const std::shared_ptr& array, int i); -RcppExport SEXP _arrow_StructArray__field(SEXP array_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(StructArray__field(array, i)); -END_RCPP +extern "C" SEXP _arrow_StructArray__field(SEXP array_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(StructArray__field(array, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_StructArray__field(SEXP array_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_StructArray__field(SEXP array_sexp, SEXP i_sexp){ Rf_error("Cannot call StructArray__field(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -306,15 +306,15 @@ RcppExport SEXP _arrow_StructArray__field(SEXP array_sexp, SEXP i_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr StructArray__GetFieldByName(const std::shared_ptr& array, const std::string& name); -RcppExport SEXP _arrow_StructArray__GetFieldByName(SEXP array_sexp, SEXP name_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter::type name(name_sexp); - return Rcpp::wrap(StructArray__GetFieldByName(array, name)); -END_RCPP +extern "C" SEXP _arrow_StructArray__GetFieldByName(SEXP array_sexp, SEXP name_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input::type name(name_sexp); + return cpp11::as_sexp(StructArray__GetFieldByName(array, name)); +END_CPP11 } #else -RcppExport SEXP _arrow_StructArray__GetFieldByName(SEXP array_sexp, SEXP name_sexp){ +extern "C" SEXP _arrow_StructArray__GetFieldByName(SEXP array_sexp, SEXP name_sexp){ Rf_error("Cannot call StructArray__GetFieldByName(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -322,14 +322,14 @@ RcppExport SEXP _arrow_StructArray__GetFieldByName(SEXP array_sexp, SEXP name_se // array.cpp #if defined(ARROW_R_WITH_ARROW) arrow::ArrayVector StructArray__Flatten(const std::shared_ptr& array); -RcppExport SEXP _arrow_StructArray__Flatten(SEXP array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - return Rcpp::wrap(StructArray__Flatten(array)); -END_RCPP +extern "C" SEXP _arrow_StructArray__Flatten(SEXP array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + return cpp11::as_sexp(StructArray__Flatten(array)); +END_CPP11 } #else -RcppExport SEXP _arrow_StructArray__Flatten(SEXP array_sexp){ +extern "C" SEXP _arrow_StructArray__Flatten(SEXP array_sexp){ Rf_error("Cannot call StructArray__Flatten(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -337,14 +337,14 @@ RcppExport SEXP _arrow_StructArray__Flatten(SEXP array_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ListArray__value_type(const std::shared_ptr& array); -RcppExport SEXP _arrow_ListArray__value_type(SEXP array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - return Rcpp::wrap(ListArray__value_type(array)); -END_RCPP +extern "C" SEXP _arrow_ListArray__value_type(SEXP array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + return cpp11::as_sexp(ListArray__value_type(array)); +END_CPP11 } #else -RcppExport SEXP _arrow_ListArray__value_type(SEXP array_sexp){ +extern "C" SEXP _arrow_ListArray__value_type(SEXP array_sexp){ Rf_error("Cannot call ListArray__value_type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -352,14 +352,14 @@ RcppExport SEXP _arrow_ListArray__value_type(SEXP array_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr LargeListArray__value_type(const std::shared_ptr& array); -RcppExport SEXP _arrow_LargeListArray__value_type(SEXP array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - return Rcpp::wrap(LargeListArray__value_type(array)); -END_RCPP +extern "C" SEXP _arrow_LargeListArray__value_type(SEXP array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + return cpp11::as_sexp(LargeListArray__value_type(array)); +END_CPP11 } #else -RcppExport SEXP _arrow_LargeListArray__value_type(SEXP array_sexp){ +extern "C" SEXP _arrow_LargeListArray__value_type(SEXP array_sexp){ Rf_error("Cannot call LargeListArray__value_type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -367,14 +367,14 @@ RcppExport SEXP _arrow_LargeListArray__value_type(SEXP array_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ListArray__values(const std::shared_ptr& array); -RcppExport SEXP _arrow_ListArray__values(SEXP array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - return Rcpp::wrap(ListArray__values(array)); -END_RCPP +extern "C" SEXP _arrow_ListArray__values(SEXP array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + return cpp11::as_sexp(ListArray__values(array)); +END_CPP11 } #else -RcppExport SEXP _arrow_ListArray__values(SEXP array_sexp){ +extern "C" SEXP _arrow_ListArray__values(SEXP array_sexp){ Rf_error("Cannot call ListArray__values(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -382,14 +382,14 @@ RcppExport SEXP _arrow_ListArray__values(SEXP array_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr LargeListArray__values(const std::shared_ptr& array); -RcppExport SEXP _arrow_LargeListArray__values(SEXP array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - return Rcpp::wrap(LargeListArray__values(array)); -END_RCPP +extern "C" SEXP _arrow_LargeListArray__values(SEXP array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + return cpp11::as_sexp(LargeListArray__values(array)); +END_CPP11 } #else -RcppExport SEXP _arrow_LargeListArray__values(SEXP array_sexp){ +extern "C" SEXP _arrow_LargeListArray__values(SEXP array_sexp){ Rf_error("Cannot call LargeListArray__values(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -397,15 +397,15 @@ RcppExport SEXP _arrow_LargeListArray__values(SEXP array_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) int32_t ListArray__value_length(const std::shared_ptr& array, int64_t i); -RcppExport SEXP _arrow_ListArray__value_length(SEXP array_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(ListArray__value_length(array, i)); -END_RCPP +extern "C" SEXP _arrow_ListArray__value_length(SEXP array_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(ListArray__value_length(array, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_ListArray__value_length(SEXP array_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_ListArray__value_length(SEXP array_sexp, SEXP i_sexp){ Rf_error("Cannot call ListArray__value_length(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -413,15 +413,15 @@ RcppExport SEXP _arrow_ListArray__value_length(SEXP array_sexp, SEXP i_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) int64_t LargeListArray__value_length(const std::shared_ptr& array, int64_t i); -RcppExport SEXP _arrow_LargeListArray__value_length(SEXP array_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(LargeListArray__value_length(array, i)); -END_RCPP +extern "C" SEXP _arrow_LargeListArray__value_length(SEXP array_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(LargeListArray__value_length(array, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_LargeListArray__value_length(SEXP array_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_LargeListArray__value_length(SEXP array_sexp, SEXP i_sexp){ Rf_error("Cannot call LargeListArray__value_length(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -429,15 +429,15 @@ RcppExport SEXP _arrow_LargeListArray__value_length(SEXP array_sexp, SEXP i_sexp // array.cpp #if defined(ARROW_R_WITH_ARROW) int64_t FixedSizeListArray__value_length(const std::shared_ptr& array, int64_t i); -RcppExport SEXP _arrow_FixedSizeListArray__value_length(SEXP array_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(FixedSizeListArray__value_length(array, i)); -END_RCPP +extern "C" SEXP _arrow_FixedSizeListArray__value_length(SEXP array_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(FixedSizeListArray__value_length(array, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_FixedSizeListArray__value_length(SEXP array_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_FixedSizeListArray__value_length(SEXP array_sexp, SEXP i_sexp){ Rf_error("Cannot call FixedSizeListArray__value_length(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -445,15 +445,15 @@ RcppExport SEXP _arrow_FixedSizeListArray__value_length(SEXP array_sexp, SEXP i_ // array.cpp #if defined(ARROW_R_WITH_ARROW) int32_t ListArray__value_offset(const std::shared_ptr& array, int64_t i); -RcppExport SEXP _arrow_ListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(ListArray__value_offset(array, i)); -END_RCPP +extern "C" SEXP _arrow_ListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(ListArray__value_offset(array, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_ListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_ListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ Rf_error("Cannot call ListArray__value_offset(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -461,15 +461,15 @@ RcppExport SEXP _arrow_ListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ // array.cpp #if defined(ARROW_R_WITH_ARROW) int64_t LargeListArray__value_offset(const std::shared_ptr& array, int64_t i); -RcppExport SEXP _arrow_LargeListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(LargeListArray__value_offset(array, i)); -END_RCPP +extern "C" SEXP _arrow_LargeListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(LargeListArray__value_offset(array, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_LargeListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_LargeListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ Rf_error("Cannot call LargeListArray__value_offset(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -477,45 +477,45 @@ RcppExport SEXP _arrow_LargeListArray__value_offset(SEXP array_sexp, SEXP i_sexp // array.cpp #if defined(ARROW_R_WITH_ARROW) int64_t FixedSizeListArray__value_offset(const std::shared_ptr& array, int64_t i); -RcppExport SEXP _arrow_FixedSizeListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(FixedSizeListArray__value_offset(array, i)); -END_RCPP +extern "C" SEXP _arrow_FixedSizeListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(FixedSizeListArray__value_offset(array, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_FixedSizeListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_FixedSizeListArray__value_offset(SEXP array_sexp, SEXP i_sexp){ Rf_error("Cannot call FixedSizeListArray__value_offset(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // array.cpp #if defined(ARROW_R_WITH_ARROW) -Rcpp::IntegerVector ListArray__raw_value_offsets(const std::shared_ptr& array); -RcppExport SEXP _arrow_ListArray__raw_value_offsets(SEXP array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - return Rcpp::wrap(ListArray__raw_value_offsets(array)); -END_RCPP +cpp11::writable::integers ListArray__raw_value_offsets(const std::shared_ptr& array); +extern "C" SEXP _arrow_ListArray__raw_value_offsets(SEXP array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + return cpp11::as_sexp(ListArray__raw_value_offsets(array)); +END_CPP11 } #else -RcppExport SEXP _arrow_ListArray__raw_value_offsets(SEXP array_sexp){ +extern "C" SEXP _arrow_ListArray__raw_value_offsets(SEXP array_sexp){ Rf_error("Cannot call ListArray__raw_value_offsets(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // array.cpp #if defined(ARROW_R_WITH_ARROW) -Rcpp::IntegerVector LargeListArray__raw_value_offsets(const std::shared_ptr& array); -RcppExport SEXP _arrow_LargeListArray__raw_value_offsets(SEXP array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - return Rcpp::wrap(LargeListArray__raw_value_offsets(array)); -END_RCPP +cpp11::writable::integers LargeListArray__raw_value_offsets(const std::shared_ptr& array); +extern "C" SEXP _arrow_LargeListArray__raw_value_offsets(SEXP array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + return cpp11::as_sexp(LargeListArray__raw_value_offsets(array)); +END_CPP11 } #else -RcppExport SEXP _arrow_LargeListArray__raw_value_offsets(SEXP array_sexp){ +extern "C" SEXP _arrow_LargeListArray__raw_value_offsets(SEXP array_sexp){ Rf_error("Cannot call LargeListArray__raw_value_offsets(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -523,14 +523,14 @@ RcppExport SEXP _arrow_LargeListArray__raw_value_offsets(SEXP array_sexp){ // array_from_vector.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Array__infer_type(SEXP x); -RcppExport SEXP _arrow_Array__infer_type(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type x(x_sexp); - return Rcpp::wrap(Array__infer_type(x)); -END_RCPP +extern "C" SEXP _arrow_Array__infer_type(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input::type x(x_sexp); + return cpp11::as_sexp(Array__infer_type(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__infer_type(SEXP x_sexp){ +extern "C" SEXP _arrow_Array__infer_type(SEXP x_sexp){ Rf_error("Cannot call Array__infer_type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -538,31 +538,31 @@ RcppExport SEXP _arrow_Array__infer_type(SEXP x_sexp){ // array_from_vector.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Array__from_vector(SEXP x, SEXP s_type); -RcppExport SEXP _arrow_Array__from_vector(SEXP x_sexp, SEXP s_type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type x(x_sexp); - Rcpp::traits::input_parameter::type s_type(s_type_sexp); - return Rcpp::wrap(Array__from_vector(x, s_type)); -END_RCPP +extern "C" SEXP _arrow_Array__from_vector(SEXP x_sexp, SEXP s_type_sexp){ +BEGIN_CPP11 + arrow::r::Input::type x(x_sexp); + arrow::r::Input::type s_type(s_type_sexp); + return cpp11::as_sexp(Array__from_vector(x, s_type)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__from_vector(SEXP x_sexp, SEXP s_type_sexp){ +extern "C" SEXP _arrow_Array__from_vector(SEXP x_sexp, SEXP s_type_sexp){ Rf_error("Cannot call Array__from_vector(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // array_from_vector.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr ChunkedArray__from_list(Rcpp::List chunks, SEXP s_type); -RcppExport SEXP _arrow_ChunkedArray__from_list(SEXP chunks_sexp, SEXP s_type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type chunks(chunks_sexp); - Rcpp::traits::input_parameter::type s_type(s_type_sexp); - return Rcpp::wrap(ChunkedArray__from_list(chunks, s_type)); -END_RCPP +std::shared_ptr ChunkedArray__from_list(cpp11::list chunks, SEXP s_type); +extern "C" SEXP _arrow_ChunkedArray__from_list(SEXP chunks_sexp, SEXP s_type_sexp){ +BEGIN_CPP11 + arrow::r::Input::type chunks(chunks_sexp); + arrow::r::Input::type s_type(s_type_sexp); + return cpp11::as_sexp(ChunkedArray__from_list(chunks, s_type)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__from_list(SEXP chunks_sexp, SEXP s_type_sexp){ +extern "C" SEXP _arrow_ChunkedArray__from_list(SEXP chunks_sexp, SEXP s_type_sexp){ Rf_error("Cannot call ChunkedArray__from_list(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -570,16 +570,16 @@ RcppExport SEXP _arrow_ChunkedArray__from_list(SEXP chunks_sexp, SEXP s_type_sex // array_from_vector.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr DictionaryArray__FromArrays(const std::shared_ptr& type, const std::shared_ptr& indices, const std::shared_ptr& dict); -RcppExport SEXP _arrow_DictionaryArray__FromArrays(SEXP type_sexp, SEXP indices_sexp, SEXP dict_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - Rcpp::traits::input_parameter&>::type indices(indices_sexp); - Rcpp::traits::input_parameter&>::type dict(dict_sexp); - return Rcpp::wrap(DictionaryArray__FromArrays(type, indices, dict)); -END_RCPP +extern "C" SEXP _arrow_DictionaryArray__FromArrays(SEXP type_sexp, SEXP indices_sexp, SEXP dict_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + arrow::r::Input&>::type indices(indices_sexp); + arrow::r::Input&>::type dict(dict_sexp); + return cpp11::as_sexp(DictionaryArray__FromArrays(type, indices, dict)); +END_CPP11 } #else -RcppExport SEXP _arrow_DictionaryArray__FromArrays(SEXP type_sexp, SEXP indices_sexp, SEXP dict_sexp){ +extern "C" SEXP _arrow_DictionaryArray__FromArrays(SEXP type_sexp, SEXP indices_sexp, SEXP dict_sexp){ Rf_error("Cannot call DictionaryArray__FromArrays(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -587,14 +587,14 @@ RcppExport SEXP _arrow_DictionaryArray__FromArrays(SEXP type_sexp, SEXP indices_ // array_to_vector.cpp #if defined(ARROW_R_WITH_ARROW) SEXP Array__as_vector(const std::shared_ptr& array); -RcppExport SEXP _arrow_Array__as_vector(SEXP array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - return Rcpp::wrap(Array__as_vector(array)); -END_RCPP +extern "C" SEXP _arrow_Array__as_vector(SEXP array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + return cpp11::as_sexp(Array__as_vector(array)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__as_vector(SEXP array_sexp){ +extern "C" SEXP _arrow_Array__as_vector(SEXP array_sexp){ Rf_error("Cannot call Array__as_vector(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -602,46 +602,46 @@ RcppExport SEXP _arrow_Array__as_vector(SEXP array_sexp){ // array_to_vector.cpp #if defined(ARROW_R_WITH_ARROW) SEXP ChunkedArray__as_vector(const std::shared_ptr& chunked_array); -RcppExport SEXP _arrow_ChunkedArray__as_vector(SEXP chunked_array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type chunked_array(chunked_array_sexp); - return Rcpp::wrap(ChunkedArray__as_vector(chunked_array)); -END_RCPP +extern "C" SEXP _arrow_ChunkedArray__as_vector(SEXP chunked_array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type chunked_array(chunked_array_sexp); + return cpp11::as_sexp(ChunkedArray__as_vector(chunked_array)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__as_vector(SEXP chunked_array_sexp){ +extern "C" SEXP _arrow_ChunkedArray__as_vector(SEXP chunked_array_sexp){ Rf_error("Cannot call ChunkedArray__as_vector(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // array_to_vector.cpp #if defined(ARROW_R_WITH_ARROW) -Rcpp::List RecordBatch__to_dataframe(const std::shared_ptr& batch, bool use_threads); -RcppExport SEXP _arrow_RecordBatch__to_dataframe(SEXP batch_sexp, SEXP use_threads_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch(batch_sexp); - Rcpp::traits::input_parameter::type use_threads(use_threads_sexp); - return Rcpp::wrap(RecordBatch__to_dataframe(batch, use_threads)); -END_RCPP +cpp11::writable::list RecordBatch__to_dataframe(const std::shared_ptr& batch, bool use_threads); +extern "C" SEXP _arrow_RecordBatch__to_dataframe(SEXP batch_sexp, SEXP use_threads_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch(batch_sexp); + arrow::r::Input::type use_threads(use_threads_sexp); + return cpp11::as_sexp(RecordBatch__to_dataframe(batch, use_threads)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__to_dataframe(SEXP batch_sexp, SEXP use_threads_sexp){ +extern "C" SEXP _arrow_RecordBatch__to_dataframe(SEXP batch_sexp, SEXP use_threads_sexp){ Rf_error("Cannot call RecordBatch__to_dataframe(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // array_to_vector.cpp #if defined(ARROW_R_WITH_ARROW) -Rcpp::List Table__to_dataframe(const std::shared_ptr& table, bool use_threads); -RcppExport SEXP _arrow_Table__to_dataframe(SEXP table_sexp, SEXP use_threads_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - Rcpp::traits::input_parameter::type use_threads(use_threads_sexp); - return Rcpp::wrap(Table__to_dataframe(table, use_threads)); -END_RCPP +cpp11::writable::list Table__to_dataframe(const std::shared_ptr& table, bool use_threads); +extern "C" SEXP _arrow_Table__to_dataframe(SEXP table_sexp, SEXP use_threads_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + arrow::r::Input::type use_threads(use_threads_sexp); + return cpp11::as_sexp(Table__to_dataframe(table, use_threads)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__to_dataframe(SEXP table_sexp, SEXP use_threads_sexp){ +extern "C" SEXP _arrow_Table__to_dataframe(SEXP table_sexp, SEXP use_threads_sexp){ Rf_error("Cannot call Table__to_dataframe(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -649,14 +649,14 @@ RcppExport SEXP _arrow_Table__to_dataframe(SEXP table_sexp, SEXP use_threads_sex // arraydata.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ArrayData__get_type(const std::shared_ptr& x); -RcppExport SEXP _arrow_ArrayData__get_type(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(ArrayData__get_type(x)); -END_RCPP +extern "C" SEXP _arrow_ArrayData__get_type(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(ArrayData__get_type(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_ArrayData__get_type(SEXP x_sexp){ +extern "C" SEXP _arrow_ArrayData__get_type(SEXP x_sexp){ Rf_error("Cannot call ArrayData__get_type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -664,14 +664,14 @@ RcppExport SEXP _arrow_ArrayData__get_type(SEXP x_sexp){ // arraydata.cpp #if defined(ARROW_R_WITH_ARROW) int ArrayData__get_length(const std::shared_ptr& x); -RcppExport SEXP _arrow_ArrayData__get_length(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(ArrayData__get_length(x)); -END_RCPP +extern "C" SEXP _arrow_ArrayData__get_length(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(ArrayData__get_length(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_ArrayData__get_length(SEXP x_sexp){ +extern "C" SEXP _arrow_ArrayData__get_length(SEXP x_sexp){ Rf_error("Cannot call ArrayData__get_length(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -679,14 +679,14 @@ RcppExport SEXP _arrow_ArrayData__get_length(SEXP x_sexp){ // arraydata.cpp #if defined(ARROW_R_WITH_ARROW) int ArrayData__get_null_count(const std::shared_ptr& x); -RcppExport SEXP _arrow_ArrayData__get_null_count(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(ArrayData__get_null_count(x)); -END_RCPP +extern "C" SEXP _arrow_ArrayData__get_null_count(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(ArrayData__get_null_count(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_ArrayData__get_null_count(SEXP x_sexp){ +extern "C" SEXP _arrow_ArrayData__get_null_count(SEXP x_sexp){ Rf_error("Cannot call ArrayData__get_null_count(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -694,29 +694,29 @@ RcppExport SEXP _arrow_ArrayData__get_null_count(SEXP x_sexp){ // arraydata.cpp #if defined(ARROW_R_WITH_ARROW) int ArrayData__get_offset(const std::shared_ptr& x); -RcppExport SEXP _arrow_ArrayData__get_offset(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(ArrayData__get_offset(x)); -END_RCPP +extern "C" SEXP _arrow_ArrayData__get_offset(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(ArrayData__get_offset(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_ArrayData__get_offset(SEXP x_sexp){ +extern "C" SEXP _arrow_ArrayData__get_offset(SEXP x_sexp){ Rf_error("Cannot call ArrayData__get_offset(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // arraydata.cpp #if defined(ARROW_R_WITH_ARROW) -List ArrayData__buffers(const std::shared_ptr& x); -RcppExport SEXP _arrow_ArrayData__buffers(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(ArrayData__buffers(x)); -END_RCPP +cpp11::list ArrayData__buffers(const std::shared_ptr& x); +extern "C" SEXP _arrow_ArrayData__buffers(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(ArrayData__buffers(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_ArrayData__buffers(SEXP x_sexp){ +extern "C" SEXP _arrow_ArrayData__buffers(SEXP x_sexp){ Rf_error("Cannot call ArrayData__buffers(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -724,14 +724,14 @@ RcppExport SEXP _arrow_ArrayData__buffers(SEXP x_sexp){ // buffer.cpp #if defined(ARROW_R_WITH_ARROW) bool Buffer__is_mutable(const std::shared_ptr& buffer); -RcppExport SEXP _arrow_Buffer__is_mutable(SEXP buffer_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type buffer(buffer_sexp); - return Rcpp::wrap(Buffer__is_mutable(buffer)); -END_RCPP +extern "C" SEXP _arrow_Buffer__is_mutable(SEXP buffer_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type buffer(buffer_sexp); + return cpp11::as_sexp(Buffer__is_mutable(buffer)); +END_CPP11 } #else -RcppExport SEXP _arrow_Buffer__is_mutable(SEXP buffer_sexp){ +extern "C" SEXP _arrow_Buffer__is_mutable(SEXP buffer_sexp){ Rf_error("Cannot call Buffer__is_mutable(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -739,15 +739,15 @@ RcppExport SEXP _arrow_Buffer__is_mutable(SEXP buffer_sexp){ // buffer.cpp #if defined(ARROW_R_WITH_ARROW) void Buffer__ZeroPadding(const std::shared_ptr& buffer); -RcppExport SEXP _arrow_Buffer__ZeroPadding(SEXP buffer_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type buffer(buffer_sexp); +extern "C" SEXP _arrow_Buffer__ZeroPadding(SEXP buffer_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type buffer(buffer_sexp); Buffer__ZeroPadding(buffer); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_Buffer__ZeroPadding(SEXP buffer_sexp){ +extern "C" SEXP _arrow_Buffer__ZeroPadding(SEXP buffer_sexp){ Rf_error("Cannot call Buffer__ZeroPadding(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -755,14 +755,14 @@ RcppExport SEXP _arrow_Buffer__ZeroPadding(SEXP buffer_sexp){ // buffer.cpp #if defined(ARROW_R_WITH_ARROW) int64_t Buffer__capacity(const std::shared_ptr& buffer); -RcppExport SEXP _arrow_Buffer__capacity(SEXP buffer_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type buffer(buffer_sexp); - return Rcpp::wrap(Buffer__capacity(buffer)); -END_RCPP +extern "C" SEXP _arrow_Buffer__capacity(SEXP buffer_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type buffer(buffer_sexp); + return cpp11::as_sexp(Buffer__capacity(buffer)); +END_CPP11 } #else -RcppExport SEXP _arrow_Buffer__capacity(SEXP buffer_sexp){ +extern "C" SEXP _arrow_Buffer__capacity(SEXP buffer_sexp){ Rf_error("Cannot call Buffer__capacity(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -770,14 +770,14 @@ RcppExport SEXP _arrow_Buffer__capacity(SEXP buffer_sexp){ // buffer.cpp #if defined(ARROW_R_WITH_ARROW) int64_t Buffer__size(const std::shared_ptr& buffer); -RcppExport SEXP _arrow_Buffer__size(SEXP buffer_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type buffer(buffer_sexp); - return Rcpp::wrap(Buffer__size(buffer)); -END_RCPP +extern "C" SEXP _arrow_Buffer__size(SEXP buffer_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type buffer(buffer_sexp); + return cpp11::as_sexp(Buffer__size(buffer)); +END_CPP11 } #else -RcppExport SEXP _arrow_Buffer__size(SEXP buffer_sexp){ +extern "C" SEXP _arrow_Buffer__size(SEXP buffer_sexp){ Rf_error("Cannot call Buffer__size(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -785,29 +785,29 @@ RcppExport SEXP _arrow_Buffer__size(SEXP buffer_sexp){ // buffer.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr r___RBuffer__initialize(SEXP x); -RcppExport SEXP _arrow_r___RBuffer__initialize(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type x(x_sexp); - return Rcpp::wrap(r___RBuffer__initialize(x)); -END_RCPP +extern "C" SEXP _arrow_r___RBuffer__initialize(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input::type x(x_sexp); + return cpp11::as_sexp(r___RBuffer__initialize(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_r___RBuffer__initialize(SEXP x_sexp){ +extern "C" SEXP _arrow_r___RBuffer__initialize(SEXP x_sexp){ Rf_error("Cannot call r___RBuffer__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // buffer.cpp #if defined(ARROW_R_WITH_ARROW) -Rcpp::RawVector Buffer__data(const std::shared_ptr& buffer); -RcppExport SEXP _arrow_Buffer__data(SEXP buffer_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type buffer(buffer_sexp); - return Rcpp::wrap(Buffer__data(buffer)); -END_RCPP +cpp11::writable::raws Buffer__data(const std::shared_ptr& buffer); +extern "C" SEXP _arrow_Buffer__data(SEXP buffer_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type buffer(buffer_sexp); + return cpp11::as_sexp(Buffer__data(buffer)); +END_CPP11 } #else -RcppExport SEXP _arrow_Buffer__data(SEXP buffer_sexp){ +extern "C" SEXP _arrow_Buffer__data(SEXP buffer_sexp){ Rf_error("Cannot call Buffer__data(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -815,15 +815,15 @@ RcppExport SEXP _arrow_Buffer__data(SEXP buffer_sexp){ // buffer.cpp #if defined(ARROW_R_WITH_ARROW) bool Buffer__Equals(const std::shared_ptr& x, const std::shared_ptr& y); -RcppExport SEXP _arrow_Buffer__Equals(SEXP x_sexp, SEXP y_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter&>::type y(y_sexp); - return Rcpp::wrap(Buffer__Equals(x, y)); -END_RCPP +extern "C" SEXP _arrow_Buffer__Equals(SEXP x_sexp, SEXP y_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input&>::type y(y_sexp); + return cpp11::as_sexp(Buffer__Equals(x, y)); +END_CPP11 } #else -RcppExport SEXP _arrow_Buffer__Equals(SEXP x_sexp, SEXP y_sexp){ +extern "C" SEXP _arrow_Buffer__Equals(SEXP x_sexp, SEXP y_sexp){ Rf_error("Cannot call Buffer__Equals(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -831,14 +831,14 @@ RcppExport SEXP _arrow_Buffer__Equals(SEXP x_sexp, SEXP y_sexp){ // chunkedarray.cpp #if defined(ARROW_R_WITH_ARROW) int ChunkedArray__length(const std::shared_ptr& chunked_array); -RcppExport SEXP _arrow_ChunkedArray__length(SEXP chunked_array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type chunked_array(chunked_array_sexp); - return Rcpp::wrap(ChunkedArray__length(chunked_array)); -END_RCPP +extern "C" SEXP _arrow_ChunkedArray__length(SEXP chunked_array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type chunked_array(chunked_array_sexp); + return cpp11::as_sexp(ChunkedArray__length(chunked_array)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__length(SEXP chunked_array_sexp){ +extern "C" SEXP _arrow_ChunkedArray__length(SEXP chunked_array_sexp){ Rf_error("Cannot call ChunkedArray__length(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -846,14 +846,14 @@ RcppExport SEXP _arrow_ChunkedArray__length(SEXP chunked_array_sexp){ // chunkedarray.cpp #if defined(ARROW_R_WITH_ARROW) int ChunkedArray__null_count(const std::shared_ptr& chunked_array); -RcppExport SEXP _arrow_ChunkedArray__null_count(SEXP chunked_array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type chunked_array(chunked_array_sexp); - return Rcpp::wrap(ChunkedArray__null_count(chunked_array)); -END_RCPP +extern "C" SEXP _arrow_ChunkedArray__null_count(SEXP chunked_array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type chunked_array(chunked_array_sexp); + return cpp11::as_sexp(ChunkedArray__null_count(chunked_array)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__null_count(SEXP chunked_array_sexp){ +extern "C" SEXP _arrow_ChunkedArray__null_count(SEXP chunked_array_sexp){ Rf_error("Cannot call ChunkedArray__null_count(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -861,14 +861,14 @@ RcppExport SEXP _arrow_ChunkedArray__null_count(SEXP chunked_array_sexp){ // chunkedarray.cpp #if defined(ARROW_R_WITH_ARROW) int ChunkedArray__num_chunks(const std::shared_ptr& chunked_array); -RcppExport SEXP _arrow_ChunkedArray__num_chunks(SEXP chunked_array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type chunked_array(chunked_array_sexp); - return Rcpp::wrap(ChunkedArray__num_chunks(chunked_array)); -END_RCPP +extern "C" SEXP _arrow_ChunkedArray__num_chunks(SEXP chunked_array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type chunked_array(chunked_array_sexp); + return cpp11::as_sexp(ChunkedArray__num_chunks(chunked_array)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__num_chunks(SEXP chunked_array_sexp){ +extern "C" SEXP _arrow_ChunkedArray__num_chunks(SEXP chunked_array_sexp){ Rf_error("Cannot call ChunkedArray__num_chunks(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -876,30 +876,30 @@ RcppExport SEXP _arrow_ChunkedArray__num_chunks(SEXP chunked_array_sexp){ // chunkedarray.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ChunkedArray__chunk(const std::shared_ptr& chunked_array, int i); -RcppExport SEXP _arrow_ChunkedArray__chunk(SEXP chunked_array_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type chunked_array(chunked_array_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(ChunkedArray__chunk(chunked_array, i)); -END_RCPP +extern "C" SEXP _arrow_ChunkedArray__chunk(SEXP chunked_array_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type chunked_array(chunked_array_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(ChunkedArray__chunk(chunked_array, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__chunk(SEXP chunked_array_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_ChunkedArray__chunk(SEXP chunked_array_sexp, SEXP i_sexp){ Rf_error("Cannot call ChunkedArray__chunk(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // chunkedarray.cpp #if defined(ARROW_R_WITH_ARROW) -List ChunkedArray__chunks(const std::shared_ptr& chunked_array); -RcppExport SEXP _arrow_ChunkedArray__chunks(SEXP chunked_array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type chunked_array(chunked_array_sexp); - return Rcpp::wrap(ChunkedArray__chunks(chunked_array)); -END_RCPP +cpp11::list ChunkedArray__chunks(const std::shared_ptr& chunked_array); +extern "C" SEXP _arrow_ChunkedArray__chunks(SEXP chunked_array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type chunked_array(chunked_array_sexp); + return cpp11::as_sexp(ChunkedArray__chunks(chunked_array)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__chunks(SEXP chunked_array_sexp){ +extern "C" SEXP _arrow_ChunkedArray__chunks(SEXP chunked_array_sexp){ Rf_error("Cannot call ChunkedArray__chunks(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -907,47 +907,47 @@ RcppExport SEXP _arrow_ChunkedArray__chunks(SEXP chunked_array_sexp){ // chunkedarray.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ChunkedArray__type(const std::shared_ptr& chunked_array); -RcppExport SEXP _arrow_ChunkedArray__type(SEXP chunked_array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type chunked_array(chunked_array_sexp); - return Rcpp::wrap(ChunkedArray__type(chunked_array)); -END_RCPP +extern "C" SEXP _arrow_ChunkedArray__type(SEXP chunked_array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type chunked_array(chunked_array_sexp); + return cpp11::as_sexp(ChunkedArray__type(chunked_array)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__type(SEXP chunked_array_sexp){ +extern "C" SEXP _arrow_ChunkedArray__type(SEXP chunked_array_sexp){ Rf_error("Cannot call ChunkedArray__type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // chunkedarray.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr ChunkedArray__Slice1(const std::shared_ptr& chunked_array, int offset); -RcppExport SEXP _arrow_ChunkedArray__Slice1(SEXP chunked_array_sexp, SEXP offset_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type chunked_array(chunked_array_sexp); - Rcpp::traits::input_parameter::type offset(offset_sexp); - return Rcpp::wrap(ChunkedArray__Slice1(chunked_array, offset)); -END_RCPP +std::shared_ptr ChunkedArray__Slice1(const std::shared_ptr& chunked_array, R_xlen_t offset); +extern "C" SEXP _arrow_ChunkedArray__Slice1(SEXP chunked_array_sexp, SEXP offset_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type chunked_array(chunked_array_sexp); + arrow::r::Input::type offset(offset_sexp); + return cpp11::as_sexp(ChunkedArray__Slice1(chunked_array, offset)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__Slice1(SEXP chunked_array_sexp, SEXP offset_sexp){ +extern "C" SEXP _arrow_ChunkedArray__Slice1(SEXP chunked_array_sexp, SEXP offset_sexp){ Rf_error("Cannot call ChunkedArray__Slice1(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // chunkedarray.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr ChunkedArray__Slice2(const std::shared_ptr& chunked_array, int offset, int length); -RcppExport SEXP _arrow_ChunkedArray__Slice2(SEXP chunked_array_sexp, SEXP offset_sexp, SEXP length_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type chunked_array(chunked_array_sexp); - Rcpp::traits::input_parameter::type offset(offset_sexp); - Rcpp::traits::input_parameter::type length(length_sexp); - return Rcpp::wrap(ChunkedArray__Slice2(chunked_array, offset, length)); -END_RCPP +std::shared_ptr ChunkedArray__Slice2(const std::shared_ptr& chunked_array, R_xlen_t offset, R_xlen_t length); +extern "C" SEXP _arrow_ChunkedArray__Slice2(SEXP chunked_array_sexp, SEXP offset_sexp, SEXP length_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type chunked_array(chunked_array_sexp); + arrow::r::Input::type offset(offset_sexp); + arrow::r::Input::type length(length_sexp); + return cpp11::as_sexp(ChunkedArray__Slice2(chunked_array, offset, length)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__Slice2(SEXP chunked_array_sexp, SEXP offset_sexp, SEXP length_sexp){ +extern "C" SEXP _arrow_ChunkedArray__Slice2(SEXP chunked_array_sexp, SEXP offset_sexp, SEXP length_sexp){ Rf_error("Cannot call ChunkedArray__Slice2(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -955,15 +955,15 @@ RcppExport SEXP _arrow_ChunkedArray__Slice2(SEXP chunked_array_sexp, SEXP offset // chunkedarray.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ChunkedArray__View(const std::shared_ptr& array, const std::shared_ptr& type); -RcppExport SEXP _arrow_ChunkedArray__View(SEXP array_sexp, SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(ChunkedArray__View(array, type)); -END_RCPP +extern "C" SEXP _arrow_ChunkedArray__View(SEXP array_sexp, SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(ChunkedArray__View(array, type)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__View(SEXP array_sexp, SEXP type_sexp){ +extern "C" SEXP _arrow_ChunkedArray__View(SEXP array_sexp, SEXP type_sexp){ Rf_error("Cannot call ChunkedArray__View(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -971,15 +971,15 @@ RcppExport SEXP _arrow_ChunkedArray__View(SEXP array_sexp, SEXP type_sexp){ // chunkedarray.cpp #if defined(ARROW_R_WITH_ARROW) void ChunkedArray__Validate(const std::shared_ptr& chunked_array); -RcppExport SEXP _arrow_ChunkedArray__Validate(SEXP chunked_array_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type chunked_array(chunked_array_sexp); +extern "C" SEXP _arrow_ChunkedArray__Validate(SEXP chunked_array_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type chunked_array(chunked_array_sexp); ChunkedArray__Validate(chunked_array); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__Validate(SEXP chunked_array_sexp){ +extern "C" SEXP _arrow_ChunkedArray__Validate(SEXP chunked_array_sexp){ Rf_error("Cannot call ChunkedArray__Validate(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -987,15 +987,15 @@ RcppExport SEXP _arrow_ChunkedArray__Validate(SEXP chunked_array_sexp){ // chunkedarray.cpp #if defined(ARROW_R_WITH_ARROW) bool ChunkedArray__Equals(const std::shared_ptr& x, const std::shared_ptr& y); -RcppExport SEXP _arrow_ChunkedArray__Equals(SEXP x_sexp, SEXP y_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter&>::type y(y_sexp); - return Rcpp::wrap(ChunkedArray__Equals(x, y)); -END_RCPP +extern "C" SEXP _arrow_ChunkedArray__Equals(SEXP x_sexp, SEXP y_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input&>::type y(y_sexp); + return cpp11::as_sexp(ChunkedArray__Equals(x, y)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__Equals(SEXP x_sexp, SEXP y_sexp){ +extern "C" SEXP _arrow_ChunkedArray__Equals(SEXP x_sexp, SEXP y_sexp){ Rf_error("Cannot call ChunkedArray__Equals(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1003,30 +1003,30 @@ RcppExport SEXP _arrow_ChunkedArray__Equals(SEXP x_sexp, SEXP y_sexp){ // chunkedarray.cpp #if defined(ARROW_R_WITH_ARROW) std::string ChunkedArray__ToString(const std::shared_ptr& x); -RcppExport SEXP _arrow_ChunkedArray__ToString(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(ChunkedArray__ToString(x)); -END_RCPP +extern "C" SEXP _arrow_ChunkedArray__ToString(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(ChunkedArray__ToString(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__ToString(SEXP x_sexp){ +extern "C" SEXP _arrow_ChunkedArray__ToString(SEXP x_sexp){ Rf_error("Cannot call ChunkedArray__ToString(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // compression.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr util___Codec__Create(arrow::Compression::type codec, int compression_level); -RcppExport SEXP _arrow_util___Codec__Create(SEXP codec_sexp, SEXP compression_level_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type codec(codec_sexp); - Rcpp::traits::input_parameter::type compression_level(compression_level_sexp); - return Rcpp::wrap(util___Codec__Create(codec, compression_level)); -END_RCPP +std::shared_ptr util___Codec__Create(arrow::Compression::type codec, R_xlen_t compression_level); +extern "C" SEXP _arrow_util___Codec__Create(SEXP codec_sexp, SEXP compression_level_sexp){ +BEGIN_CPP11 + arrow::r::Input::type codec(codec_sexp); + arrow::r::Input::type compression_level(compression_level_sexp); + return cpp11::as_sexp(util___Codec__Create(codec, compression_level)); +END_CPP11 } #else -RcppExport SEXP _arrow_util___Codec__Create(SEXP codec_sexp, SEXP compression_level_sexp){ +extern "C" SEXP _arrow_util___Codec__Create(SEXP codec_sexp, SEXP compression_level_sexp){ Rf_error("Cannot call util___Codec__Create(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1034,14 +1034,14 @@ RcppExport SEXP _arrow_util___Codec__Create(SEXP codec_sexp, SEXP compression_le // compression.cpp #if defined(ARROW_R_WITH_ARROW) std::string util___Codec__name(const std::shared_ptr& codec); -RcppExport SEXP _arrow_util___Codec__name(SEXP codec_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type codec(codec_sexp); - return Rcpp::wrap(util___Codec__name(codec)); -END_RCPP +extern "C" SEXP _arrow_util___Codec__name(SEXP codec_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type codec(codec_sexp); + return cpp11::as_sexp(util___Codec__name(codec)); +END_CPP11 } #else -RcppExport SEXP _arrow_util___Codec__name(SEXP codec_sexp){ +extern "C" SEXP _arrow_util___Codec__name(SEXP codec_sexp){ Rf_error("Cannot call util___Codec__name(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1049,14 +1049,14 @@ RcppExport SEXP _arrow_util___Codec__name(SEXP codec_sexp){ // compression.cpp #if defined(ARROW_R_WITH_ARROW) bool util___Codec__IsAvailable(arrow::Compression::type codec); -RcppExport SEXP _arrow_util___Codec__IsAvailable(SEXP codec_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type codec(codec_sexp); - return Rcpp::wrap(util___Codec__IsAvailable(codec)); -END_RCPP +extern "C" SEXP _arrow_util___Codec__IsAvailable(SEXP codec_sexp){ +BEGIN_CPP11 + arrow::r::Input::type codec(codec_sexp); + return cpp11::as_sexp(util___Codec__IsAvailable(codec)); +END_CPP11 } #else -RcppExport SEXP _arrow_util___Codec__IsAvailable(SEXP codec_sexp){ +extern "C" SEXP _arrow_util___Codec__IsAvailable(SEXP codec_sexp){ Rf_error("Cannot call util___Codec__IsAvailable(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1064,15 +1064,15 @@ RcppExport SEXP _arrow_util___Codec__IsAvailable(SEXP codec_sexp){ // compression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr io___CompressedOutputStream__Make(const std::shared_ptr& codec, const std::shared_ptr& raw); -RcppExport SEXP _arrow_io___CompressedOutputStream__Make(SEXP codec_sexp, SEXP raw_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type codec(codec_sexp); - Rcpp::traits::input_parameter&>::type raw(raw_sexp); - return Rcpp::wrap(io___CompressedOutputStream__Make(codec, raw)); -END_RCPP +extern "C" SEXP _arrow_io___CompressedOutputStream__Make(SEXP codec_sexp, SEXP raw_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type codec(codec_sexp); + arrow::r::Input&>::type raw(raw_sexp); + return cpp11::as_sexp(io___CompressedOutputStream__Make(codec, raw)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___CompressedOutputStream__Make(SEXP codec_sexp, SEXP raw_sexp){ +extern "C" SEXP _arrow_io___CompressedOutputStream__Make(SEXP codec_sexp, SEXP raw_sexp){ Rf_error("Cannot call io___CompressedOutputStream__Make(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1080,15 +1080,15 @@ RcppExport SEXP _arrow_io___CompressedOutputStream__Make(SEXP codec_sexp, SEXP r // compression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr io___CompressedInputStream__Make(const std::shared_ptr& codec, const std::shared_ptr& raw); -RcppExport SEXP _arrow_io___CompressedInputStream__Make(SEXP codec_sexp, SEXP raw_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type codec(codec_sexp); - Rcpp::traits::input_parameter&>::type raw(raw_sexp); - return Rcpp::wrap(io___CompressedInputStream__Make(codec, raw)); -END_RCPP +extern "C" SEXP _arrow_io___CompressedInputStream__Make(SEXP codec_sexp, SEXP raw_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type codec(codec_sexp); + arrow::r::Input&>::type raw(raw_sexp); + return cpp11::as_sexp(io___CompressedInputStream__Make(codec, raw)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___CompressedInputStream__Make(SEXP codec_sexp, SEXP raw_sexp){ +extern "C" SEXP _arrow_io___CompressedInputStream__Make(SEXP codec_sexp, SEXP raw_sexp){ Rf_error("Cannot call io___CompressedInputStream__Make(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1096,16 +1096,16 @@ RcppExport SEXP _arrow_io___CompressedInputStream__Make(SEXP codec_sexp, SEXP ra // compute.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr compute___CastOptions__initialize(bool allow_int_overflow, bool allow_time_truncate, bool allow_float_truncate); -RcppExport SEXP _arrow_compute___CastOptions__initialize(SEXP allow_int_overflow_sexp, SEXP allow_time_truncate_sexp, SEXP allow_float_truncate_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type allow_int_overflow(allow_int_overflow_sexp); - Rcpp::traits::input_parameter::type allow_time_truncate(allow_time_truncate_sexp); - Rcpp::traits::input_parameter::type allow_float_truncate(allow_float_truncate_sexp); - return Rcpp::wrap(compute___CastOptions__initialize(allow_int_overflow, allow_time_truncate, allow_float_truncate)); -END_RCPP +extern "C" SEXP _arrow_compute___CastOptions__initialize(SEXP allow_int_overflow_sexp, SEXP allow_time_truncate_sexp, SEXP allow_float_truncate_sexp){ +BEGIN_CPP11 + arrow::r::Input::type allow_int_overflow(allow_int_overflow_sexp); + arrow::r::Input::type allow_time_truncate(allow_time_truncate_sexp); + arrow::r::Input::type allow_float_truncate(allow_float_truncate_sexp); + return cpp11::as_sexp(compute___CastOptions__initialize(allow_int_overflow, allow_time_truncate, allow_float_truncate)); +END_CPP11 } #else -RcppExport SEXP _arrow_compute___CastOptions__initialize(SEXP allow_int_overflow_sexp, SEXP allow_time_truncate_sexp, SEXP allow_float_truncate_sexp){ +extern "C" SEXP _arrow_compute___CastOptions__initialize(SEXP allow_int_overflow_sexp, SEXP allow_time_truncate_sexp, SEXP allow_float_truncate_sexp){ Rf_error("Cannot call compute___CastOptions__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1113,16 +1113,16 @@ RcppExport SEXP _arrow_compute___CastOptions__initialize(SEXP allow_int_overflow // compute.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Array__cast(const std::shared_ptr& array, const std::shared_ptr& target_type, const std::shared_ptr& options); -RcppExport SEXP _arrow_Array__cast(SEXP array_sexp, SEXP target_type_sexp, SEXP options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter&>::type target_type(target_type_sexp); - Rcpp::traits::input_parameter&>::type options(options_sexp); - return Rcpp::wrap(Array__cast(array, target_type, options)); -END_RCPP +extern "C" SEXP _arrow_Array__cast(SEXP array_sexp, SEXP target_type_sexp, SEXP options_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input&>::type target_type(target_type_sexp); + arrow::r::Input&>::type options(options_sexp); + return cpp11::as_sexp(Array__cast(array, target_type, options)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__cast(SEXP array_sexp, SEXP target_type_sexp, SEXP options_sexp){ +extern "C" SEXP _arrow_Array__cast(SEXP array_sexp, SEXP target_type_sexp, SEXP options_sexp){ Rf_error("Cannot call Array__cast(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1130,16 +1130,16 @@ RcppExport SEXP _arrow_Array__cast(SEXP array_sexp, SEXP target_type_sexp, SEXP // compute.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ChunkedArray__cast(const std::shared_ptr& chunked_array, const std::shared_ptr& target_type, const std::shared_ptr& options); -RcppExport SEXP _arrow_ChunkedArray__cast(SEXP chunked_array_sexp, SEXP target_type_sexp, SEXP options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type chunked_array(chunked_array_sexp); - Rcpp::traits::input_parameter&>::type target_type(target_type_sexp); - Rcpp::traits::input_parameter&>::type options(options_sexp); - return Rcpp::wrap(ChunkedArray__cast(chunked_array, target_type, options)); -END_RCPP +extern "C" SEXP _arrow_ChunkedArray__cast(SEXP chunked_array_sexp, SEXP target_type_sexp, SEXP options_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type chunked_array(chunked_array_sexp); + arrow::r::Input&>::type target_type(target_type_sexp); + arrow::r::Input&>::type options(options_sexp); + return cpp11::as_sexp(ChunkedArray__cast(chunked_array, target_type, options)); +END_CPP11 } #else -RcppExport SEXP _arrow_ChunkedArray__cast(SEXP chunked_array_sexp, SEXP target_type_sexp, SEXP options_sexp){ +extern "C" SEXP _arrow_ChunkedArray__cast(SEXP chunked_array_sexp, SEXP target_type_sexp, SEXP options_sexp){ Rf_error("Cannot call ChunkedArray__cast(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1147,16 +1147,16 @@ RcppExport SEXP _arrow_ChunkedArray__cast(SEXP chunked_array_sexp, SEXP target_t // compute.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr RecordBatch__cast(const std::shared_ptr& batch, const std::shared_ptr& schema, const std::shared_ptr& options); -RcppExport SEXP _arrow_RecordBatch__cast(SEXP batch_sexp, SEXP schema_sexp, SEXP options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch(batch_sexp); - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - Rcpp::traits::input_parameter&>::type options(options_sexp); - return Rcpp::wrap(RecordBatch__cast(batch, schema, options)); -END_RCPP +extern "C" SEXP _arrow_RecordBatch__cast(SEXP batch_sexp, SEXP schema_sexp, SEXP options_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch(batch_sexp); + arrow::r::Input&>::type schema(schema_sexp); + arrow::r::Input&>::type options(options_sexp); + return cpp11::as_sexp(RecordBatch__cast(batch, schema, options)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__cast(SEXP batch_sexp, SEXP schema_sexp, SEXP options_sexp){ +extern "C" SEXP _arrow_RecordBatch__cast(SEXP batch_sexp, SEXP schema_sexp, SEXP options_sexp){ Rf_error("Cannot call RecordBatch__cast(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1164,78 +1164,78 @@ RcppExport SEXP _arrow_RecordBatch__cast(SEXP batch_sexp, SEXP schema_sexp, SEXP // compute.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Table__cast(const std::shared_ptr& table, const std::shared_ptr& schema, const std::shared_ptr& options); -RcppExport SEXP _arrow_Table__cast(SEXP table_sexp, SEXP schema_sexp, SEXP options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - Rcpp::traits::input_parameter&>::type options(options_sexp); - return Rcpp::wrap(Table__cast(table, schema, options)); -END_RCPP +extern "C" SEXP _arrow_Table__cast(SEXP table_sexp, SEXP schema_sexp, SEXP options_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + arrow::r::Input&>::type schema(schema_sexp); + arrow::r::Input&>::type options(options_sexp); + return cpp11::as_sexp(Table__cast(table, schema, options)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__cast(SEXP table_sexp, SEXP schema_sexp, SEXP options_sexp){ +extern "C" SEXP _arrow_Table__cast(SEXP table_sexp, SEXP schema_sexp, SEXP options_sexp){ Rf_error("Cannot call Table__cast(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // compute.cpp #if defined(ARROW_R_WITH_ARROW) -SEXP compute__CallFunction(std::string func_name, List_ args, List_ options); -RcppExport SEXP _arrow_compute__CallFunction(SEXP func_name_sexp, SEXP args_sexp, SEXP options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type func_name(func_name_sexp); - Rcpp::traits::input_parameter::type args(args_sexp); - Rcpp::traits::input_parameter::type options(options_sexp); - return Rcpp::wrap(compute__CallFunction(func_name, args, options)); -END_RCPP +SEXP compute__CallFunction(std::string func_name, cpp11::list args, cpp11::list options); +extern "C" SEXP _arrow_compute__CallFunction(SEXP func_name_sexp, SEXP args_sexp, SEXP options_sexp){ +BEGIN_CPP11 + arrow::r::Input::type func_name(func_name_sexp); + arrow::r::Input::type args(args_sexp); + arrow::r::Input::type options(options_sexp); + return cpp11::as_sexp(compute__CallFunction(func_name, args, options)); +END_CPP11 } #else -RcppExport SEXP _arrow_compute__CallFunction(SEXP func_name_sexp, SEXP args_sexp, SEXP options_sexp){ +extern "C" SEXP _arrow_compute__CallFunction(SEXP func_name_sexp, SEXP args_sexp, SEXP options_sexp){ Rf_error("Cannot call compute__CallFunction(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // csv.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr csv___ReadOptions__initialize(List_ options); -RcppExport SEXP _arrow_csv___ReadOptions__initialize(SEXP options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type options(options_sexp); - return Rcpp::wrap(csv___ReadOptions__initialize(options)); -END_RCPP +std::shared_ptr csv___ReadOptions__initialize(cpp11::list options); +extern "C" SEXP _arrow_csv___ReadOptions__initialize(SEXP options_sexp){ +BEGIN_CPP11 + arrow::r::Input::type options(options_sexp); + return cpp11::as_sexp(csv___ReadOptions__initialize(options)); +END_CPP11 } #else -RcppExport SEXP _arrow_csv___ReadOptions__initialize(SEXP options_sexp){ +extern "C" SEXP _arrow_csv___ReadOptions__initialize(SEXP options_sexp){ Rf_error("Cannot call csv___ReadOptions__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // csv.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr csv___ParseOptions__initialize(List_ options); -RcppExport SEXP _arrow_csv___ParseOptions__initialize(SEXP options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type options(options_sexp); - return Rcpp::wrap(csv___ParseOptions__initialize(options)); -END_RCPP +std::shared_ptr csv___ParseOptions__initialize(cpp11::list options); +extern "C" SEXP _arrow_csv___ParseOptions__initialize(SEXP options_sexp){ +BEGIN_CPP11 + arrow::r::Input::type options(options_sexp); + return cpp11::as_sexp(csv___ParseOptions__initialize(options)); +END_CPP11 } #else -RcppExport SEXP _arrow_csv___ParseOptions__initialize(SEXP options_sexp){ +extern "C" SEXP _arrow_csv___ParseOptions__initialize(SEXP options_sexp){ Rf_error("Cannot call csv___ParseOptions__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // csv.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr csv___ConvertOptions__initialize(List_ options); -RcppExport SEXP _arrow_csv___ConvertOptions__initialize(SEXP options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type options(options_sexp); - return Rcpp::wrap(csv___ConvertOptions__initialize(options)); -END_RCPP +std::shared_ptr csv___ConvertOptions__initialize(cpp11::list options); +extern "C" SEXP _arrow_csv___ConvertOptions__initialize(SEXP options_sexp){ +BEGIN_CPP11 + arrow::r::Input::type options(options_sexp); + return cpp11::as_sexp(csv___ConvertOptions__initialize(options)); +END_CPP11 } #else -RcppExport SEXP _arrow_csv___ConvertOptions__initialize(SEXP options_sexp){ +extern "C" SEXP _arrow_csv___ConvertOptions__initialize(SEXP options_sexp){ Rf_error("Cannot call csv___ConvertOptions__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1243,17 +1243,17 @@ RcppExport SEXP _arrow_csv___ConvertOptions__initialize(SEXP options_sexp){ // csv.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr csv___TableReader__Make(const std::shared_ptr& input, const std::shared_ptr& read_options, const std::shared_ptr& parse_options, const std::shared_ptr& convert_options); -RcppExport SEXP _arrow_csv___TableReader__Make(SEXP input_sexp, SEXP read_options_sexp, SEXP parse_options_sexp, SEXP convert_options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type input(input_sexp); - Rcpp::traits::input_parameter&>::type read_options(read_options_sexp); - Rcpp::traits::input_parameter&>::type parse_options(parse_options_sexp); - Rcpp::traits::input_parameter&>::type convert_options(convert_options_sexp); - return Rcpp::wrap(csv___TableReader__Make(input, read_options, parse_options, convert_options)); -END_RCPP +extern "C" SEXP _arrow_csv___TableReader__Make(SEXP input_sexp, SEXP read_options_sexp, SEXP parse_options_sexp, SEXP convert_options_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type input(input_sexp); + arrow::r::Input&>::type read_options(read_options_sexp); + arrow::r::Input&>::type parse_options(parse_options_sexp); + arrow::r::Input&>::type convert_options(convert_options_sexp); + return cpp11::as_sexp(csv___TableReader__Make(input, read_options, parse_options, convert_options)); +END_CPP11 } #else -RcppExport SEXP _arrow_csv___TableReader__Make(SEXP input_sexp, SEXP read_options_sexp, SEXP parse_options_sexp, SEXP convert_options_sexp){ +extern "C" SEXP _arrow_csv___TableReader__Make(SEXP input_sexp, SEXP read_options_sexp, SEXP parse_options_sexp, SEXP convert_options_sexp){ Rf_error("Cannot call csv___TableReader__Make(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1261,14 +1261,14 @@ RcppExport SEXP _arrow_csv___TableReader__Make(SEXP input_sexp, SEXP read_option // csv.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr csv___TableReader__Read(const std::shared_ptr& table_reader); -RcppExport SEXP _arrow_csv___TableReader__Read(SEXP table_reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table_reader(table_reader_sexp); - return Rcpp::wrap(csv___TableReader__Read(table_reader)); -END_RCPP +extern "C" SEXP _arrow_csv___TableReader__Read(SEXP table_reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table_reader(table_reader_sexp); + return cpp11::as_sexp(csv___TableReader__Read(table_reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_csv___TableReader__Read(SEXP table_reader_sexp){ +extern "C" SEXP _arrow_csv___TableReader__Read(SEXP table_reader_sexp){ Rf_error("Cannot call csv___TableReader__Read(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1276,14 +1276,14 @@ RcppExport SEXP _arrow_csv___TableReader__Read(SEXP table_reader_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___Dataset__NewScan(const std::shared_ptr& ds); -RcppExport SEXP _arrow_dataset___Dataset__NewScan(SEXP ds_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type ds(ds_sexp); - return Rcpp::wrap(dataset___Dataset__NewScan(ds)); -END_RCPP +extern "C" SEXP _arrow_dataset___Dataset__NewScan(SEXP ds_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type ds(ds_sexp); + return cpp11::as_sexp(dataset___Dataset__NewScan(ds)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___Dataset__NewScan(SEXP ds_sexp){ +extern "C" SEXP _arrow_dataset___Dataset__NewScan(SEXP ds_sexp){ Rf_error("Cannot call dataset___Dataset__NewScan(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1291,14 +1291,14 @@ RcppExport SEXP _arrow_dataset___Dataset__NewScan(SEXP ds_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___Dataset__schema(const std::shared_ptr& dataset); -RcppExport SEXP _arrow_dataset___Dataset__schema(SEXP dataset_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type dataset(dataset_sexp); - return Rcpp::wrap(dataset___Dataset__schema(dataset)); -END_RCPP +extern "C" SEXP _arrow_dataset___Dataset__schema(SEXP dataset_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type dataset(dataset_sexp); + return cpp11::as_sexp(dataset___Dataset__schema(dataset)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___Dataset__schema(SEXP dataset_sexp){ +extern "C" SEXP _arrow_dataset___Dataset__schema(SEXP dataset_sexp){ Rf_error("Cannot call dataset___Dataset__schema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1306,14 +1306,14 @@ RcppExport SEXP _arrow_dataset___Dataset__schema(SEXP dataset_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::string dataset___Dataset__type_name(const std::shared_ptr& dataset); -RcppExport SEXP _arrow_dataset___Dataset__type_name(SEXP dataset_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type dataset(dataset_sexp); - return Rcpp::wrap(dataset___Dataset__type_name(dataset)); -END_RCPP +extern "C" SEXP _arrow_dataset___Dataset__type_name(SEXP dataset_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type dataset(dataset_sexp); + return cpp11::as_sexp(dataset___Dataset__type_name(dataset)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___Dataset__type_name(SEXP dataset_sexp){ +extern "C" SEXP _arrow_dataset___Dataset__type_name(SEXP dataset_sexp){ Rf_error("Cannot call dataset___Dataset__type_name(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1321,15 +1321,15 @@ RcppExport SEXP _arrow_dataset___Dataset__type_name(SEXP dataset_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___Dataset__ReplaceSchema(const std::shared_ptr& dataset, const std::shared_ptr& schm); -RcppExport SEXP _arrow_dataset___Dataset__ReplaceSchema(SEXP dataset_sexp, SEXP schm_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type dataset(dataset_sexp); - Rcpp::traits::input_parameter&>::type schm(schm_sexp); - return Rcpp::wrap(dataset___Dataset__ReplaceSchema(dataset, schm)); -END_RCPP +extern "C" SEXP _arrow_dataset___Dataset__ReplaceSchema(SEXP dataset_sexp, SEXP schm_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type dataset(dataset_sexp); + arrow::r::Input&>::type schm(schm_sexp); + return cpp11::as_sexp(dataset___Dataset__ReplaceSchema(dataset, schm)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___Dataset__ReplaceSchema(SEXP dataset_sexp, SEXP schm_sexp){ +extern "C" SEXP _arrow_dataset___Dataset__ReplaceSchema(SEXP dataset_sexp, SEXP schm_sexp){ Rf_error("Cannot call dataset___Dataset__ReplaceSchema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1337,15 +1337,15 @@ RcppExport SEXP _arrow_dataset___Dataset__ReplaceSchema(SEXP dataset_sexp, SEXP // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___UnionDataset__create(const ds::DatasetVector& datasets, const std::shared_ptr& schm); -RcppExport SEXP _arrow_dataset___UnionDataset__create(SEXP datasets_sexp, SEXP schm_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type datasets(datasets_sexp); - Rcpp::traits::input_parameter&>::type schm(schm_sexp); - return Rcpp::wrap(dataset___UnionDataset__create(datasets, schm)); -END_RCPP +extern "C" SEXP _arrow_dataset___UnionDataset__create(SEXP datasets_sexp, SEXP schm_sexp){ +BEGIN_CPP11 + arrow::r::Input::type datasets(datasets_sexp); + arrow::r::Input&>::type schm(schm_sexp); + return cpp11::as_sexp(dataset___UnionDataset__create(datasets, schm)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___UnionDataset__create(SEXP datasets_sexp, SEXP schm_sexp){ +extern "C" SEXP _arrow_dataset___UnionDataset__create(SEXP datasets_sexp, SEXP schm_sexp){ Rf_error("Cannot call dataset___UnionDataset__create(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1353,14 +1353,14 @@ RcppExport SEXP _arrow_dataset___UnionDataset__create(SEXP datasets_sexp, SEXP s // dataset.cpp #if defined(ARROW_R_WITH_ARROW) ds::DatasetVector dataset___UnionDataset__children(const std::shared_ptr& ds); -RcppExport SEXP _arrow_dataset___UnionDataset__children(SEXP ds_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type ds(ds_sexp); - return Rcpp::wrap(dataset___UnionDataset__children(ds)); -END_RCPP +extern "C" SEXP _arrow_dataset___UnionDataset__children(SEXP ds_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type ds(ds_sexp); + return cpp11::as_sexp(dataset___UnionDataset__children(ds)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___UnionDataset__children(SEXP ds_sexp){ +extern "C" SEXP _arrow_dataset___UnionDataset__children(SEXP ds_sexp){ Rf_error("Cannot call dataset___UnionDataset__children(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1368,14 +1368,14 @@ RcppExport SEXP _arrow_dataset___UnionDataset__children(SEXP ds_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___FileSystemDataset__format(const std::shared_ptr& dataset); -RcppExport SEXP _arrow_dataset___FileSystemDataset__format(SEXP dataset_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type dataset(dataset_sexp); - return Rcpp::wrap(dataset___FileSystemDataset__format(dataset)); -END_RCPP +extern "C" SEXP _arrow_dataset___FileSystemDataset__format(SEXP dataset_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type dataset(dataset_sexp); + return cpp11::as_sexp(dataset___FileSystemDataset__format(dataset)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___FileSystemDataset__format(SEXP dataset_sexp){ +extern "C" SEXP _arrow_dataset___FileSystemDataset__format(SEXP dataset_sexp){ Rf_error("Cannot call dataset___FileSystemDataset__format(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1383,14 +1383,14 @@ RcppExport SEXP _arrow_dataset___FileSystemDataset__format(SEXP dataset_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::vector dataset___FileSystemDataset__files(const std::shared_ptr& dataset); -RcppExport SEXP _arrow_dataset___FileSystemDataset__files(SEXP dataset_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type dataset(dataset_sexp); - return Rcpp::wrap(dataset___FileSystemDataset__files(dataset)); -END_RCPP +extern "C" SEXP _arrow_dataset___FileSystemDataset__files(SEXP dataset_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type dataset(dataset_sexp); + return cpp11::as_sexp(dataset___FileSystemDataset__files(dataset)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___FileSystemDataset__files(SEXP dataset_sexp){ +extern "C" SEXP _arrow_dataset___FileSystemDataset__files(SEXP dataset_sexp){ Rf_error("Cannot call dataset___FileSystemDataset__files(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1398,15 +1398,15 @@ RcppExport SEXP _arrow_dataset___FileSystemDataset__files(SEXP dataset_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___DatasetFactory__Finish1(const std::shared_ptr& factory, bool unify_schemas); -RcppExport SEXP _arrow_dataset___DatasetFactory__Finish1(SEXP factory_sexp, SEXP unify_schemas_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type factory(factory_sexp); - Rcpp::traits::input_parameter::type unify_schemas(unify_schemas_sexp); - return Rcpp::wrap(dataset___DatasetFactory__Finish1(factory, unify_schemas)); -END_RCPP +extern "C" SEXP _arrow_dataset___DatasetFactory__Finish1(SEXP factory_sexp, SEXP unify_schemas_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type factory(factory_sexp); + arrow::r::Input::type unify_schemas(unify_schemas_sexp); + return cpp11::as_sexp(dataset___DatasetFactory__Finish1(factory, unify_schemas)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___DatasetFactory__Finish1(SEXP factory_sexp, SEXP unify_schemas_sexp){ +extern "C" SEXP _arrow_dataset___DatasetFactory__Finish1(SEXP factory_sexp, SEXP unify_schemas_sexp){ Rf_error("Cannot call dataset___DatasetFactory__Finish1(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1414,15 +1414,15 @@ RcppExport SEXP _arrow_dataset___DatasetFactory__Finish1(SEXP factory_sexp, SEXP // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___DatasetFactory__Finish2(const std::shared_ptr& factory, const std::shared_ptr& schema); -RcppExport SEXP _arrow_dataset___DatasetFactory__Finish2(SEXP factory_sexp, SEXP schema_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type factory(factory_sexp); - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - return Rcpp::wrap(dataset___DatasetFactory__Finish2(factory, schema)); -END_RCPP +extern "C" SEXP _arrow_dataset___DatasetFactory__Finish2(SEXP factory_sexp, SEXP schema_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type factory(factory_sexp); + arrow::r::Input&>::type schema(schema_sexp); + return cpp11::as_sexp(dataset___DatasetFactory__Finish2(factory, schema)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___DatasetFactory__Finish2(SEXP factory_sexp, SEXP schema_sexp){ +extern "C" SEXP _arrow_dataset___DatasetFactory__Finish2(SEXP factory_sexp, SEXP schema_sexp){ Rf_error("Cannot call dataset___DatasetFactory__Finish2(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1430,15 +1430,15 @@ RcppExport SEXP _arrow_dataset___DatasetFactory__Finish2(SEXP factory_sexp, SEXP // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___DatasetFactory__Inspect(const std::shared_ptr& factory, bool unify_schemas); -RcppExport SEXP _arrow_dataset___DatasetFactory__Inspect(SEXP factory_sexp, SEXP unify_schemas_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type factory(factory_sexp); - Rcpp::traits::input_parameter::type unify_schemas(unify_schemas_sexp); - return Rcpp::wrap(dataset___DatasetFactory__Inspect(factory, unify_schemas)); -END_RCPP +extern "C" SEXP _arrow_dataset___DatasetFactory__Inspect(SEXP factory_sexp, SEXP unify_schemas_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type factory(factory_sexp); + arrow::r::Input::type unify_schemas(unify_schemas_sexp); + return cpp11::as_sexp(dataset___DatasetFactory__Inspect(factory, unify_schemas)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___DatasetFactory__Inspect(SEXP factory_sexp, SEXP unify_schemas_sexp){ +extern "C" SEXP _arrow_dataset___DatasetFactory__Inspect(SEXP factory_sexp, SEXP unify_schemas_sexp){ Rf_error("Cannot call dataset___DatasetFactory__Inspect(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1446,14 +1446,14 @@ RcppExport SEXP _arrow_dataset___DatasetFactory__Inspect(SEXP factory_sexp, SEXP // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___UnionDatasetFactory__Make(const std::vector>& children); -RcppExport SEXP _arrow_dataset___UnionDatasetFactory__Make(SEXP children_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter>&>::type children(children_sexp); - return Rcpp::wrap(dataset___UnionDatasetFactory__Make(children)); -END_RCPP +extern "C" SEXP _arrow_dataset___UnionDatasetFactory__Make(SEXP children_sexp){ +BEGIN_CPP11 + arrow::r::Input>&>::type children(children_sexp); + return cpp11::as_sexp(dataset___UnionDatasetFactory__Make(children)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___UnionDatasetFactory__Make(SEXP children_sexp){ +extern "C" SEXP _arrow_dataset___UnionDatasetFactory__Make(SEXP children_sexp){ Rf_error("Cannot call dataset___UnionDatasetFactory__Make(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1461,17 +1461,17 @@ RcppExport SEXP _arrow_dataset___UnionDatasetFactory__Make(SEXP children_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___FileSystemDatasetFactory__Make2(const std::shared_ptr& fs, const std::shared_ptr& selector, const std::shared_ptr& format, const std::shared_ptr& partitioning); -RcppExport SEXP _arrow_dataset___FileSystemDatasetFactory__Make2(SEXP fs_sexp, SEXP selector_sexp, SEXP format_sexp, SEXP partitioning_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type fs(fs_sexp); - Rcpp::traits::input_parameter&>::type selector(selector_sexp); - Rcpp::traits::input_parameter&>::type format(format_sexp); - Rcpp::traits::input_parameter&>::type partitioning(partitioning_sexp); - return Rcpp::wrap(dataset___FileSystemDatasetFactory__Make2(fs, selector, format, partitioning)); -END_RCPP +extern "C" SEXP _arrow_dataset___FileSystemDatasetFactory__Make2(SEXP fs_sexp, SEXP selector_sexp, SEXP format_sexp, SEXP partitioning_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type fs(fs_sexp); + arrow::r::Input&>::type selector(selector_sexp); + arrow::r::Input&>::type format(format_sexp); + arrow::r::Input&>::type partitioning(partitioning_sexp); + return cpp11::as_sexp(dataset___FileSystemDatasetFactory__Make2(fs, selector, format, partitioning)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___FileSystemDatasetFactory__Make2(SEXP fs_sexp, SEXP selector_sexp, SEXP format_sexp, SEXP partitioning_sexp){ +extern "C" SEXP _arrow_dataset___FileSystemDatasetFactory__Make2(SEXP fs_sexp, SEXP selector_sexp, SEXP format_sexp, SEXP partitioning_sexp){ Rf_error("Cannot call dataset___FileSystemDatasetFactory__Make2(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1479,16 +1479,16 @@ RcppExport SEXP _arrow_dataset___FileSystemDatasetFactory__Make2(SEXP fs_sexp, S // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___FileSystemDatasetFactory__Make1(const std::shared_ptr& fs, const std::shared_ptr& selector, const std::shared_ptr& format); -RcppExport SEXP _arrow_dataset___FileSystemDatasetFactory__Make1(SEXP fs_sexp, SEXP selector_sexp, SEXP format_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type fs(fs_sexp); - Rcpp::traits::input_parameter&>::type selector(selector_sexp); - Rcpp::traits::input_parameter&>::type format(format_sexp); - return Rcpp::wrap(dataset___FileSystemDatasetFactory__Make1(fs, selector, format)); -END_RCPP +extern "C" SEXP _arrow_dataset___FileSystemDatasetFactory__Make1(SEXP fs_sexp, SEXP selector_sexp, SEXP format_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type fs(fs_sexp); + arrow::r::Input&>::type selector(selector_sexp); + arrow::r::Input&>::type format(format_sexp); + return cpp11::as_sexp(dataset___FileSystemDatasetFactory__Make1(fs, selector, format)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___FileSystemDatasetFactory__Make1(SEXP fs_sexp, SEXP selector_sexp, SEXP format_sexp){ +extern "C" SEXP _arrow_dataset___FileSystemDatasetFactory__Make1(SEXP fs_sexp, SEXP selector_sexp, SEXP format_sexp){ Rf_error("Cannot call dataset___FileSystemDatasetFactory__Make1(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1496,17 +1496,17 @@ RcppExport SEXP _arrow_dataset___FileSystemDatasetFactory__Make1(SEXP fs_sexp, S // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___FileSystemDatasetFactory__Make3(const std::shared_ptr& fs, const std::shared_ptr& selector, const std::shared_ptr& format, const std::shared_ptr& factory); -RcppExport SEXP _arrow_dataset___FileSystemDatasetFactory__Make3(SEXP fs_sexp, SEXP selector_sexp, SEXP format_sexp, SEXP factory_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type fs(fs_sexp); - Rcpp::traits::input_parameter&>::type selector(selector_sexp); - Rcpp::traits::input_parameter&>::type format(format_sexp); - Rcpp::traits::input_parameter&>::type factory(factory_sexp); - return Rcpp::wrap(dataset___FileSystemDatasetFactory__Make3(fs, selector, format, factory)); -END_RCPP +extern "C" SEXP _arrow_dataset___FileSystemDatasetFactory__Make3(SEXP fs_sexp, SEXP selector_sexp, SEXP format_sexp, SEXP factory_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type fs(fs_sexp); + arrow::r::Input&>::type selector(selector_sexp); + arrow::r::Input&>::type format(format_sexp); + arrow::r::Input&>::type factory(factory_sexp); + return cpp11::as_sexp(dataset___FileSystemDatasetFactory__Make3(fs, selector, format, factory)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___FileSystemDatasetFactory__Make3(SEXP fs_sexp, SEXP selector_sexp, SEXP format_sexp, SEXP factory_sexp){ +extern "C" SEXP _arrow_dataset___FileSystemDatasetFactory__Make3(SEXP fs_sexp, SEXP selector_sexp, SEXP format_sexp, SEXP factory_sexp){ Rf_error("Cannot call dataset___FileSystemDatasetFactory__Make3(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1514,31 +1514,31 @@ RcppExport SEXP _arrow_dataset___FileSystemDatasetFactory__Make3(SEXP fs_sexp, S // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::string dataset___FileFormat__type_name(const std::shared_ptr& format); -RcppExport SEXP _arrow_dataset___FileFormat__type_name(SEXP format_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type format(format_sexp); - return Rcpp::wrap(dataset___FileFormat__type_name(format)); -END_RCPP +extern "C" SEXP _arrow_dataset___FileFormat__type_name(SEXP format_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type format(format_sexp); + return cpp11::as_sexp(dataset___FileFormat__type_name(format)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___FileFormat__type_name(SEXP format_sexp){ +extern "C" SEXP _arrow_dataset___FileFormat__type_name(SEXP format_sexp){ Rf_error("Cannot call dataset___FileFormat__type_name(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // dataset.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr dataset___ParquetFileFormat__Make(bool use_buffered_stream, int64_t buffer_size, CharacterVector dict_columns); -RcppExport SEXP _arrow_dataset___ParquetFileFormat__Make(SEXP use_buffered_stream_sexp, SEXP buffer_size_sexp, SEXP dict_columns_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type use_buffered_stream(use_buffered_stream_sexp); - Rcpp::traits::input_parameter::type buffer_size(buffer_size_sexp); - Rcpp::traits::input_parameter::type dict_columns(dict_columns_sexp); - return Rcpp::wrap(dataset___ParquetFileFormat__Make(use_buffered_stream, buffer_size, dict_columns)); -END_RCPP +std::shared_ptr dataset___ParquetFileFormat__Make(bool use_buffered_stream, int64_t buffer_size, cpp11::strings dict_columns); +extern "C" SEXP _arrow_dataset___ParquetFileFormat__Make(SEXP use_buffered_stream_sexp, SEXP buffer_size_sexp, SEXP dict_columns_sexp){ +BEGIN_CPP11 + arrow::r::Input::type use_buffered_stream(use_buffered_stream_sexp); + arrow::r::Input::type buffer_size(buffer_size_sexp); + arrow::r::Input::type dict_columns(dict_columns_sexp); + return cpp11::as_sexp(dataset___ParquetFileFormat__Make(use_buffered_stream, buffer_size, dict_columns)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___ParquetFileFormat__Make(SEXP use_buffered_stream_sexp, SEXP buffer_size_sexp, SEXP dict_columns_sexp){ +extern "C" SEXP _arrow_dataset___ParquetFileFormat__Make(SEXP use_buffered_stream_sexp, SEXP buffer_size_sexp, SEXP dict_columns_sexp){ Rf_error("Cannot call dataset___ParquetFileFormat__Make(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1546,13 +1546,13 @@ RcppExport SEXP _arrow_dataset___ParquetFileFormat__Make(SEXP use_buffered_strea // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___IpcFileFormat__Make(); -RcppExport SEXP _arrow_dataset___IpcFileFormat__Make(){ -BEGIN_RCPP - return Rcpp::wrap(dataset___IpcFileFormat__Make()); -END_RCPP +extern "C" SEXP _arrow_dataset___IpcFileFormat__Make(){ +BEGIN_CPP11 + return cpp11::as_sexp(dataset___IpcFileFormat__Make()); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___IpcFileFormat__Make(){ +extern "C" SEXP _arrow_dataset___IpcFileFormat__Make(){ Rf_error("Cannot call dataset___IpcFileFormat__Make(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1560,14 +1560,14 @@ RcppExport SEXP _arrow_dataset___IpcFileFormat__Make(){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___CsvFileFormat__Make(const std::shared_ptr& parse_options); -RcppExport SEXP _arrow_dataset___CsvFileFormat__Make(SEXP parse_options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type parse_options(parse_options_sexp); - return Rcpp::wrap(dataset___CsvFileFormat__Make(parse_options)); -END_RCPP +extern "C" SEXP _arrow_dataset___CsvFileFormat__Make(SEXP parse_options_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type parse_options(parse_options_sexp); + return cpp11::as_sexp(dataset___CsvFileFormat__Make(parse_options)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___CsvFileFormat__Make(SEXP parse_options_sexp){ +extern "C" SEXP _arrow_dataset___CsvFileFormat__Make(SEXP parse_options_sexp){ Rf_error("Cannot call dataset___CsvFileFormat__Make(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1575,14 +1575,14 @@ RcppExport SEXP _arrow_dataset___CsvFileFormat__Make(SEXP parse_options_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___DirectoryPartitioning(const std::shared_ptr& schm); -RcppExport SEXP _arrow_dataset___DirectoryPartitioning(SEXP schm_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type schm(schm_sexp); - return Rcpp::wrap(dataset___DirectoryPartitioning(schm)); -END_RCPP +extern "C" SEXP _arrow_dataset___DirectoryPartitioning(SEXP schm_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type schm(schm_sexp); + return cpp11::as_sexp(dataset___DirectoryPartitioning(schm)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___DirectoryPartitioning(SEXP schm_sexp){ +extern "C" SEXP _arrow_dataset___DirectoryPartitioning(SEXP schm_sexp){ Rf_error("Cannot call dataset___DirectoryPartitioning(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1590,14 +1590,14 @@ RcppExport SEXP _arrow_dataset___DirectoryPartitioning(SEXP schm_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___DirectoryPartitioning__MakeFactory(const std::vector& field_names); -RcppExport SEXP _arrow_dataset___DirectoryPartitioning__MakeFactory(SEXP field_names_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type field_names(field_names_sexp); - return Rcpp::wrap(dataset___DirectoryPartitioning__MakeFactory(field_names)); -END_RCPP +extern "C" SEXP _arrow_dataset___DirectoryPartitioning__MakeFactory(SEXP field_names_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type field_names(field_names_sexp); + return cpp11::as_sexp(dataset___DirectoryPartitioning__MakeFactory(field_names)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___DirectoryPartitioning__MakeFactory(SEXP field_names_sexp){ +extern "C" SEXP _arrow_dataset___DirectoryPartitioning__MakeFactory(SEXP field_names_sexp){ Rf_error("Cannot call dataset___DirectoryPartitioning__MakeFactory(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1605,14 +1605,14 @@ RcppExport SEXP _arrow_dataset___DirectoryPartitioning__MakeFactory(SEXP field_n // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___HivePartitioning(const std::shared_ptr& schm); -RcppExport SEXP _arrow_dataset___HivePartitioning(SEXP schm_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type schm(schm_sexp); - return Rcpp::wrap(dataset___HivePartitioning(schm)); -END_RCPP +extern "C" SEXP _arrow_dataset___HivePartitioning(SEXP schm_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type schm(schm_sexp); + return cpp11::as_sexp(dataset___HivePartitioning(schm)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___HivePartitioning(SEXP schm_sexp){ +extern "C" SEXP _arrow_dataset___HivePartitioning(SEXP schm_sexp){ Rf_error("Cannot call dataset___HivePartitioning(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1620,13 +1620,13 @@ RcppExport SEXP _arrow_dataset___HivePartitioning(SEXP schm_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___HivePartitioning__MakeFactory(); -RcppExport SEXP _arrow_dataset___HivePartitioning__MakeFactory(){ -BEGIN_RCPP - return Rcpp::wrap(dataset___HivePartitioning__MakeFactory()); -END_RCPP +extern "C" SEXP _arrow_dataset___HivePartitioning__MakeFactory(){ +BEGIN_CPP11 + return cpp11::as_sexp(dataset___HivePartitioning__MakeFactory()); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___HivePartitioning__MakeFactory(){ +extern "C" SEXP _arrow_dataset___HivePartitioning__MakeFactory(){ Rf_error("Cannot call dataset___HivePartitioning__MakeFactory(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1634,16 +1634,16 @@ RcppExport SEXP _arrow_dataset___HivePartitioning__MakeFactory(){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) void dataset___ScannerBuilder__Project(const std::shared_ptr& sb, const std::vector& cols); -RcppExport SEXP _arrow_dataset___ScannerBuilder__Project(SEXP sb_sexp, SEXP cols_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type sb(sb_sexp); - Rcpp::traits::input_parameter&>::type cols(cols_sexp); +extern "C" SEXP _arrow_dataset___ScannerBuilder__Project(SEXP sb_sexp, SEXP cols_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type sb(sb_sexp); + arrow::r::Input&>::type cols(cols_sexp); dataset___ScannerBuilder__Project(sb, cols); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___ScannerBuilder__Project(SEXP sb_sexp, SEXP cols_sexp){ +extern "C" SEXP _arrow_dataset___ScannerBuilder__Project(SEXP sb_sexp, SEXP cols_sexp){ Rf_error("Cannot call dataset___ScannerBuilder__Project(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1651,16 +1651,16 @@ RcppExport SEXP _arrow_dataset___ScannerBuilder__Project(SEXP sb_sexp, SEXP cols // dataset.cpp #if defined(ARROW_R_WITH_ARROW) void dataset___ScannerBuilder__Filter(const std::shared_ptr& sb, const std::shared_ptr& expr); -RcppExport SEXP _arrow_dataset___ScannerBuilder__Filter(SEXP sb_sexp, SEXP expr_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type sb(sb_sexp); - Rcpp::traits::input_parameter&>::type expr(expr_sexp); +extern "C" SEXP _arrow_dataset___ScannerBuilder__Filter(SEXP sb_sexp, SEXP expr_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type sb(sb_sexp); + arrow::r::Input&>::type expr(expr_sexp); dataset___ScannerBuilder__Filter(sb, expr); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___ScannerBuilder__Filter(SEXP sb_sexp, SEXP expr_sexp){ +extern "C" SEXP _arrow_dataset___ScannerBuilder__Filter(SEXP sb_sexp, SEXP expr_sexp){ Rf_error("Cannot call dataset___ScannerBuilder__Filter(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1668,16 +1668,16 @@ RcppExport SEXP _arrow_dataset___ScannerBuilder__Filter(SEXP sb_sexp, SEXP expr_ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) void dataset___ScannerBuilder__UseThreads(const std::shared_ptr& sb, bool threads); -RcppExport SEXP _arrow_dataset___ScannerBuilder__UseThreads(SEXP sb_sexp, SEXP threads_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type sb(sb_sexp); - Rcpp::traits::input_parameter::type threads(threads_sexp); +extern "C" SEXP _arrow_dataset___ScannerBuilder__UseThreads(SEXP sb_sexp, SEXP threads_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type sb(sb_sexp); + arrow::r::Input::type threads(threads_sexp); dataset___ScannerBuilder__UseThreads(sb, threads); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___ScannerBuilder__UseThreads(SEXP sb_sexp, SEXP threads_sexp){ +extern "C" SEXP _arrow_dataset___ScannerBuilder__UseThreads(SEXP sb_sexp, SEXP threads_sexp){ Rf_error("Cannot call dataset___ScannerBuilder__UseThreads(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1685,16 +1685,16 @@ RcppExport SEXP _arrow_dataset___ScannerBuilder__UseThreads(SEXP sb_sexp, SEXP t // dataset.cpp #if defined(ARROW_R_WITH_ARROW) void dataset___ScannerBuilder__BatchSize(const std::shared_ptr& sb, int64_t batch_size); -RcppExport SEXP _arrow_dataset___ScannerBuilder__BatchSize(SEXP sb_sexp, SEXP batch_size_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type sb(sb_sexp); - Rcpp::traits::input_parameter::type batch_size(batch_size_sexp); +extern "C" SEXP _arrow_dataset___ScannerBuilder__BatchSize(SEXP sb_sexp, SEXP batch_size_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type sb(sb_sexp); + arrow::r::Input::type batch_size(batch_size_sexp); dataset___ScannerBuilder__BatchSize(sb, batch_size); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___ScannerBuilder__BatchSize(SEXP sb_sexp, SEXP batch_size_sexp){ +extern "C" SEXP _arrow_dataset___ScannerBuilder__BatchSize(SEXP sb_sexp, SEXP batch_size_sexp){ Rf_error("Cannot call dataset___ScannerBuilder__BatchSize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1702,14 +1702,14 @@ RcppExport SEXP _arrow_dataset___ScannerBuilder__BatchSize(SEXP sb_sexp, SEXP ba // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___ScannerBuilder__schema(const std::shared_ptr& sb); -RcppExport SEXP _arrow_dataset___ScannerBuilder__schema(SEXP sb_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type sb(sb_sexp); - return Rcpp::wrap(dataset___ScannerBuilder__schema(sb)); -END_RCPP +extern "C" SEXP _arrow_dataset___ScannerBuilder__schema(SEXP sb_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type sb(sb_sexp); + return cpp11::as_sexp(dataset___ScannerBuilder__schema(sb)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___ScannerBuilder__schema(SEXP sb_sexp){ +extern "C" SEXP _arrow_dataset___ScannerBuilder__schema(SEXP sb_sexp){ Rf_error("Cannot call dataset___ScannerBuilder__schema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1717,14 +1717,14 @@ RcppExport SEXP _arrow_dataset___ScannerBuilder__schema(SEXP sb_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___ScannerBuilder__Finish(const std::shared_ptr& sb); -RcppExport SEXP _arrow_dataset___ScannerBuilder__Finish(SEXP sb_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type sb(sb_sexp); - return Rcpp::wrap(dataset___ScannerBuilder__Finish(sb)); -END_RCPP +extern "C" SEXP _arrow_dataset___ScannerBuilder__Finish(SEXP sb_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type sb(sb_sexp); + return cpp11::as_sexp(dataset___ScannerBuilder__Finish(sb)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___ScannerBuilder__Finish(SEXP sb_sexp){ +extern "C" SEXP _arrow_dataset___ScannerBuilder__Finish(SEXP sb_sexp){ Rf_error("Cannot call dataset___ScannerBuilder__Finish(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1732,14 +1732,14 @@ RcppExport SEXP _arrow_dataset___ScannerBuilder__Finish(SEXP sb_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___Scanner__ToTable(const std::shared_ptr& scanner); -RcppExport SEXP _arrow_dataset___Scanner__ToTable(SEXP scanner_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type scanner(scanner_sexp); - return Rcpp::wrap(dataset___Scanner__ToTable(scanner)); -END_RCPP +extern "C" SEXP _arrow_dataset___Scanner__ToTable(SEXP scanner_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type scanner(scanner_sexp); + return cpp11::as_sexp(dataset___Scanner__ToTable(scanner)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___Scanner__ToTable(SEXP scanner_sexp){ +extern "C" SEXP _arrow_dataset___Scanner__ToTable(SEXP scanner_sexp){ Rf_error("Cannot call dataset___Scanner__ToTable(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1747,15 +1747,15 @@ RcppExport SEXP _arrow_dataset___Scanner__ToTable(SEXP scanner_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___Scanner__head(const std::shared_ptr& scanner, int n); -RcppExport SEXP _arrow_dataset___Scanner__head(SEXP scanner_sexp, SEXP n_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type scanner(scanner_sexp); - Rcpp::traits::input_parameter::type n(n_sexp); - return Rcpp::wrap(dataset___Scanner__head(scanner, n)); -END_RCPP +extern "C" SEXP _arrow_dataset___Scanner__head(SEXP scanner_sexp, SEXP n_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type scanner(scanner_sexp); + arrow::r::Input::type n(n_sexp); + return cpp11::as_sexp(dataset___Scanner__head(scanner, n)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___Scanner__head(SEXP scanner_sexp, SEXP n_sexp){ +extern "C" SEXP _arrow_dataset___Scanner__head(SEXP scanner_sexp, SEXP n_sexp){ Rf_error("Cannot call dataset___Scanner__head(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1763,14 +1763,14 @@ RcppExport SEXP _arrow_dataset___Scanner__head(SEXP scanner_sexp, SEXP n_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::vector> dataset___Scanner__Scan(const std::shared_ptr& scanner); -RcppExport SEXP _arrow_dataset___Scanner__Scan(SEXP scanner_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type scanner(scanner_sexp); - return Rcpp::wrap(dataset___Scanner__Scan(scanner)); -END_RCPP +extern "C" SEXP _arrow_dataset___Scanner__Scan(SEXP scanner_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type scanner(scanner_sexp); + return cpp11::as_sexp(dataset___Scanner__Scan(scanner)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___Scanner__Scan(SEXP scanner_sexp){ +extern "C" SEXP _arrow_dataset___Scanner__Scan(SEXP scanner_sexp){ Rf_error("Cannot call dataset___Scanner__Scan(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1778,14 +1778,14 @@ RcppExport SEXP _arrow_dataset___Scanner__Scan(SEXP scanner_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) std::vector> dataset___ScanTask__get_batches(const std::shared_ptr& scan_task); -RcppExport SEXP _arrow_dataset___ScanTask__get_batches(SEXP scan_task_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type scan_task(scan_task_sexp); - return Rcpp::wrap(dataset___ScanTask__get_batches(scan_task)); -END_RCPP +extern "C" SEXP _arrow_dataset___ScanTask__get_batches(SEXP scan_task_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type scan_task(scan_task_sexp); + return cpp11::as_sexp(dataset___ScanTask__get_batches(scan_task)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___ScanTask__get_batches(SEXP scan_task_sexp){ +extern "C" SEXP _arrow_dataset___ScanTask__get_batches(SEXP scan_task_sexp){ Rf_error("Cannot call dataset___ScanTask__get_batches(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1793,20 +1793,20 @@ RcppExport SEXP _arrow_dataset___ScanTask__get_batches(SEXP scan_task_sexp){ // dataset.cpp #if defined(ARROW_R_WITH_ARROW) void dataset___Dataset__Write(const std::shared_ptr& ds, const std::shared_ptr& schema, const std::shared_ptr& format, const std::shared_ptr& filesystem, std::string path, const std::shared_ptr& partitioning); -RcppExport SEXP _arrow_dataset___Dataset__Write(SEXP ds_sexp, SEXP schema_sexp, SEXP format_sexp, SEXP filesystem_sexp, SEXP path_sexp, SEXP partitioning_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type ds(ds_sexp); - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - Rcpp::traits::input_parameter&>::type format(format_sexp); - Rcpp::traits::input_parameter&>::type filesystem(filesystem_sexp); - Rcpp::traits::input_parameter::type path(path_sexp); - Rcpp::traits::input_parameter&>::type partitioning(partitioning_sexp); +extern "C" SEXP _arrow_dataset___Dataset__Write(SEXP ds_sexp, SEXP schema_sexp, SEXP format_sexp, SEXP filesystem_sexp, SEXP path_sexp, SEXP partitioning_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type ds(ds_sexp); + arrow::r::Input&>::type schema(schema_sexp); + arrow::r::Input&>::type format(format_sexp); + arrow::r::Input&>::type filesystem(filesystem_sexp); + arrow::r::Input::type path(path_sexp); + arrow::r::Input&>::type partitioning(partitioning_sexp); dataset___Dataset__Write(ds, schema, format, filesystem, path, partitioning); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___Dataset__Write(SEXP ds_sexp, SEXP schema_sexp, SEXP format_sexp, SEXP filesystem_sexp, SEXP path_sexp, SEXP partitioning_sexp){ +extern "C" SEXP _arrow_dataset___Dataset__Write(SEXP ds_sexp, SEXP schema_sexp, SEXP format_sexp, SEXP filesystem_sexp, SEXP path_sexp, SEXP partitioning_sexp){ Rf_error("Cannot call dataset___Dataset__Write(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1814,14 +1814,14 @@ RcppExport SEXP _arrow_dataset___Dataset__Write(SEXP ds_sexp, SEXP schema_sexp, // datatype.cpp #if defined(ARROW_R_WITH_ARROW) bool shared_ptr_is_null(SEXP xp); -RcppExport SEXP _arrow_shared_ptr_is_null(SEXP xp_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type xp(xp_sexp); - return Rcpp::wrap(shared_ptr_is_null(xp)); -END_RCPP +extern "C" SEXP _arrow_shared_ptr_is_null(SEXP xp_sexp){ +BEGIN_CPP11 + arrow::r::Input::type xp(xp_sexp); + return cpp11::as_sexp(shared_ptr_is_null(xp)); +END_CPP11 } #else -RcppExport SEXP _arrow_shared_ptr_is_null(SEXP xp_sexp){ +extern "C" SEXP _arrow_shared_ptr_is_null(SEXP xp_sexp){ Rf_error("Cannot call shared_ptr_is_null(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1829,14 +1829,14 @@ RcppExport SEXP _arrow_shared_ptr_is_null(SEXP xp_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) bool unique_ptr_is_null(SEXP xp); -RcppExport SEXP _arrow_unique_ptr_is_null(SEXP xp_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type xp(xp_sexp); - return Rcpp::wrap(unique_ptr_is_null(xp)); -END_RCPP +extern "C" SEXP _arrow_unique_ptr_is_null(SEXP xp_sexp){ +BEGIN_CPP11 + arrow::r::Input::type xp(xp_sexp); + return cpp11::as_sexp(unique_ptr_is_null(xp)); +END_CPP11 } #else -RcppExport SEXP _arrow_unique_ptr_is_null(SEXP xp_sexp){ +extern "C" SEXP _arrow_unique_ptr_is_null(SEXP xp_sexp){ Rf_error("Cannot call unique_ptr_is_null(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1844,13 +1844,13 @@ RcppExport SEXP _arrow_unique_ptr_is_null(SEXP xp_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Int8__initialize(); -RcppExport SEXP _arrow_Int8__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Int8__initialize()); -END_RCPP +extern "C" SEXP _arrow_Int8__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Int8__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Int8__initialize(){ +extern "C" SEXP _arrow_Int8__initialize(){ Rf_error("Cannot call Int8__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1858,13 +1858,13 @@ RcppExport SEXP _arrow_Int8__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Int16__initialize(); -RcppExport SEXP _arrow_Int16__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Int16__initialize()); -END_RCPP +extern "C" SEXP _arrow_Int16__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Int16__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Int16__initialize(){ +extern "C" SEXP _arrow_Int16__initialize(){ Rf_error("Cannot call Int16__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1872,13 +1872,13 @@ RcppExport SEXP _arrow_Int16__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Int32__initialize(); -RcppExport SEXP _arrow_Int32__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Int32__initialize()); -END_RCPP +extern "C" SEXP _arrow_Int32__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Int32__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Int32__initialize(){ +extern "C" SEXP _arrow_Int32__initialize(){ Rf_error("Cannot call Int32__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1886,13 +1886,13 @@ RcppExport SEXP _arrow_Int32__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Int64__initialize(); -RcppExport SEXP _arrow_Int64__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Int64__initialize()); -END_RCPP +extern "C" SEXP _arrow_Int64__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Int64__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Int64__initialize(){ +extern "C" SEXP _arrow_Int64__initialize(){ Rf_error("Cannot call Int64__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1900,13 +1900,13 @@ RcppExport SEXP _arrow_Int64__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr UInt8__initialize(); -RcppExport SEXP _arrow_UInt8__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(UInt8__initialize()); -END_RCPP +extern "C" SEXP _arrow_UInt8__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(UInt8__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_UInt8__initialize(){ +extern "C" SEXP _arrow_UInt8__initialize(){ Rf_error("Cannot call UInt8__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1914,13 +1914,13 @@ RcppExport SEXP _arrow_UInt8__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr UInt16__initialize(); -RcppExport SEXP _arrow_UInt16__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(UInt16__initialize()); -END_RCPP +extern "C" SEXP _arrow_UInt16__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(UInt16__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_UInt16__initialize(){ +extern "C" SEXP _arrow_UInt16__initialize(){ Rf_error("Cannot call UInt16__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1928,13 +1928,13 @@ RcppExport SEXP _arrow_UInt16__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr UInt32__initialize(); -RcppExport SEXP _arrow_UInt32__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(UInt32__initialize()); -END_RCPP +extern "C" SEXP _arrow_UInt32__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(UInt32__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_UInt32__initialize(){ +extern "C" SEXP _arrow_UInt32__initialize(){ Rf_error("Cannot call UInt32__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1942,13 +1942,13 @@ RcppExport SEXP _arrow_UInt32__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr UInt64__initialize(); -RcppExport SEXP _arrow_UInt64__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(UInt64__initialize()); -END_RCPP +extern "C" SEXP _arrow_UInt64__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(UInt64__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_UInt64__initialize(){ +extern "C" SEXP _arrow_UInt64__initialize(){ Rf_error("Cannot call UInt64__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1956,13 +1956,13 @@ RcppExport SEXP _arrow_UInt64__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Float16__initialize(); -RcppExport SEXP _arrow_Float16__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Float16__initialize()); -END_RCPP +extern "C" SEXP _arrow_Float16__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Float16__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Float16__initialize(){ +extern "C" SEXP _arrow_Float16__initialize(){ Rf_error("Cannot call Float16__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1970,13 +1970,13 @@ RcppExport SEXP _arrow_Float16__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Float32__initialize(); -RcppExport SEXP _arrow_Float32__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Float32__initialize()); -END_RCPP +extern "C" SEXP _arrow_Float32__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Float32__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Float32__initialize(){ +extern "C" SEXP _arrow_Float32__initialize(){ Rf_error("Cannot call Float32__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1984,13 +1984,13 @@ RcppExport SEXP _arrow_Float32__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Float64__initialize(); -RcppExport SEXP _arrow_Float64__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Float64__initialize()); -END_RCPP +extern "C" SEXP _arrow_Float64__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Float64__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Float64__initialize(){ +extern "C" SEXP _arrow_Float64__initialize(){ Rf_error("Cannot call Float64__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -1998,13 +1998,13 @@ RcppExport SEXP _arrow_Float64__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Boolean__initialize(); -RcppExport SEXP _arrow_Boolean__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Boolean__initialize()); -END_RCPP +extern "C" SEXP _arrow_Boolean__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Boolean__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Boolean__initialize(){ +extern "C" SEXP _arrow_Boolean__initialize(){ Rf_error("Cannot call Boolean__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2012,13 +2012,13 @@ RcppExport SEXP _arrow_Boolean__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Utf8__initialize(); -RcppExport SEXP _arrow_Utf8__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Utf8__initialize()); -END_RCPP +extern "C" SEXP _arrow_Utf8__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Utf8__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Utf8__initialize(){ +extern "C" SEXP _arrow_Utf8__initialize(){ Rf_error("Cannot call Utf8__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2026,13 +2026,13 @@ RcppExport SEXP _arrow_Utf8__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr LargeUtf8__initialize(); -RcppExport SEXP _arrow_LargeUtf8__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(LargeUtf8__initialize()); -END_RCPP +extern "C" SEXP _arrow_LargeUtf8__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(LargeUtf8__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_LargeUtf8__initialize(){ +extern "C" SEXP _arrow_LargeUtf8__initialize(){ Rf_error("Cannot call LargeUtf8__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2040,13 +2040,13 @@ RcppExport SEXP _arrow_LargeUtf8__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Binary__initialize(); -RcppExport SEXP _arrow_Binary__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Binary__initialize()); -END_RCPP +extern "C" SEXP _arrow_Binary__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Binary__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Binary__initialize(){ +extern "C" SEXP _arrow_Binary__initialize(){ Rf_error("Cannot call Binary__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2054,13 +2054,13 @@ RcppExport SEXP _arrow_Binary__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr LargeBinary__initialize(); -RcppExport SEXP _arrow_LargeBinary__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(LargeBinary__initialize()); -END_RCPP +extern "C" SEXP _arrow_LargeBinary__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(LargeBinary__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_LargeBinary__initialize(){ +extern "C" SEXP _arrow_LargeBinary__initialize(){ Rf_error("Cannot call LargeBinary__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2068,13 +2068,13 @@ RcppExport SEXP _arrow_LargeBinary__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Date32__initialize(); -RcppExport SEXP _arrow_Date32__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Date32__initialize()); -END_RCPP +extern "C" SEXP _arrow_Date32__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Date32__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Date32__initialize(){ +extern "C" SEXP _arrow_Date32__initialize(){ Rf_error("Cannot call Date32__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2082,13 +2082,13 @@ RcppExport SEXP _arrow_Date32__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Date64__initialize(); -RcppExport SEXP _arrow_Date64__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Date64__initialize()); -END_RCPP +extern "C" SEXP _arrow_Date64__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Date64__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Date64__initialize(){ +extern "C" SEXP _arrow_Date64__initialize(){ Rf_error("Cannot call Date64__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2096,13 +2096,13 @@ RcppExport SEXP _arrow_Date64__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Null__initialize(); -RcppExport SEXP _arrow_Null__initialize(){ -BEGIN_RCPP - return Rcpp::wrap(Null__initialize()); -END_RCPP +extern "C" SEXP _arrow_Null__initialize(){ +BEGIN_CPP11 + return cpp11::as_sexp(Null__initialize()); +END_CPP11 } #else -RcppExport SEXP _arrow_Null__initialize(){ +extern "C" SEXP _arrow_Null__initialize(){ Rf_error("Cannot call Null__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2110,30 +2110,30 @@ RcppExport SEXP _arrow_Null__initialize(){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Decimal128Type__initialize(int32_t precision, int32_t scale); -RcppExport SEXP _arrow_Decimal128Type__initialize(SEXP precision_sexp, SEXP scale_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type precision(precision_sexp); - Rcpp::traits::input_parameter::type scale(scale_sexp); - return Rcpp::wrap(Decimal128Type__initialize(precision, scale)); -END_RCPP +extern "C" SEXP _arrow_Decimal128Type__initialize(SEXP precision_sexp, SEXP scale_sexp){ +BEGIN_CPP11 + arrow::r::Input::type precision(precision_sexp); + arrow::r::Input::type scale(scale_sexp); + return cpp11::as_sexp(Decimal128Type__initialize(precision, scale)); +END_CPP11 } #else -RcppExport SEXP _arrow_Decimal128Type__initialize(SEXP precision_sexp, SEXP scale_sexp){ +extern "C" SEXP _arrow_Decimal128Type__initialize(SEXP precision_sexp, SEXP scale_sexp){ Rf_error("Cannot call Decimal128Type__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // datatype.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr FixedSizeBinary__initialize(int32_t byte_width); -RcppExport SEXP _arrow_FixedSizeBinary__initialize(SEXP byte_width_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type byte_width(byte_width_sexp); - return Rcpp::wrap(FixedSizeBinary__initialize(byte_width)); -END_RCPP +std::shared_ptr FixedSizeBinary__initialize(R_xlen_t byte_width); +extern "C" SEXP _arrow_FixedSizeBinary__initialize(SEXP byte_width_sexp){ +BEGIN_CPP11 + arrow::r::Input::type byte_width(byte_width_sexp); + return cpp11::as_sexp(FixedSizeBinary__initialize(byte_width)); +END_CPP11 } #else -RcppExport SEXP _arrow_FixedSizeBinary__initialize(SEXP byte_width_sexp){ +extern "C" SEXP _arrow_FixedSizeBinary__initialize(SEXP byte_width_sexp){ Rf_error("Cannot call FixedSizeBinary__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2141,15 +2141,15 @@ RcppExport SEXP _arrow_FixedSizeBinary__initialize(SEXP byte_width_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Timestamp__initialize(arrow::TimeUnit::type unit, const std::string& timezone); -RcppExport SEXP _arrow_Timestamp__initialize(SEXP unit_sexp, SEXP timezone_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type unit(unit_sexp); - Rcpp::traits::input_parameter::type timezone(timezone_sexp); - return Rcpp::wrap(Timestamp__initialize(unit, timezone)); -END_RCPP +extern "C" SEXP _arrow_Timestamp__initialize(SEXP unit_sexp, SEXP timezone_sexp){ +BEGIN_CPP11 + arrow::r::Input::type unit(unit_sexp); + arrow::r::Input::type timezone(timezone_sexp); + return cpp11::as_sexp(Timestamp__initialize(unit, timezone)); +END_CPP11 } #else -RcppExport SEXP _arrow_Timestamp__initialize(SEXP unit_sexp, SEXP timezone_sexp){ +extern "C" SEXP _arrow_Timestamp__initialize(SEXP unit_sexp, SEXP timezone_sexp){ Rf_error("Cannot call Timestamp__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2157,14 +2157,14 @@ RcppExport SEXP _arrow_Timestamp__initialize(SEXP unit_sexp, SEXP timezone_sexp) // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Time32__initialize(arrow::TimeUnit::type unit); -RcppExport SEXP _arrow_Time32__initialize(SEXP unit_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type unit(unit_sexp); - return Rcpp::wrap(Time32__initialize(unit)); -END_RCPP +extern "C" SEXP _arrow_Time32__initialize(SEXP unit_sexp){ +BEGIN_CPP11 + arrow::r::Input::type unit(unit_sexp); + return cpp11::as_sexp(Time32__initialize(unit)); +END_CPP11 } #else -RcppExport SEXP _arrow_Time32__initialize(SEXP unit_sexp){ +extern "C" SEXP _arrow_Time32__initialize(SEXP unit_sexp){ Rf_error("Cannot call Time32__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2172,14 +2172,14 @@ RcppExport SEXP _arrow_Time32__initialize(SEXP unit_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Time64__initialize(arrow::TimeUnit::type unit); -RcppExport SEXP _arrow_Time64__initialize(SEXP unit_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type unit(unit_sexp); - return Rcpp::wrap(Time64__initialize(unit)); -END_RCPP +extern "C" SEXP _arrow_Time64__initialize(SEXP unit_sexp){ +BEGIN_CPP11 + arrow::r::Input::type unit(unit_sexp); + return cpp11::as_sexp(Time64__initialize(unit)); +END_CPP11 } #else -RcppExport SEXP _arrow_Time64__initialize(SEXP unit_sexp){ +extern "C" SEXP _arrow_Time64__initialize(SEXP unit_sexp){ Rf_error("Cannot call Time64__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2187,14 +2187,14 @@ RcppExport SEXP _arrow_Time64__initialize(SEXP unit_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) SEXP list__(SEXP x); -RcppExport SEXP _arrow_list__(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type x(x_sexp); - return Rcpp::wrap(list__(x)); -END_RCPP +extern "C" SEXP _arrow_list__(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input::type x(x_sexp); + return cpp11::as_sexp(list__(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_list__(SEXP x_sexp){ +extern "C" SEXP _arrow_list__(SEXP x_sexp){ Rf_error("Cannot call list__(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2202,14 +2202,14 @@ RcppExport SEXP _arrow_list__(SEXP x_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) SEXP large_list__(SEXP x); -RcppExport SEXP _arrow_large_list__(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type x(x_sexp); - return Rcpp::wrap(large_list__(x)); -END_RCPP +extern "C" SEXP _arrow_large_list__(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input::type x(x_sexp); + return cpp11::as_sexp(large_list__(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_large_list__(SEXP x_sexp){ +extern "C" SEXP _arrow_large_list__(SEXP x_sexp){ Rf_error("Cannot call large_list__(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2217,45 +2217,45 @@ RcppExport SEXP _arrow_large_list__(SEXP x_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) SEXP fixed_size_list__(SEXP x, int list_size); -RcppExport SEXP _arrow_fixed_size_list__(SEXP x_sexp, SEXP list_size_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type x(x_sexp); - Rcpp::traits::input_parameter::type list_size(list_size_sexp); - return Rcpp::wrap(fixed_size_list__(x, list_size)); -END_RCPP +extern "C" SEXP _arrow_fixed_size_list__(SEXP x_sexp, SEXP list_size_sexp){ +BEGIN_CPP11 + arrow::r::Input::type x(x_sexp); + arrow::r::Input::type list_size(list_size_sexp); + return cpp11::as_sexp(fixed_size_list__(x, list_size)); +END_CPP11 } #else -RcppExport SEXP _arrow_fixed_size_list__(SEXP x_sexp, SEXP list_size_sexp){ +extern "C" SEXP _arrow_fixed_size_list__(SEXP x_sexp, SEXP list_size_sexp){ Rf_error("Cannot call fixed_size_list__(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // datatype.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr struct_(List fields); -RcppExport SEXP _arrow_struct_(SEXP fields_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type fields(fields_sexp); - return Rcpp::wrap(struct_(fields)); -END_RCPP +std::shared_ptr struct__(const std::vector>& fields); +extern "C" SEXP _arrow_struct__(SEXP fields_sexp){ +BEGIN_CPP11 + arrow::r::Input>&>::type fields(fields_sexp); + return cpp11::as_sexp(struct__(fields)); +END_CPP11 } #else -RcppExport SEXP _arrow_struct_(SEXP fields_sexp){ - Rf_error("Cannot call struct_(). Please use arrow::install_arrow() to install required runtime libraries. "); +extern "C" SEXP _arrow_struct__(SEXP fields_sexp){ + Rf_error("Cannot call struct__(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::string DataType__ToString(const std::shared_ptr& type); -RcppExport SEXP _arrow_DataType__ToString(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(DataType__ToString(type)); -END_RCPP +extern "C" SEXP _arrow_DataType__ToString(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(DataType__ToString(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_DataType__ToString(SEXP type_sexp){ +extern "C" SEXP _arrow_DataType__ToString(SEXP type_sexp){ Rf_error("Cannot call DataType__ToString(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2263,14 +2263,14 @@ RcppExport SEXP _arrow_DataType__ToString(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::string DataType__name(const std::shared_ptr& type); -RcppExport SEXP _arrow_DataType__name(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(DataType__name(type)); -END_RCPP +extern "C" SEXP _arrow_DataType__name(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(DataType__name(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_DataType__name(SEXP type_sexp){ +extern "C" SEXP _arrow_DataType__name(SEXP type_sexp){ Rf_error("Cannot call DataType__name(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2278,15 +2278,15 @@ RcppExport SEXP _arrow_DataType__name(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) bool DataType__Equals(const std::shared_ptr& lhs, const std::shared_ptr& rhs); -RcppExport SEXP _arrow_DataType__Equals(SEXP lhs_sexp, SEXP rhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - return Rcpp::wrap(DataType__Equals(lhs, rhs)); -END_RCPP +extern "C" SEXP _arrow_DataType__Equals(SEXP lhs_sexp, SEXP rhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + return cpp11::as_sexp(DataType__Equals(lhs, rhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_DataType__Equals(SEXP lhs_sexp, SEXP rhs_sexp){ +extern "C" SEXP _arrow_DataType__Equals(SEXP lhs_sexp, SEXP rhs_sexp){ Rf_error("Cannot call DataType__Equals(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2294,29 +2294,29 @@ RcppExport SEXP _arrow_DataType__Equals(SEXP lhs_sexp, SEXP rhs_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) int DataType__num_children(const std::shared_ptr& type); -RcppExport SEXP _arrow_DataType__num_children(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(DataType__num_children(type)); -END_RCPP +extern "C" SEXP _arrow_DataType__num_children(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(DataType__num_children(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_DataType__num_children(SEXP type_sexp){ +extern "C" SEXP _arrow_DataType__num_children(SEXP type_sexp){ Rf_error("Cannot call DataType__num_children(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // datatype.cpp #if defined(ARROW_R_WITH_ARROW) -List DataType__children_pointer(const std::shared_ptr& type); -RcppExport SEXP _arrow_DataType__children_pointer(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(DataType__children_pointer(type)); -END_RCPP +cpp11::writable::list DataType__children_pointer(const std::shared_ptr& type); +extern "C" SEXP _arrow_DataType__children_pointer(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(DataType__children_pointer(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_DataType__children_pointer(SEXP type_sexp){ +extern "C" SEXP _arrow_DataType__children_pointer(SEXP type_sexp){ Rf_error("Cannot call DataType__children_pointer(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2324,14 +2324,14 @@ RcppExport SEXP _arrow_DataType__children_pointer(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) arrow::Type::type DataType__id(const std::shared_ptr& type); -RcppExport SEXP _arrow_DataType__id(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(DataType__id(type)); -END_RCPP +extern "C" SEXP _arrow_DataType__id(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(DataType__id(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_DataType__id(SEXP type_sexp){ +extern "C" SEXP _arrow_DataType__id(SEXP type_sexp){ Rf_error("Cannot call DataType__id(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2339,14 +2339,14 @@ RcppExport SEXP _arrow_DataType__id(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::string ListType__ToString(const std::shared_ptr& type); -RcppExport SEXP _arrow_ListType__ToString(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(ListType__ToString(type)); -END_RCPP +extern "C" SEXP _arrow_ListType__ToString(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(ListType__ToString(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_ListType__ToString(SEXP type_sexp){ +extern "C" SEXP _arrow_ListType__ToString(SEXP type_sexp){ Rf_error("Cannot call ListType__ToString(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2354,14 +2354,14 @@ RcppExport SEXP _arrow_ListType__ToString(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) int FixedWidthType__bit_width(const std::shared_ptr& type); -RcppExport SEXP _arrow_FixedWidthType__bit_width(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(FixedWidthType__bit_width(type)); -END_RCPP +extern "C" SEXP _arrow_FixedWidthType__bit_width(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(FixedWidthType__bit_width(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_FixedWidthType__bit_width(SEXP type_sexp){ +extern "C" SEXP _arrow_FixedWidthType__bit_width(SEXP type_sexp){ Rf_error("Cannot call FixedWidthType__bit_width(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2369,14 +2369,14 @@ RcppExport SEXP _arrow_FixedWidthType__bit_width(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) arrow::DateUnit DateType__unit(const std::shared_ptr& type); -RcppExport SEXP _arrow_DateType__unit(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(DateType__unit(type)); -END_RCPP +extern "C" SEXP _arrow_DateType__unit(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(DateType__unit(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_DateType__unit(SEXP type_sexp){ +extern "C" SEXP _arrow_DateType__unit(SEXP type_sexp){ Rf_error("Cannot call DateType__unit(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2384,14 +2384,14 @@ RcppExport SEXP _arrow_DateType__unit(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) arrow::TimeUnit::type TimeType__unit(const std::shared_ptr& type); -RcppExport SEXP _arrow_TimeType__unit(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(TimeType__unit(type)); -END_RCPP +extern "C" SEXP _arrow_TimeType__unit(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(TimeType__unit(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_TimeType__unit(SEXP type_sexp){ +extern "C" SEXP _arrow_TimeType__unit(SEXP type_sexp){ Rf_error("Cannot call TimeType__unit(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2399,14 +2399,14 @@ RcppExport SEXP _arrow_TimeType__unit(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) int32_t DecimalType__precision(const std::shared_ptr& type); -RcppExport SEXP _arrow_DecimalType__precision(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(DecimalType__precision(type)); -END_RCPP +extern "C" SEXP _arrow_DecimalType__precision(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(DecimalType__precision(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_DecimalType__precision(SEXP type_sexp){ +extern "C" SEXP _arrow_DecimalType__precision(SEXP type_sexp){ Rf_error("Cannot call DecimalType__precision(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2414,14 +2414,14 @@ RcppExport SEXP _arrow_DecimalType__precision(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) int32_t DecimalType__scale(const std::shared_ptr& type); -RcppExport SEXP _arrow_DecimalType__scale(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(DecimalType__scale(type)); -END_RCPP +extern "C" SEXP _arrow_DecimalType__scale(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(DecimalType__scale(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_DecimalType__scale(SEXP type_sexp){ +extern "C" SEXP _arrow_DecimalType__scale(SEXP type_sexp){ Rf_error("Cannot call DecimalType__scale(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2429,14 +2429,14 @@ RcppExport SEXP _arrow_DecimalType__scale(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::string TimestampType__timezone(const std::shared_ptr& type); -RcppExport SEXP _arrow_TimestampType__timezone(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(TimestampType__timezone(type)); -END_RCPP +extern "C" SEXP _arrow_TimestampType__timezone(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(TimestampType__timezone(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_TimestampType__timezone(SEXP type_sexp){ +extern "C" SEXP _arrow_TimestampType__timezone(SEXP type_sexp){ Rf_error("Cannot call TimestampType__timezone(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2444,14 +2444,14 @@ RcppExport SEXP _arrow_TimestampType__timezone(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) arrow::TimeUnit::type TimestampType__unit(const std::shared_ptr& type); -RcppExport SEXP _arrow_TimestampType__unit(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(TimestampType__unit(type)); -END_RCPP +extern "C" SEXP _arrow_TimestampType__unit(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(TimestampType__unit(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_TimestampType__unit(SEXP type_sexp){ +extern "C" SEXP _arrow_TimestampType__unit(SEXP type_sexp){ Rf_error("Cannot call TimestampType__unit(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2459,16 +2459,16 @@ RcppExport SEXP _arrow_TimestampType__unit(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr DictionaryType__initialize(const std::shared_ptr& index_type, const std::shared_ptr& value_type, bool ordered); -RcppExport SEXP _arrow_DictionaryType__initialize(SEXP index_type_sexp, SEXP value_type_sexp, SEXP ordered_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type index_type(index_type_sexp); - Rcpp::traits::input_parameter&>::type value_type(value_type_sexp); - Rcpp::traits::input_parameter::type ordered(ordered_sexp); - return Rcpp::wrap(DictionaryType__initialize(index_type, value_type, ordered)); -END_RCPP +extern "C" SEXP _arrow_DictionaryType__initialize(SEXP index_type_sexp, SEXP value_type_sexp, SEXP ordered_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type index_type(index_type_sexp); + arrow::r::Input&>::type value_type(value_type_sexp); + arrow::r::Input::type ordered(ordered_sexp); + return cpp11::as_sexp(DictionaryType__initialize(index_type, value_type, ordered)); +END_CPP11 } #else -RcppExport SEXP _arrow_DictionaryType__initialize(SEXP index_type_sexp, SEXP value_type_sexp, SEXP ordered_sexp){ +extern "C" SEXP _arrow_DictionaryType__initialize(SEXP index_type_sexp, SEXP value_type_sexp, SEXP ordered_sexp){ Rf_error("Cannot call DictionaryType__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2476,14 +2476,14 @@ RcppExport SEXP _arrow_DictionaryType__initialize(SEXP index_type_sexp, SEXP val // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr DictionaryType__index_type(const std::shared_ptr& type); -RcppExport SEXP _arrow_DictionaryType__index_type(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(DictionaryType__index_type(type)); -END_RCPP +extern "C" SEXP _arrow_DictionaryType__index_type(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(DictionaryType__index_type(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_DictionaryType__index_type(SEXP type_sexp){ +extern "C" SEXP _arrow_DictionaryType__index_type(SEXP type_sexp){ Rf_error("Cannot call DictionaryType__index_type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2491,14 +2491,14 @@ RcppExport SEXP _arrow_DictionaryType__index_type(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr DictionaryType__value_type(const std::shared_ptr& type); -RcppExport SEXP _arrow_DictionaryType__value_type(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(DictionaryType__value_type(type)); -END_RCPP +extern "C" SEXP _arrow_DictionaryType__value_type(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(DictionaryType__value_type(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_DictionaryType__value_type(SEXP type_sexp){ +extern "C" SEXP _arrow_DictionaryType__value_type(SEXP type_sexp){ Rf_error("Cannot call DictionaryType__value_type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2506,14 +2506,14 @@ RcppExport SEXP _arrow_DictionaryType__value_type(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::string DictionaryType__name(const std::shared_ptr& type); -RcppExport SEXP _arrow_DictionaryType__name(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(DictionaryType__name(type)); -END_RCPP +extern "C" SEXP _arrow_DictionaryType__name(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(DictionaryType__name(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_DictionaryType__name(SEXP type_sexp){ +extern "C" SEXP _arrow_DictionaryType__name(SEXP type_sexp){ Rf_error("Cannot call DictionaryType__name(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2521,14 +2521,14 @@ RcppExport SEXP _arrow_DictionaryType__name(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) bool DictionaryType__ordered(const std::shared_ptr& type); -RcppExport SEXP _arrow_DictionaryType__ordered(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(DictionaryType__ordered(type)); -END_RCPP +extern "C" SEXP _arrow_DictionaryType__ordered(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(DictionaryType__ordered(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_DictionaryType__ordered(SEXP type_sexp){ +extern "C" SEXP _arrow_DictionaryType__ordered(SEXP type_sexp){ Rf_error("Cannot call DictionaryType__ordered(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2536,15 +2536,15 @@ RcppExport SEXP _arrow_DictionaryType__ordered(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr StructType__GetFieldByName(const std::shared_ptr& type, const std::string& name); -RcppExport SEXP _arrow_StructType__GetFieldByName(SEXP type_sexp, SEXP name_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - Rcpp::traits::input_parameter::type name(name_sexp); - return Rcpp::wrap(StructType__GetFieldByName(type, name)); -END_RCPP +extern "C" SEXP _arrow_StructType__GetFieldByName(SEXP type_sexp, SEXP name_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + arrow::r::Input::type name(name_sexp); + return cpp11::as_sexp(StructType__GetFieldByName(type, name)); +END_CPP11 } #else -RcppExport SEXP _arrow_StructType__GetFieldByName(SEXP type_sexp, SEXP name_sexp){ +extern "C" SEXP _arrow_StructType__GetFieldByName(SEXP type_sexp, SEXP name_sexp){ Rf_error("Cannot call StructType__GetFieldByName(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2552,15 +2552,15 @@ RcppExport SEXP _arrow_StructType__GetFieldByName(SEXP type_sexp, SEXP name_sexp // datatype.cpp #if defined(ARROW_R_WITH_ARROW) int StructType__GetFieldIndex(const std::shared_ptr& type, const std::string& name); -RcppExport SEXP _arrow_StructType__GetFieldIndex(SEXP type_sexp, SEXP name_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - Rcpp::traits::input_parameter::type name(name_sexp); - return Rcpp::wrap(StructType__GetFieldIndex(type, name)); -END_RCPP +extern "C" SEXP _arrow_StructType__GetFieldIndex(SEXP type_sexp, SEXP name_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + arrow::r::Input::type name(name_sexp); + return cpp11::as_sexp(StructType__GetFieldIndex(type, name)); +END_CPP11 } #else -RcppExport SEXP _arrow_StructType__GetFieldIndex(SEXP type_sexp, SEXP name_sexp){ +extern "C" SEXP _arrow_StructType__GetFieldIndex(SEXP type_sexp, SEXP name_sexp){ Rf_error("Cannot call StructType__GetFieldIndex(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2568,14 +2568,14 @@ RcppExport SEXP _arrow_StructType__GetFieldIndex(SEXP type_sexp, SEXP name_sexp) // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ListType__value_field(const std::shared_ptr& type); -RcppExport SEXP _arrow_ListType__value_field(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(ListType__value_field(type)); -END_RCPP +extern "C" SEXP _arrow_ListType__value_field(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(ListType__value_field(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_ListType__value_field(SEXP type_sexp){ +extern "C" SEXP _arrow_ListType__value_field(SEXP type_sexp){ Rf_error("Cannot call ListType__value_field(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2583,14 +2583,14 @@ RcppExport SEXP _arrow_ListType__value_field(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ListType__value_type(const std::shared_ptr& type); -RcppExport SEXP _arrow_ListType__value_type(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(ListType__value_type(type)); -END_RCPP +extern "C" SEXP _arrow_ListType__value_type(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(ListType__value_type(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_ListType__value_type(SEXP type_sexp){ +extern "C" SEXP _arrow_ListType__value_type(SEXP type_sexp){ Rf_error("Cannot call ListType__value_type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2598,14 +2598,14 @@ RcppExport SEXP _arrow_ListType__value_type(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr LargeListType__value_field(const std::shared_ptr& type); -RcppExport SEXP _arrow_LargeListType__value_field(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(LargeListType__value_field(type)); -END_RCPP +extern "C" SEXP _arrow_LargeListType__value_field(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(LargeListType__value_field(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_LargeListType__value_field(SEXP type_sexp){ +extern "C" SEXP _arrow_LargeListType__value_field(SEXP type_sexp){ Rf_error("Cannot call LargeListType__value_field(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2613,14 +2613,14 @@ RcppExport SEXP _arrow_LargeListType__value_field(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr LargeListType__value_type(const std::shared_ptr& type); -RcppExport SEXP _arrow_LargeListType__value_type(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(LargeListType__value_type(type)); -END_RCPP +extern "C" SEXP _arrow_LargeListType__value_type(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(LargeListType__value_type(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_LargeListType__value_type(SEXP type_sexp){ +extern "C" SEXP _arrow_LargeListType__value_type(SEXP type_sexp){ Rf_error("Cannot call LargeListType__value_type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2628,14 +2628,14 @@ RcppExport SEXP _arrow_LargeListType__value_type(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr FixedSizeListType__value_field(const std::shared_ptr& type); -RcppExport SEXP _arrow_FixedSizeListType__value_field(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(FixedSizeListType__value_field(type)); -END_RCPP +extern "C" SEXP _arrow_FixedSizeListType__value_field(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(FixedSizeListType__value_field(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_FixedSizeListType__value_field(SEXP type_sexp){ +extern "C" SEXP _arrow_FixedSizeListType__value_field(SEXP type_sexp){ Rf_error("Cannot call FixedSizeListType__value_field(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2643,14 +2643,14 @@ RcppExport SEXP _arrow_FixedSizeListType__value_field(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr FixedSizeListType__value_type(const std::shared_ptr& type); -RcppExport SEXP _arrow_FixedSizeListType__value_type(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(FixedSizeListType__value_type(type)); -END_RCPP +extern "C" SEXP _arrow_FixedSizeListType__value_type(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(FixedSizeListType__value_type(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_FixedSizeListType__value_type(SEXP type_sexp){ +extern "C" SEXP _arrow_FixedSizeListType__value_type(SEXP type_sexp){ Rf_error("Cannot call FixedSizeListType__value_type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2658,14 +2658,14 @@ RcppExport SEXP _arrow_FixedSizeListType__value_type(SEXP type_sexp){ // datatype.cpp #if defined(ARROW_R_WITH_ARROW) int FixedSizeListType__list_size(const std::shared_ptr& type); -RcppExport SEXP _arrow_FixedSizeListType__list_size(SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - return Rcpp::wrap(FixedSizeListType__list_size(type)); -END_RCPP +extern "C" SEXP _arrow_FixedSizeListType__list_size(SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + return cpp11::as_sexp(FixedSizeListType__list_size(type)); +END_CPP11 } #else -RcppExport SEXP _arrow_FixedSizeListType__list_size(SEXP type_sexp){ +extern "C" SEXP _arrow_FixedSizeListType__list_size(SEXP type_sexp){ Rf_error("Cannot call FixedSizeListType__list_size(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2673,14 +2673,14 @@ RcppExport SEXP _arrow_FixedSizeListType__list_size(SEXP type_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__field_ref(std::string name); -RcppExport SEXP _arrow_dataset___expr__field_ref(SEXP name_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type name(name_sexp); - return Rcpp::wrap(dataset___expr__field_ref(name)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__field_ref(SEXP name_sexp){ +BEGIN_CPP11 + arrow::r::Input::type name(name_sexp); + return cpp11::as_sexp(dataset___expr__field_ref(name)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__field_ref(SEXP name_sexp){ +extern "C" SEXP _arrow_dataset___expr__field_ref(SEXP name_sexp){ Rf_error("Cannot call dataset___expr__field_ref(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2688,15 +2688,15 @@ RcppExport SEXP _arrow_dataset___expr__field_ref(SEXP name_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__equal(const std::shared_ptr& lhs, const std::shared_ptr& rhs); -RcppExport SEXP _arrow_dataset___expr__equal(SEXP lhs_sexp, SEXP rhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - return Rcpp::wrap(dataset___expr__equal(lhs, rhs)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__equal(SEXP lhs_sexp, SEXP rhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + return cpp11::as_sexp(dataset___expr__equal(lhs, rhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__equal(SEXP lhs_sexp, SEXP rhs_sexp){ +extern "C" SEXP _arrow_dataset___expr__equal(SEXP lhs_sexp, SEXP rhs_sexp){ Rf_error("Cannot call dataset___expr__equal(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2704,15 +2704,15 @@ RcppExport SEXP _arrow_dataset___expr__equal(SEXP lhs_sexp, SEXP rhs_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__not_equal(const std::shared_ptr& lhs, const std::shared_ptr& rhs); -RcppExport SEXP _arrow_dataset___expr__not_equal(SEXP lhs_sexp, SEXP rhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - return Rcpp::wrap(dataset___expr__not_equal(lhs, rhs)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__not_equal(SEXP lhs_sexp, SEXP rhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + return cpp11::as_sexp(dataset___expr__not_equal(lhs, rhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__not_equal(SEXP lhs_sexp, SEXP rhs_sexp){ +extern "C" SEXP _arrow_dataset___expr__not_equal(SEXP lhs_sexp, SEXP rhs_sexp){ Rf_error("Cannot call dataset___expr__not_equal(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2720,15 +2720,15 @@ RcppExport SEXP _arrow_dataset___expr__not_equal(SEXP lhs_sexp, SEXP rhs_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__greater(const std::shared_ptr& lhs, const std::shared_ptr& rhs); -RcppExport SEXP _arrow_dataset___expr__greater(SEXP lhs_sexp, SEXP rhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - return Rcpp::wrap(dataset___expr__greater(lhs, rhs)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__greater(SEXP lhs_sexp, SEXP rhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + return cpp11::as_sexp(dataset___expr__greater(lhs, rhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__greater(SEXP lhs_sexp, SEXP rhs_sexp){ +extern "C" SEXP _arrow_dataset___expr__greater(SEXP lhs_sexp, SEXP rhs_sexp){ Rf_error("Cannot call dataset___expr__greater(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2736,15 +2736,15 @@ RcppExport SEXP _arrow_dataset___expr__greater(SEXP lhs_sexp, SEXP rhs_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__greater_equal(const std::shared_ptr& lhs, const std::shared_ptr& rhs); -RcppExport SEXP _arrow_dataset___expr__greater_equal(SEXP lhs_sexp, SEXP rhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - return Rcpp::wrap(dataset___expr__greater_equal(lhs, rhs)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__greater_equal(SEXP lhs_sexp, SEXP rhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + return cpp11::as_sexp(dataset___expr__greater_equal(lhs, rhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__greater_equal(SEXP lhs_sexp, SEXP rhs_sexp){ +extern "C" SEXP _arrow_dataset___expr__greater_equal(SEXP lhs_sexp, SEXP rhs_sexp){ Rf_error("Cannot call dataset___expr__greater_equal(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2752,15 +2752,15 @@ RcppExport SEXP _arrow_dataset___expr__greater_equal(SEXP lhs_sexp, SEXP rhs_sex // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__less(const std::shared_ptr& lhs, const std::shared_ptr& rhs); -RcppExport SEXP _arrow_dataset___expr__less(SEXP lhs_sexp, SEXP rhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - return Rcpp::wrap(dataset___expr__less(lhs, rhs)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__less(SEXP lhs_sexp, SEXP rhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + return cpp11::as_sexp(dataset___expr__less(lhs, rhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__less(SEXP lhs_sexp, SEXP rhs_sexp){ +extern "C" SEXP _arrow_dataset___expr__less(SEXP lhs_sexp, SEXP rhs_sexp){ Rf_error("Cannot call dataset___expr__less(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2768,15 +2768,15 @@ RcppExport SEXP _arrow_dataset___expr__less(SEXP lhs_sexp, SEXP rhs_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__less_equal(const std::shared_ptr& lhs, const std::shared_ptr& rhs); -RcppExport SEXP _arrow_dataset___expr__less_equal(SEXP lhs_sexp, SEXP rhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - return Rcpp::wrap(dataset___expr__less_equal(lhs, rhs)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__less_equal(SEXP lhs_sexp, SEXP rhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + return cpp11::as_sexp(dataset___expr__less_equal(lhs, rhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__less_equal(SEXP lhs_sexp, SEXP rhs_sexp){ +extern "C" SEXP _arrow_dataset___expr__less_equal(SEXP lhs_sexp, SEXP rhs_sexp){ Rf_error("Cannot call dataset___expr__less_equal(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2784,15 +2784,15 @@ RcppExport SEXP _arrow_dataset___expr__less_equal(SEXP lhs_sexp, SEXP rhs_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__in(const std::shared_ptr& lhs, const std::shared_ptr& rhs); -RcppExport SEXP _arrow_dataset___expr__in(SEXP lhs_sexp, SEXP rhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - return Rcpp::wrap(dataset___expr__in(lhs, rhs)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__in(SEXP lhs_sexp, SEXP rhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + return cpp11::as_sexp(dataset___expr__in(lhs, rhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__in(SEXP lhs_sexp, SEXP rhs_sexp){ +extern "C" SEXP _arrow_dataset___expr__in(SEXP lhs_sexp, SEXP rhs_sexp){ Rf_error("Cannot call dataset___expr__in(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2800,15 +2800,15 @@ RcppExport SEXP _arrow_dataset___expr__in(SEXP lhs_sexp, SEXP rhs_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__and(const std::shared_ptr& lhs, const std::shared_ptr& rhs); -RcppExport SEXP _arrow_dataset___expr__and(SEXP lhs_sexp, SEXP rhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - return Rcpp::wrap(dataset___expr__and(lhs, rhs)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__and(SEXP lhs_sexp, SEXP rhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + return cpp11::as_sexp(dataset___expr__and(lhs, rhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__and(SEXP lhs_sexp, SEXP rhs_sexp){ +extern "C" SEXP _arrow_dataset___expr__and(SEXP lhs_sexp, SEXP rhs_sexp){ Rf_error("Cannot call dataset___expr__and(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2816,15 +2816,15 @@ RcppExport SEXP _arrow_dataset___expr__and(SEXP lhs_sexp, SEXP rhs_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__or(const std::shared_ptr& lhs, const std::shared_ptr& rhs); -RcppExport SEXP _arrow_dataset___expr__or(SEXP lhs_sexp, SEXP rhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - return Rcpp::wrap(dataset___expr__or(lhs, rhs)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__or(SEXP lhs_sexp, SEXP rhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + return cpp11::as_sexp(dataset___expr__or(lhs, rhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__or(SEXP lhs_sexp, SEXP rhs_sexp){ +extern "C" SEXP _arrow_dataset___expr__or(SEXP lhs_sexp, SEXP rhs_sexp){ Rf_error("Cannot call dataset___expr__or(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2832,14 +2832,14 @@ RcppExport SEXP _arrow_dataset___expr__or(SEXP lhs_sexp, SEXP rhs_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__not(const std::shared_ptr& lhs); -RcppExport SEXP _arrow_dataset___expr__not(SEXP lhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - return Rcpp::wrap(dataset___expr__not(lhs)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__not(SEXP lhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + return cpp11::as_sexp(dataset___expr__not(lhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__not(SEXP lhs_sexp){ +extern "C" SEXP _arrow_dataset___expr__not(SEXP lhs_sexp){ Rf_error("Cannot call dataset___expr__not(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2847,14 +2847,14 @@ RcppExport SEXP _arrow_dataset___expr__not(SEXP lhs_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__is_valid(const std::shared_ptr& lhs); -RcppExport SEXP _arrow_dataset___expr__is_valid(SEXP lhs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - return Rcpp::wrap(dataset___expr__is_valid(lhs)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__is_valid(SEXP lhs_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + return cpp11::as_sexp(dataset___expr__is_valid(lhs)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__is_valid(SEXP lhs_sexp){ +extern "C" SEXP _arrow_dataset___expr__is_valid(SEXP lhs_sexp){ Rf_error("Cannot call dataset___expr__is_valid(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2862,14 +2862,14 @@ RcppExport SEXP _arrow_dataset___expr__is_valid(SEXP lhs_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr dataset___expr__scalar(const std::shared_ptr& x); -RcppExport SEXP _arrow_dataset___expr__scalar(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(dataset___expr__scalar(x)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__scalar(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(dataset___expr__scalar(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__scalar(SEXP x_sexp){ +extern "C" SEXP _arrow_dataset___expr__scalar(SEXP x_sexp){ Rf_error("Cannot call dataset___expr__scalar(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2877,14 +2877,14 @@ RcppExport SEXP _arrow_dataset___expr__scalar(SEXP x_sexp){ // expression.cpp #if defined(ARROW_R_WITH_ARROW) std::string dataset___expr__ToString(const std::shared_ptr& x); -RcppExport SEXP _arrow_dataset___expr__ToString(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(dataset___expr__ToString(x)); -END_RCPP +extern "C" SEXP _arrow_dataset___expr__ToString(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(dataset___expr__ToString(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_dataset___expr__ToString(SEXP x_sexp){ +extern "C" SEXP _arrow_dataset___expr__ToString(SEXP x_sexp){ Rf_error("Cannot call dataset___expr__ToString(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2892,20 +2892,20 @@ RcppExport SEXP _arrow_dataset___expr__ToString(SEXP x_sexp){ // feather.cpp #if defined(ARROW_R_WITH_ARROW) void ipc___WriteFeather__Table(const std::shared_ptr& stream, const std::shared_ptr& table, int version, int chunk_size, arrow::Compression::type compression, int compression_level); -RcppExport SEXP _arrow_ipc___WriteFeather__Table(SEXP stream_sexp, SEXP table_sexp, SEXP version_sexp, SEXP chunk_size_sexp, SEXP compression_sexp, SEXP compression_level_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - Rcpp::traits::input_parameter&>::type table(table_sexp); - Rcpp::traits::input_parameter::type version(version_sexp); - Rcpp::traits::input_parameter::type chunk_size(chunk_size_sexp); - Rcpp::traits::input_parameter::type compression(compression_sexp); - Rcpp::traits::input_parameter::type compression_level(compression_level_sexp); +extern "C" SEXP _arrow_ipc___WriteFeather__Table(SEXP stream_sexp, SEXP table_sexp, SEXP version_sexp, SEXP chunk_size_sexp, SEXP compression_sexp, SEXP compression_level_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + arrow::r::Input&>::type table(table_sexp); + arrow::r::Input::type version(version_sexp); + arrow::r::Input::type chunk_size(chunk_size_sexp); + arrow::r::Input::type compression(compression_sexp); + arrow::r::Input::type compression_level(compression_level_sexp); ipc___WriteFeather__Table(stream, table, version, chunk_size, compression, compression_level); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___WriteFeather__Table(SEXP stream_sexp, SEXP table_sexp, SEXP version_sexp, SEXP chunk_size_sexp, SEXP compression_sexp, SEXP compression_level_sexp){ +extern "C" SEXP _arrow_ipc___WriteFeather__Table(SEXP stream_sexp, SEXP table_sexp, SEXP version_sexp, SEXP chunk_size_sexp, SEXP compression_sexp, SEXP compression_level_sexp){ Rf_error("Cannot call ipc___WriteFeather__Table(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2913,14 +2913,14 @@ RcppExport SEXP _arrow_ipc___WriteFeather__Table(SEXP stream_sexp, SEXP table_se // feather.cpp #if defined(ARROW_R_WITH_ARROW) int ipc___feather___Reader__version(const std::shared_ptr& reader); -RcppExport SEXP _arrow_ipc___feather___Reader__version(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(ipc___feather___Reader__version(reader)); -END_RCPP +extern "C" SEXP _arrow_ipc___feather___Reader__version(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(ipc___feather___Reader__version(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___feather___Reader__version(SEXP reader_sexp){ +extern "C" SEXP _arrow_ipc___feather___Reader__version(SEXP reader_sexp){ Rf_error("Cannot call ipc___feather___Reader__version(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2928,15 +2928,15 @@ RcppExport SEXP _arrow_ipc___feather___Reader__version(SEXP reader_sexp){ // feather.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___feather___Reader__Read(const std::shared_ptr& reader, SEXP columns); -RcppExport SEXP _arrow_ipc___feather___Reader__Read(SEXP reader_sexp, SEXP columns_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - Rcpp::traits::input_parameter::type columns(columns_sexp); - return Rcpp::wrap(ipc___feather___Reader__Read(reader, columns)); -END_RCPP +extern "C" SEXP _arrow_ipc___feather___Reader__Read(SEXP reader_sexp, SEXP columns_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + arrow::r::Input::type columns(columns_sexp); + return cpp11::as_sexp(ipc___feather___Reader__Read(reader, columns)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___feather___Reader__Read(SEXP reader_sexp, SEXP columns_sexp){ +extern "C" SEXP _arrow_ipc___feather___Reader__Read(SEXP reader_sexp, SEXP columns_sexp){ Rf_error("Cannot call ipc___feather___Reader__Read(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2944,29 +2944,29 @@ RcppExport SEXP _arrow_ipc___feather___Reader__Read(SEXP reader_sexp, SEXP colum // feather.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___feather___Reader__Open(const std::shared_ptr& stream); -RcppExport SEXP _arrow_ipc___feather___Reader__Open(SEXP stream_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - return Rcpp::wrap(ipc___feather___Reader__Open(stream)); -END_RCPP +extern "C" SEXP _arrow_ipc___feather___Reader__Open(SEXP stream_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + return cpp11::as_sexp(ipc___feather___Reader__Open(stream)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___feather___Reader__Open(SEXP stream_sexp){ +extern "C" SEXP _arrow_ipc___feather___Reader__Open(SEXP stream_sexp){ Rf_error("Cannot call ipc___feather___Reader__Open(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // feather.cpp #if defined(ARROW_R_WITH_ARROW) -Rcpp::CharacterVector ipc___feather___Reader__column_names(const std::shared_ptr& reader); -RcppExport SEXP _arrow_ipc___feather___Reader__column_names(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(ipc___feather___Reader__column_names(reader)); -END_RCPP +cpp11::writable::strings ipc___feather___Reader__column_names(const std::shared_ptr& reader); +extern "C" SEXP _arrow_ipc___feather___Reader__column_names(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(ipc___feather___Reader__column_names(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___feather___Reader__column_names(SEXP reader_sexp){ +extern "C" SEXP _arrow_ipc___feather___Reader__column_names(SEXP reader_sexp){ Rf_error("Cannot call ipc___feather___Reader__column_names(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2974,16 +2974,16 @@ RcppExport SEXP _arrow_ipc___feather___Reader__column_names(SEXP reader_sexp){ // field.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Field__initialize(const std::string& name, const std::shared_ptr& field, bool nullable); -RcppExport SEXP _arrow_Field__initialize(SEXP name_sexp, SEXP field_sexp, SEXP nullable_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type name(name_sexp); - Rcpp::traits::input_parameter&>::type field(field_sexp); - Rcpp::traits::input_parameter::type nullable(nullable_sexp); - return Rcpp::wrap(Field__initialize(name, field, nullable)); -END_RCPP +extern "C" SEXP _arrow_Field__initialize(SEXP name_sexp, SEXP field_sexp, SEXP nullable_sexp){ +BEGIN_CPP11 + arrow::r::Input::type name(name_sexp); + arrow::r::Input&>::type field(field_sexp); + arrow::r::Input::type nullable(nullable_sexp); + return cpp11::as_sexp(Field__initialize(name, field, nullable)); +END_CPP11 } #else -RcppExport SEXP _arrow_Field__initialize(SEXP name_sexp, SEXP field_sexp, SEXP nullable_sexp){ +extern "C" SEXP _arrow_Field__initialize(SEXP name_sexp, SEXP field_sexp, SEXP nullable_sexp){ Rf_error("Cannot call Field__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -2991,14 +2991,14 @@ RcppExport SEXP _arrow_Field__initialize(SEXP name_sexp, SEXP field_sexp, SEXP n // field.cpp #if defined(ARROW_R_WITH_ARROW) std::string Field__ToString(const std::shared_ptr& field); -RcppExport SEXP _arrow_Field__ToString(SEXP field_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type field(field_sexp); - return Rcpp::wrap(Field__ToString(field)); -END_RCPP +extern "C" SEXP _arrow_Field__ToString(SEXP field_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type field(field_sexp); + return cpp11::as_sexp(Field__ToString(field)); +END_CPP11 } #else -RcppExport SEXP _arrow_Field__ToString(SEXP field_sexp){ +extern "C" SEXP _arrow_Field__ToString(SEXP field_sexp){ Rf_error("Cannot call Field__ToString(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3006,14 +3006,14 @@ RcppExport SEXP _arrow_Field__ToString(SEXP field_sexp){ // field.cpp #if defined(ARROW_R_WITH_ARROW) std::string Field__name(const std::shared_ptr& field); -RcppExport SEXP _arrow_Field__name(SEXP field_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type field(field_sexp); - return Rcpp::wrap(Field__name(field)); -END_RCPP +extern "C" SEXP _arrow_Field__name(SEXP field_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type field(field_sexp); + return cpp11::as_sexp(Field__name(field)); +END_CPP11 } #else -RcppExport SEXP _arrow_Field__name(SEXP field_sexp){ +extern "C" SEXP _arrow_Field__name(SEXP field_sexp){ Rf_error("Cannot call Field__name(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3021,15 +3021,15 @@ RcppExport SEXP _arrow_Field__name(SEXP field_sexp){ // field.cpp #if defined(ARROW_R_WITH_ARROW) bool Field__Equals(const std::shared_ptr& field, const std::shared_ptr& other); -RcppExport SEXP _arrow_Field__Equals(SEXP field_sexp, SEXP other_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type field(field_sexp); - Rcpp::traits::input_parameter&>::type other(other_sexp); - return Rcpp::wrap(Field__Equals(field, other)); -END_RCPP +extern "C" SEXP _arrow_Field__Equals(SEXP field_sexp, SEXP other_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type field(field_sexp); + arrow::r::Input&>::type other(other_sexp); + return cpp11::as_sexp(Field__Equals(field, other)); +END_CPP11 } #else -RcppExport SEXP _arrow_Field__Equals(SEXP field_sexp, SEXP other_sexp){ +extern "C" SEXP _arrow_Field__Equals(SEXP field_sexp, SEXP other_sexp){ Rf_error("Cannot call Field__Equals(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3037,14 +3037,14 @@ RcppExport SEXP _arrow_Field__Equals(SEXP field_sexp, SEXP other_sexp){ // field.cpp #if defined(ARROW_R_WITH_ARROW) bool Field__nullable(const std::shared_ptr& field); -RcppExport SEXP _arrow_Field__nullable(SEXP field_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type field(field_sexp); - return Rcpp::wrap(Field__nullable(field)); -END_RCPP +extern "C" SEXP _arrow_Field__nullable(SEXP field_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type field(field_sexp); + return cpp11::as_sexp(Field__nullable(field)); +END_CPP11 } #else -RcppExport SEXP _arrow_Field__nullable(SEXP field_sexp){ +extern "C" SEXP _arrow_Field__nullable(SEXP field_sexp){ Rf_error("Cannot call Field__nullable(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3052,14 +3052,14 @@ RcppExport SEXP _arrow_Field__nullable(SEXP field_sexp){ // field.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Field__type(const std::shared_ptr& field); -RcppExport SEXP _arrow_Field__type(SEXP field_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type field(field_sexp); - return Rcpp::wrap(Field__type(field)); -END_RCPP +extern "C" SEXP _arrow_Field__type(SEXP field_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type field(field_sexp); + return cpp11::as_sexp(Field__type(field)); +END_CPP11 } #else -RcppExport SEXP _arrow_Field__type(SEXP field_sexp){ +extern "C" SEXP _arrow_Field__type(SEXP field_sexp){ Rf_error("Cannot call Field__type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3067,14 +3067,14 @@ RcppExport SEXP _arrow_Field__type(SEXP field_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) fs::FileType fs___FileInfo__type(const std::shared_ptr& x); -RcppExport SEXP _arrow_fs___FileInfo__type(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(fs___FileInfo__type(x)); -END_RCPP +extern "C" SEXP _arrow_fs___FileInfo__type(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(fs___FileInfo__type(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileInfo__type(SEXP x_sexp){ +extern "C" SEXP _arrow_fs___FileInfo__type(SEXP x_sexp){ Rf_error("Cannot call fs___FileInfo__type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3082,16 +3082,16 @@ RcppExport SEXP _arrow_fs___FileInfo__type(SEXP x_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) void fs___FileInfo__set_type(const std::shared_ptr& x, fs::FileType type); -RcppExport SEXP _arrow_fs___FileInfo__set_type(SEXP x_sexp, SEXP type_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type type(type_sexp); +extern "C" SEXP _arrow_fs___FileInfo__set_type(SEXP x_sexp, SEXP type_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type type(type_sexp); fs___FileInfo__set_type(x, type); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileInfo__set_type(SEXP x_sexp, SEXP type_sexp){ +extern "C" SEXP _arrow_fs___FileInfo__set_type(SEXP x_sexp, SEXP type_sexp){ Rf_error("Cannot call fs___FileInfo__set_type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3099,14 +3099,14 @@ RcppExport SEXP _arrow_fs___FileInfo__set_type(SEXP x_sexp, SEXP type_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::string fs___FileInfo__path(const std::shared_ptr& x); -RcppExport SEXP _arrow_fs___FileInfo__path(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(fs___FileInfo__path(x)); -END_RCPP +extern "C" SEXP _arrow_fs___FileInfo__path(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(fs___FileInfo__path(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileInfo__path(SEXP x_sexp){ +extern "C" SEXP _arrow_fs___FileInfo__path(SEXP x_sexp){ Rf_error("Cannot call fs___FileInfo__path(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3114,16 +3114,16 @@ RcppExport SEXP _arrow_fs___FileInfo__path(SEXP x_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) void fs___FileInfo__set_path(const std::shared_ptr& x, const std::string& path); -RcppExport SEXP _arrow_fs___FileInfo__set_path(SEXP x_sexp, SEXP path_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type path(path_sexp); +extern "C" SEXP _arrow_fs___FileInfo__set_path(SEXP x_sexp, SEXP path_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type path(path_sexp); fs___FileInfo__set_path(x, path); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileInfo__set_path(SEXP x_sexp, SEXP path_sexp){ +extern "C" SEXP _arrow_fs___FileInfo__set_path(SEXP x_sexp, SEXP path_sexp){ Rf_error("Cannot call fs___FileInfo__set_path(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3131,14 +3131,14 @@ RcppExport SEXP _arrow_fs___FileInfo__set_path(SEXP x_sexp, SEXP path_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) int64_t fs___FileInfo__size(const std::shared_ptr& x); -RcppExport SEXP _arrow_fs___FileInfo__size(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(fs___FileInfo__size(x)); -END_RCPP +extern "C" SEXP _arrow_fs___FileInfo__size(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(fs___FileInfo__size(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileInfo__size(SEXP x_sexp){ +extern "C" SEXP _arrow_fs___FileInfo__size(SEXP x_sexp){ Rf_error("Cannot call fs___FileInfo__size(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3146,16 +3146,16 @@ RcppExport SEXP _arrow_fs___FileInfo__size(SEXP x_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) void fs___FileInfo__set_size(const std::shared_ptr& x, int64_t size); -RcppExport SEXP _arrow_fs___FileInfo__set_size(SEXP x_sexp, SEXP size_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type size(size_sexp); +extern "C" SEXP _arrow_fs___FileInfo__set_size(SEXP x_sexp, SEXP size_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type size(size_sexp); fs___FileInfo__set_size(x, size); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileInfo__set_size(SEXP x_sexp, SEXP size_sexp){ +extern "C" SEXP _arrow_fs___FileInfo__set_size(SEXP x_sexp, SEXP size_sexp){ Rf_error("Cannot call fs___FileInfo__set_size(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3163,14 +3163,14 @@ RcppExport SEXP _arrow_fs___FileInfo__set_size(SEXP x_sexp, SEXP size_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::string fs___FileInfo__base_name(const std::shared_ptr& x); -RcppExport SEXP _arrow_fs___FileInfo__base_name(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(fs___FileInfo__base_name(x)); -END_RCPP +extern "C" SEXP _arrow_fs___FileInfo__base_name(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(fs___FileInfo__base_name(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileInfo__base_name(SEXP x_sexp){ +extern "C" SEXP _arrow_fs___FileInfo__base_name(SEXP x_sexp){ Rf_error("Cannot call fs___FileInfo__base_name(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3178,14 +3178,14 @@ RcppExport SEXP _arrow_fs___FileInfo__base_name(SEXP x_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::string fs___FileInfo__extension(const std::shared_ptr& x); -RcppExport SEXP _arrow_fs___FileInfo__extension(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(fs___FileInfo__extension(x)); -END_RCPP +extern "C" SEXP _arrow_fs___FileInfo__extension(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(fs___FileInfo__extension(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileInfo__extension(SEXP x_sexp){ +extern "C" SEXP _arrow_fs___FileInfo__extension(SEXP x_sexp){ Rf_error("Cannot call fs___FileInfo__extension(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3193,14 +3193,14 @@ RcppExport SEXP _arrow_fs___FileInfo__extension(SEXP x_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) SEXP fs___FileInfo__mtime(const std::shared_ptr& x); -RcppExport SEXP _arrow_fs___FileInfo__mtime(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(fs___FileInfo__mtime(x)); -END_RCPP +extern "C" SEXP _arrow_fs___FileInfo__mtime(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(fs___FileInfo__mtime(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileInfo__mtime(SEXP x_sexp){ +extern "C" SEXP _arrow_fs___FileInfo__mtime(SEXP x_sexp){ Rf_error("Cannot call fs___FileInfo__mtime(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3208,16 +3208,16 @@ RcppExport SEXP _arrow_fs___FileInfo__mtime(SEXP x_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) void fs___FileInfo__set_mtime(const std::shared_ptr& x, SEXP time); -RcppExport SEXP _arrow_fs___FileInfo__set_mtime(SEXP x_sexp, SEXP time_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type time(time_sexp); +extern "C" SEXP _arrow_fs___FileInfo__set_mtime(SEXP x_sexp, SEXP time_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type time(time_sexp); fs___FileInfo__set_mtime(x, time); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileInfo__set_mtime(SEXP x_sexp, SEXP time_sexp){ +extern "C" SEXP _arrow_fs___FileInfo__set_mtime(SEXP x_sexp, SEXP time_sexp){ Rf_error("Cannot call fs___FileInfo__set_mtime(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3225,14 +3225,14 @@ RcppExport SEXP _arrow_fs___FileInfo__set_mtime(SEXP x_sexp, SEXP time_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::string fs___FileSelector__base_dir(const std::shared_ptr& selector); -RcppExport SEXP _arrow_fs___FileSelector__base_dir(SEXP selector_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type selector(selector_sexp); - return Rcpp::wrap(fs___FileSelector__base_dir(selector)); -END_RCPP +extern "C" SEXP _arrow_fs___FileSelector__base_dir(SEXP selector_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type selector(selector_sexp); + return cpp11::as_sexp(fs___FileSelector__base_dir(selector)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSelector__base_dir(SEXP selector_sexp){ +extern "C" SEXP _arrow_fs___FileSelector__base_dir(SEXP selector_sexp){ Rf_error("Cannot call fs___FileSelector__base_dir(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3240,14 +3240,14 @@ RcppExport SEXP _arrow_fs___FileSelector__base_dir(SEXP selector_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) bool fs___FileSelector__allow_not_found(const std::shared_ptr& selector); -RcppExport SEXP _arrow_fs___FileSelector__allow_not_found(SEXP selector_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type selector(selector_sexp); - return Rcpp::wrap(fs___FileSelector__allow_not_found(selector)); -END_RCPP +extern "C" SEXP _arrow_fs___FileSelector__allow_not_found(SEXP selector_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type selector(selector_sexp); + return cpp11::as_sexp(fs___FileSelector__allow_not_found(selector)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSelector__allow_not_found(SEXP selector_sexp){ +extern "C" SEXP _arrow_fs___FileSelector__allow_not_found(SEXP selector_sexp){ Rf_error("Cannot call fs___FileSelector__allow_not_found(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3255,14 +3255,14 @@ RcppExport SEXP _arrow_fs___FileSelector__allow_not_found(SEXP selector_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) bool fs___FileSelector__recursive(const std::shared_ptr& selector); -RcppExport SEXP _arrow_fs___FileSelector__recursive(SEXP selector_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type selector(selector_sexp); - return Rcpp::wrap(fs___FileSelector__recursive(selector)); -END_RCPP +extern "C" SEXP _arrow_fs___FileSelector__recursive(SEXP selector_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type selector(selector_sexp); + return cpp11::as_sexp(fs___FileSelector__recursive(selector)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSelector__recursive(SEXP selector_sexp){ +extern "C" SEXP _arrow_fs___FileSelector__recursive(SEXP selector_sexp){ Rf_error("Cannot call fs___FileSelector__recursive(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3270,16 +3270,16 @@ RcppExport SEXP _arrow_fs___FileSelector__recursive(SEXP selector_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr fs___FileSelector__create(const std::string& base_dir, bool allow_not_found, bool recursive); -RcppExport SEXP _arrow_fs___FileSelector__create(SEXP base_dir_sexp, SEXP allow_not_found_sexp, SEXP recursive_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type base_dir(base_dir_sexp); - Rcpp::traits::input_parameter::type allow_not_found(allow_not_found_sexp); - Rcpp::traits::input_parameter::type recursive(recursive_sexp); - return Rcpp::wrap(fs___FileSelector__create(base_dir, allow_not_found, recursive)); -END_RCPP +extern "C" SEXP _arrow_fs___FileSelector__create(SEXP base_dir_sexp, SEXP allow_not_found_sexp, SEXP recursive_sexp){ +BEGIN_CPP11 + arrow::r::Input::type base_dir(base_dir_sexp); + arrow::r::Input::type allow_not_found(allow_not_found_sexp); + arrow::r::Input::type recursive(recursive_sexp); + return cpp11::as_sexp(fs___FileSelector__create(base_dir, allow_not_found, recursive)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSelector__create(SEXP base_dir_sexp, SEXP allow_not_found_sexp, SEXP recursive_sexp){ +extern "C" SEXP _arrow_fs___FileSelector__create(SEXP base_dir_sexp, SEXP allow_not_found_sexp, SEXP recursive_sexp){ Rf_error("Cannot call fs___FileSelector__create(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3287,15 +3287,15 @@ RcppExport SEXP _arrow_fs___FileSelector__create(SEXP base_dir_sexp, SEXP allow_ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::vector> fs___FileSystem__GetTargetInfos_Paths(const std::shared_ptr& file_system, const std::vector& paths); -RcppExport SEXP _arrow_fs___FileSystem__GetTargetInfos_Paths(SEXP file_system_sexp, SEXP paths_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter&>::type paths(paths_sexp); - return Rcpp::wrap(fs___FileSystem__GetTargetInfos_Paths(file_system, paths)); -END_RCPP +extern "C" SEXP _arrow_fs___FileSystem__GetTargetInfos_Paths(SEXP file_system_sexp, SEXP paths_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input&>::type paths(paths_sexp); + return cpp11::as_sexp(fs___FileSystem__GetTargetInfos_Paths(file_system, paths)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__GetTargetInfos_Paths(SEXP file_system_sexp, SEXP paths_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__GetTargetInfos_Paths(SEXP file_system_sexp, SEXP paths_sexp){ Rf_error("Cannot call fs___FileSystem__GetTargetInfos_Paths(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3303,15 +3303,15 @@ RcppExport SEXP _arrow_fs___FileSystem__GetTargetInfos_Paths(SEXP file_system_se // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::vector> fs___FileSystem__GetTargetInfos_FileSelector(const std::shared_ptr& file_system, const std::shared_ptr& selector); -RcppExport SEXP _arrow_fs___FileSystem__GetTargetInfos_FileSelector(SEXP file_system_sexp, SEXP selector_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter&>::type selector(selector_sexp); - return Rcpp::wrap(fs___FileSystem__GetTargetInfos_FileSelector(file_system, selector)); -END_RCPP +extern "C" SEXP _arrow_fs___FileSystem__GetTargetInfos_FileSelector(SEXP file_system_sexp, SEXP selector_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input&>::type selector(selector_sexp); + return cpp11::as_sexp(fs___FileSystem__GetTargetInfos_FileSelector(file_system, selector)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__GetTargetInfos_FileSelector(SEXP file_system_sexp, SEXP selector_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__GetTargetInfos_FileSelector(SEXP file_system_sexp, SEXP selector_sexp){ Rf_error("Cannot call fs___FileSystem__GetTargetInfos_FileSelector(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3319,17 +3319,17 @@ RcppExport SEXP _arrow_fs___FileSystem__GetTargetInfos_FileSelector(SEXP file_sy // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) void fs___FileSystem__CreateDir(const std::shared_ptr& file_system, const std::string& path, bool recursive); -RcppExport SEXP _arrow_fs___FileSystem__CreateDir(SEXP file_system_sexp, SEXP path_sexp, SEXP recursive_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter::type path(path_sexp); - Rcpp::traits::input_parameter::type recursive(recursive_sexp); +extern "C" SEXP _arrow_fs___FileSystem__CreateDir(SEXP file_system_sexp, SEXP path_sexp, SEXP recursive_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input::type path(path_sexp); + arrow::r::Input::type recursive(recursive_sexp); fs___FileSystem__CreateDir(file_system, path, recursive); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__CreateDir(SEXP file_system_sexp, SEXP path_sexp, SEXP recursive_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__CreateDir(SEXP file_system_sexp, SEXP path_sexp, SEXP recursive_sexp){ Rf_error("Cannot call fs___FileSystem__CreateDir(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3337,16 +3337,16 @@ RcppExport SEXP _arrow_fs___FileSystem__CreateDir(SEXP file_system_sexp, SEXP pa // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) void fs___FileSystem__DeleteDir(const std::shared_ptr& file_system, const std::string& path); -RcppExport SEXP _arrow_fs___FileSystem__DeleteDir(SEXP file_system_sexp, SEXP path_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter::type path(path_sexp); +extern "C" SEXP _arrow_fs___FileSystem__DeleteDir(SEXP file_system_sexp, SEXP path_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input::type path(path_sexp); fs___FileSystem__DeleteDir(file_system, path); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__DeleteDir(SEXP file_system_sexp, SEXP path_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__DeleteDir(SEXP file_system_sexp, SEXP path_sexp){ Rf_error("Cannot call fs___FileSystem__DeleteDir(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3354,16 +3354,16 @@ RcppExport SEXP _arrow_fs___FileSystem__DeleteDir(SEXP file_system_sexp, SEXP pa // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) void fs___FileSystem__DeleteDirContents(const std::shared_ptr& file_system, const std::string& path); -RcppExport SEXP _arrow_fs___FileSystem__DeleteDirContents(SEXP file_system_sexp, SEXP path_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter::type path(path_sexp); +extern "C" SEXP _arrow_fs___FileSystem__DeleteDirContents(SEXP file_system_sexp, SEXP path_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input::type path(path_sexp); fs___FileSystem__DeleteDirContents(file_system, path); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__DeleteDirContents(SEXP file_system_sexp, SEXP path_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__DeleteDirContents(SEXP file_system_sexp, SEXP path_sexp){ Rf_error("Cannot call fs___FileSystem__DeleteDirContents(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3371,16 +3371,16 @@ RcppExport SEXP _arrow_fs___FileSystem__DeleteDirContents(SEXP file_system_sexp, // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) void fs___FileSystem__DeleteFile(const std::shared_ptr& file_system, const std::string& path); -RcppExport SEXP _arrow_fs___FileSystem__DeleteFile(SEXP file_system_sexp, SEXP path_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter::type path(path_sexp); +extern "C" SEXP _arrow_fs___FileSystem__DeleteFile(SEXP file_system_sexp, SEXP path_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input::type path(path_sexp); fs___FileSystem__DeleteFile(file_system, path); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__DeleteFile(SEXP file_system_sexp, SEXP path_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__DeleteFile(SEXP file_system_sexp, SEXP path_sexp){ Rf_error("Cannot call fs___FileSystem__DeleteFile(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3388,16 +3388,16 @@ RcppExport SEXP _arrow_fs___FileSystem__DeleteFile(SEXP file_system_sexp, SEXP p // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) void fs___FileSystem__DeleteFiles(const std::shared_ptr& file_system, const std::vector& paths); -RcppExport SEXP _arrow_fs___FileSystem__DeleteFiles(SEXP file_system_sexp, SEXP paths_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter&>::type paths(paths_sexp); +extern "C" SEXP _arrow_fs___FileSystem__DeleteFiles(SEXP file_system_sexp, SEXP paths_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input&>::type paths(paths_sexp); fs___FileSystem__DeleteFiles(file_system, paths); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__DeleteFiles(SEXP file_system_sexp, SEXP paths_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__DeleteFiles(SEXP file_system_sexp, SEXP paths_sexp){ Rf_error("Cannot call fs___FileSystem__DeleteFiles(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3405,17 +3405,17 @@ RcppExport SEXP _arrow_fs___FileSystem__DeleteFiles(SEXP file_system_sexp, SEXP // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) void fs___FileSystem__Move(const std::shared_ptr& file_system, const std::string& src, const std::string& dest); -RcppExport SEXP _arrow_fs___FileSystem__Move(SEXP file_system_sexp, SEXP src_sexp, SEXP dest_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter::type src(src_sexp); - Rcpp::traits::input_parameter::type dest(dest_sexp); +extern "C" SEXP _arrow_fs___FileSystem__Move(SEXP file_system_sexp, SEXP src_sexp, SEXP dest_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input::type src(src_sexp); + arrow::r::Input::type dest(dest_sexp); fs___FileSystem__Move(file_system, src, dest); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__Move(SEXP file_system_sexp, SEXP src_sexp, SEXP dest_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__Move(SEXP file_system_sexp, SEXP src_sexp, SEXP dest_sexp){ Rf_error("Cannot call fs___FileSystem__Move(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3423,17 +3423,17 @@ RcppExport SEXP _arrow_fs___FileSystem__Move(SEXP file_system_sexp, SEXP src_sex // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) void fs___FileSystem__CopyFile(const std::shared_ptr& file_system, const std::string& src, const std::string& dest); -RcppExport SEXP _arrow_fs___FileSystem__CopyFile(SEXP file_system_sexp, SEXP src_sexp, SEXP dest_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter::type src(src_sexp); - Rcpp::traits::input_parameter::type dest(dest_sexp); +extern "C" SEXP _arrow_fs___FileSystem__CopyFile(SEXP file_system_sexp, SEXP src_sexp, SEXP dest_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input::type src(src_sexp); + arrow::r::Input::type dest(dest_sexp); fs___FileSystem__CopyFile(file_system, src, dest); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__CopyFile(SEXP file_system_sexp, SEXP src_sexp, SEXP dest_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__CopyFile(SEXP file_system_sexp, SEXP src_sexp, SEXP dest_sexp){ Rf_error("Cannot call fs___FileSystem__CopyFile(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3441,15 +3441,15 @@ RcppExport SEXP _arrow_fs___FileSystem__CopyFile(SEXP file_system_sexp, SEXP src // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr fs___FileSystem__OpenInputStream(const std::shared_ptr& file_system, const std::string& path); -RcppExport SEXP _arrow_fs___FileSystem__OpenInputStream(SEXP file_system_sexp, SEXP path_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter::type path(path_sexp); - return Rcpp::wrap(fs___FileSystem__OpenInputStream(file_system, path)); -END_RCPP +extern "C" SEXP _arrow_fs___FileSystem__OpenInputStream(SEXP file_system_sexp, SEXP path_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input::type path(path_sexp); + return cpp11::as_sexp(fs___FileSystem__OpenInputStream(file_system, path)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__OpenInputStream(SEXP file_system_sexp, SEXP path_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__OpenInputStream(SEXP file_system_sexp, SEXP path_sexp){ Rf_error("Cannot call fs___FileSystem__OpenInputStream(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3457,15 +3457,15 @@ RcppExport SEXP _arrow_fs___FileSystem__OpenInputStream(SEXP file_system_sexp, S // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr fs___FileSystem__OpenInputFile(const std::shared_ptr& file_system, const std::string& path); -RcppExport SEXP _arrow_fs___FileSystem__OpenInputFile(SEXP file_system_sexp, SEXP path_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter::type path(path_sexp); - return Rcpp::wrap(fs___FileSystem__OpenInputFile(file_system, path)); -END_RCPP +extern "C" SEXP _arrow_fs___FileSystem__OpenInputFile(SEXP file_system_sexp, SEXP path_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input::type path(path_sexp); + return cpp11::as_sexp(fs___FileSystem__OpenInputFile(file_system, path)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__OpenInputFile(SEXP file_system_sexp, SEXP path_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__OpenInputFile(SEXP file_system_sexp, SEXP path_sexp){ Rf_error("Cannot call fs___FileSystem__OpenInputFile(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3473,15 +3473,15 @@ RcppExport SEXP _arrow_fs___FileSystem__OpenInputFile(SEXP file_system_sexp, SEX // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr fs___FileSystem__OpenOutputStream(const std::shared_ptr& file_system, const std::string& path); -RcppExport SEXP _arrow_fs___FileSystem__OpenOutputStream(SEXP file_system_sexp, SEXP path_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter::type path(path_sexp); - return Rcpp::wrap(fs___FileSystem__OpenOutputStream(file_system, path)); -END_RCPP +extern "C" SEXP _arrow_fs___FileSystem__OpenOutputStream(SEXP file_system_sexp, SEXP path_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input::type path(path_sexp); + return cpp11::as_sexp(fs___FileSystem__OpenOutputStream(file_system, path)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__OpenOutputStream(SEXP file_system_sexp, SEXP path_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__OpenOutputStream(SEXP file_system_sexp, SEXP path_sexp){ Rf_error("Cannot call fs___FileSystem__OpenOutputStream(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3489,15 +3489,15 @@ RcppExport SEXP _arrow_fs___FileSystem__OpenOutputStream(SEXP file_system_sexp, // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr fs___FileSystem__OpenAppendStream(const std::shared_ptr& file_system, const std::string& path); -RcppExport SEXP _arrow_fs___FileSystem__OpenAppendStream(SEXP file_system_sexp, SEXP path_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - Rcpp::traits::input_parameter::type path(path_sexp); - return Rcpp::wrap(fs___FileSystem__OpenAppendStream(file_system, path)); -END_RCPP +extern "C" SEXP _arrow_fs___FileSystem__OpenAppendStream(SEXP file_system_sexp, SEXP path_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + arrow::r::Input::type path(path_sexp); + return cpp11::as_sexp(fs___FileSystem__OpenAppendStream(file_system, path)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__OpenAppendStream(SEXP file_system_sexp, SEXP path_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__OpenAppendStream(SEXP file_system_sexp, SEXP path_sexp){ Rf_error("Cannot call fs___FileSystem__OpenAppendStream(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3505,14 +3505,14 @@ RcppExport SEXP _arrow_fs___FileSystem__OpenAppendStream(SEXP file_system_sexp, // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::string fs___FileSystem__type_name(const std::shared_ptr& file_system); -RcppExport SEXP _arrow_fs___FileSystem__type_name(SEXP file_system_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file_system(file_system_sexp); - return Rcpp::wrap(fs___FileSystem__type_name(file_system)); -END_RCPP +extern "C" SEXP _arrow_fs___FileSystem__type_name(SEXP file_system_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file_system(file_system_sexp); + return cpp11::as_sexp(fs___FileSystem__type_name(file_system)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystem__type_name(SEXP file_system_sexp){ +extern "C" SEXP _arrow_fs___FileSystem__type_name(SEXP file_system_sexp){ Rf_error("Cannot call fs___FileSystem__type_name(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3520,13 +3520,13 @@ RcppExport SEXP _arrow_fs___FileSystem__type_name(SEXP file_system_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr fs___LocalFileSystem__create(); -RcppExport SEXP _arrow_fs___LocalFileSystem__create(){ -BEGIN_RCPP - return Rcpp::wrap(fs___LocalFileSystem__create()); -END_RCPP +extern "C" SEXP _arrow_fs___LocalFileSystem__create(){ +BEGIN_CPP11 + return cpp11::as_sexp(fs___LocalFileSystem__create()); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___LocalFileSystem__create(){ +extern "C" SEXP _arrow_fs___LocalFileSystem__create(){ Rf_error("Cannot call fs___LocalFileSystem__create(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3534,30 +3534,30 @@ RcppExport SEXP _arrow_fs___LocalFileSystem__create(){ // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr fs___SubTreeFileSystem__create(const std::string& base_path, const std::shared_ptr& base_fs); -RcppExport SEXP _arrow_fs___SubTreeFileSystem__create(SEXP base_path_sexp, SEXP base_fs_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type base_path(base_path_sexp); - Rcpp::traits::input_parameter&>::type base_fs(base_fs_sexp); - return Rcpp::wrap(fs___SubTreeFileSystem__create(base_path, base_fs)); -END_RCPP +extern "C" SEXP _arrow_fs___SubTreeFileSystem__create(SEXP base_path_sexp, SEXP base_fs_sexp){ +BEGIN_CPP11 + arrow::r::Input::type base_path(base_path_sexp); + arrow::r::Input&>::type base_fs(base_fs_sexp); + return cpp11::as_sexp(fs___SubTreeFileSystem__create(base_path, base_fs)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___SubTreeFileSystem__create(SEXP base_path_sexp, SEXP base_fs_sexp){ +extern "C" SEXP _arrow_fs___SubTreeFileSystem__create(SEXP base_path_sexp, SEXP base_fs_sexp){ Rf_error("Cannot call fs___SubTreeFileSystem__create(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // filesystem.cpp #if defined(ARROW_R_WITH_ARROW) -Rcpp::List fs___FileSystemFromUri(const std::string& path); -RcppExport SEXP _arrow_fs___FileSystemFromUri(SEXP path_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type path(path_sexp); - return Rcpp::wrap(fs___FileSystemFromUri(path)); -END_RCPP +cpp11::writable::list fs___FileSystemFromUri(const std::string& path); +extern "C" SEXP _arrow_fs___FileSystemFromUri(SEXP path_sexp){ +BEGIN_CPP11 + arrow::r::Input::type path(path_sexp); + return cpp11::as_sexp(fs___FileSystemFromUri(path)); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___FileSystemFromUri(SEXP path_sexp){ +extern "C" SEXP _arrow_fs___FileSystemFromUri(SEXP path_sexp){ Rf_error("Cannot call fs___FileSystemFromUri(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3565,14 +3565,14 @@ RcppExport SEXP _arrow_fs___FileSystemFromUri(SEXP path_sexp){ // filesystem.cpp #if defined(ARROW_R_WITH_S3) void fs___EnsureS3Initialized(); -RcppExport SEXP _arrow_fs___EnsureS3Initialized(){ -BEGIN_RCPP +extern "C" SEXP _arrow_fs___EnsureS3Initialized(){ +BEGIN_CPP11 fs___EnsureS3Initialized(); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_fs___EnsureS3Initialized(){ +extern "C" SEXP _arrow_fs___EnsureS3Initialized(){ Rf_error("Cannot call fs___EnsureS3Initialized(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3580,13 +3580,13 @@ RcppExport SEXP _arrow_fs___EnsureS3Initialized(){ // filesystem.cpp #if defined(ARROW_R_WITH_S3) std::shared_ptr fs___S3FileSystem__create(); -RcppExport SEXP _arrow_fs___S3FileSystem__create(){ -BEGIN_RCPP - return Rcpp::wrap(fs___S3FileSystem__create()); -END_RCPP +extern "C" SEXP _arrow_fs___S3FileSystem__create(){ +BEGIN_CPP11 + return cpp11::as_sexp(fs___S3FileSystem__create()); +END_CPP11 } #else -RcppExport SEXP _arrow_fs___S3FileSystem__create(){ +extern "C" SEXP _arrow_fs___S3FileSystem__create(){ Rf_error("Cannot call fs___S3FileSystem__create(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3594,15 +3594,15 @@ RcppExport SEXP _arrow_fs___S3FileSystem__create(){ // io.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr io___Readable__Read(const std::shared_ptr& x, int64_t nbytes); -RcppExport SEXP _arrow_io___Readable__Read(SEXP x_sexp, SEXP nbytes_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type nbytes(nbytes_sexp); - return Rcpp::wrap(io___Readable__Read(x, nbytes)); -END_RCPP +extern "C" SEXP _arrow_io___Readable__Read(SEXP x_sexp, SEXP nbytes_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type nbytes(nbytes_sexp); + return cpp11::as_sexp(io___Readable__Read(x, nbytes)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___Readable__Read(SEXP x_sexp, SEXP nbytes_sexp){ +extern "C" SEXP _arrow_io___Readable__Read(SEXP x_sexp, SEXP nbytes_sexp){ Rf_error("Cannot call io___Readable__Read(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3610,15 +3610,15 @@ RcppExport SEXP _arrow_io___Readable__Read(SEXP x_sexp, SEXP nbytes_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) void io___InputStream__Close(const std::shared_ptr& x); -RcppExport SEXP _arrow_io___InputStream__Close(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); +extern "C" SEXP _arrow_io___InputStream__Close(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); io___InputStream__Close(x); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_io___InputStream__Close(SEXP x_sexp){ +extern "C" SEXP _arrow_io___InputStream__Close(SEXP x_sexp){ Rf_error("Cannot call io___InputStream__Close(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3626,15 +3626,15 @@ RcppExport SEXP _arrow_io___InputStream__Close(SEXP x_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) void io___OutputStream__Close(const std::shared_ptr& x); -RcppExport SEXP _arrow_io___OutputStream__Close(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); +extern "C" SEXP _arrow_io___OutputStream__Close(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); io___OutputStream__Close(x); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_io___OutputStream__Close(SEXP x_sexp){ +extern "C" SEXP _arrow_io___OutputStream__Close(SEXP x_sexp){ Rf_error("Cannot call io___OutputStream__Close(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3642,14 +3642,14 @@ RcppExport SEXP _arrow_io___OutputStream__Close(SEXP x_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) int64_t io___RandomAccessFile__GetSize(const std::shared_ptr& x); -RcppExport SEXP _arrow_io___RandomAccessFile__GetSize(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(io___RandomAccessFile__GetSize(x)); -END_RCPP +extern "C" SEXP _arrow_io___RandomAccessFile__GetSize(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(io___RandomAccessFile__GetSize(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___RandomAccessFile__GetSize(SEXP x_sexp){ +extern "C" SEXP _arrow_io___RandomAccessFile__GetSize(SEXP x_sexp){ Rf_error("Cannot call io___RandomAccessFile__GetSize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3657,14 +3657,14 @@ RcppExport SEXP _arrow_io___RandomAccessFile__GetSize(SEXP x_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) bool io___RandomAccessFile__supports_zero_copy(const std::shared_ptr& x); -RcppExport SEXP _arrow_io___RandomAccessFile__supports_zero_copy(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(io___RandomAccessFile__supports_zero_copy(x)); -END_RCPP +extern "C" SEXP _arrow_io___RandomAccessFile__supports_zero_copy(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(io___RandomAccessFile__supports_zero_copy(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___RandomAccessFile__supports_zero_copy(SEXP x_sexp){ +extern "C" SEXP _arrow_io___RandomAccessFile__supports_zero_copy(SEXP x_sexp){ Rf_error("Cannot call io___RandomAccessFile__supports_zero_copy(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3672,16 +3672,16 @@ RcppExport SEXP _arrow_io___RandomAccessFile__supports_zero_copy(SEXP x_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) void io___RandomAccessFile__Seek(const std::shared_ptr& x, int64_t position); -RcppExport SEXP _arrow_io___RandomAccessFile__Seek(SEXP x_sexp, SEXP position_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type position(position_sexp); +extern "C" SEXP _arrow_io___RandomAccessFile__Seek(SEXP x_sexp, SEXP position_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type position(position_sexp); io___RandomAccessFile__Seek(x, position); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_io___RandomAccessFile__Seek(SEXP x_sexp, SEXP position_sexp){ +extern "C" SEXP _arrow_io___RandomAccessFile__Seek(SEXP x_sexp, SEXP position_sexp){ Rf_error("Cannot call io___RandomAccessFile__Seek(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3689,14 +3689,14 @@ RcppExport SEXP _arrow_io___RandomAccessFile__Seek(SEXP x_sexp, SEXP position_se // io.cpp #if defined(ARROW_R_WITH_ARROW) int64_t io___RandomAccessFile__Tell(const std::shared_ptr& x); -RcppExport SEXP _arrow_io___RandomAccessFile__Tell(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(io___RandomAccessFile__Tell(x)); -END_RCPP +extern "C" SEXP _arrow_io___RandomAccessFile__Tell(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(io___RandomAccessFile__Tell(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___RandomAccessFile__Tell(SEXP x_sexp){ +extern "C" SEXP _arrow_io___RandomAccessFile__Tell(SEXP x_sexp){ Rf_error("Cannot call io___RandomAccessFile__Tell(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3704,14 +3704,14 @@ RcppExport SEXP _arrow_io___RandomAccessFile__Tell(SEXP x_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr io___RandomAccessFile__Read0(const std::shared_ptr& x); -RcppExport SEXP _arrow_io___RandomAccessFile__Read0(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(io___RandomAccessFile__Read0(x)); -END_RCPP +extern "C" SEXP _arrow_io___RandomAccessFile__Read0(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(io___RandomAccessFile__Read0(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___RandomAccessFile__Read0(SEXP x_sexp){ +extern "C" SEXP _arrow_io___RandomAccessFile__Read0(SEXP x_sexp){ Rf_error("Cannot call io___RandomAccessFile__Read0(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3719,16 +3719,16 @@ RcppExport SEXP _arrow_io___RandomAccessFile__Read0(SEXP x_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr io___RandomAccessFile__ReadAt(const std::shared_ptr& x, int64_t position, int64_t nbytes); -RcppExport SEXP _arrow_io___RandomAccessFile__ReadAt(SEXP x_sexp, SEXP position_sexp, SEXP nbytes_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type position(position_sexp); - Rcpp::traits::input_parameter::type nbytes(nbytes_sexp); - return Rcpp::wrap(io___RandomAccessFile__ReadAt(x, position, nbytes)); -END_RCPP +extern "C" SEXP _arrow_io___RandomAccessFile__ReadAt(SEXP x_sexp, SEXP position_sexp, SEXP nbytes_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type position(position_sexp); + arrow::r::Input::type nbytes(nbytes_sexp); + return cpp11::as_sexp(io___RandomAccessFile__ReadAt(x, position, nbytes)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___RandomAccessFile__ReadAt(SEXP x_sexp, SEXP position_sexp, SEXP nbytes_sexp){ +extern "C" SEXP _arrow_io___RandomAccessFile__ReadAt(SEXP x_sexp, SEXP position_sexp, SEXP nbytes_sexp){ Rf_error("Cannot call io___RandomAccessFile__ReadAt(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3736,15 +3736,15 @@ RcppExport SEXP _arrow_io___RandomAccessFile__ReadAt(SEXP x_sexp, SEXP position_ // io.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr io___MemoryMappedFile__Create(const std::string& path, int64_t size); -RcppExport SEXP _arrow_io___MemoryMappedFile__Create(SEXP path_sexp, SEXP size_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type path(path_sexp); - Rcpp::traits::input_parameter::type size(size_sexp); - return Rcpp::wrap(io___MemoryMappedFile__Create(path, size)); -END_RCPP +extern "C" SEXP _arrow_io___MemoryMappedFile__Create(SEXP path_sexp, SEXP size_sexp){ +BEGIN_CPP11 + arrow::r::Input::type path(path_sexp); + arrow::r::Input::type size(size_sexp); + return cpp11::as_sexp(io___MemoryMappedFile__Create(path, size)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___MemoryMappedFile__Create(SEXP path_sexp, SEXP size_sexp){ +extern "C" SEXP _arrow_io___MemoryMappedFile__Create(SEXP path_sexp, SEXP size_sexp){ Rf_error("Cannot call io___MemoryMappedFile__Create(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3752,15 +3752,15 @@ RcppExport SEXP _arrow_io___MemoryMappedFile__Create(SEXP path_sexp, SEXP size_s // io.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr io___MemoryMappedFile__Open(const std::string& path, arrow::io::FileMode::type mode); -RcppExport SEXP _arrow_io___MemoryMappedFile__Open(SEXP path_sexp, SEXP mode_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type path(path_sexp); - Rcpp::traits::input_parameter::type mode(mode_sexp); - return Rcpp::wrap(io___MemoryMappedFile__Open(path, mode)); -END_RCPP +extern "C" SEXP _arrow_io___MemoryMappedFile__Open(SEXP path_sexp, SEXP mode_sexp){ +BEGIN_CPP11 + arrow::r::Input::type path(path_sexp); + arrow::r::Input::type mode(mode_sexp); + return cpp11::as_sexp(io___MemoryMappedFile__Open(path, mode)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___MemoryMappedFile__Open(SEXP path_sexp, SEXP mode_sexp){ +extern "C" SEXP _arrow_io___MemoryMappedFile__Open(SEXP path_sexp, SEXP mode_sexp){ Rf_error("Cannot call io___MemoryMappedFile__Open(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3768,16 +3768,16 @@ RcppExport SEXP _arrow_io___MemoryMappedFile__Open(SEXP path_sexp, SEXP mode_sex // io.cpp #if defined(ARROW_R_WITH_ARROW) void io___MemoryMappedFile__Resize(const std::shared_ptr& x, int64_t size); -RcppExport SEXP _arrow_io___MemoryMappedFile__Resize(SEXP x_sexp, SEXP size_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type size(size_sexp); +extern "C" SEXP _arrow_io___MemoryMappedFile__Resize(SEXP x_sexp, SEXP size_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type size(size_sexp); io___MemoryMappedFile__Resize(x, size); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_io___MemoryMappedFile__Resize(SEXP x_sexp, SEXP size_sexp){ +extern "C" SEXP _arrow_io___MemoryMappedFile__Resize(SEXP x_sexp, SEXP size_sexp){ Rf_error("Cannot call io___MemoryMappedFile__Resize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3785,14 +3785,14 @@ RcppExport SEXP _arrow_io___MemoryMappedFile__Resize(SEXP x_sexp, SEXP size_sexp // io.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr io___ReadableFile__Open(const std::string& path); -RcppExport SEXP _arrow_io___ReadableFile__Open(SEXP path_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type path(path_sexp); - return Rcpp::wrap(io___ReadableFile__Open(path)); -END_RCPP +extern "C" SEXP _arrow_io___ReadableFile__Open(SEXP path_sexp){ +BEGIN_CPP11 + arrow::r::Input::type path(path_sexp); + return cpp11::as_sexp(io___ReadableFile__Open(path)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___ReadableFile__Open(SEXP path_sexp){ +extern "C" SEXP _arrow_io___ReadableFile__Open(SEXP path_sexp){ Rf_error("Cannot call io___ReadableFile__Open(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3800,14 +3800,14 @@ RcppExport SEXP _arrow_io___ReadableFile__Open(SEXP path_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr io___BufferReader__initialize(const std::shared_ptr& buffer); -RcppExport SEXP _arrow_io___BufferReader__initialize(SEXP buffer_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type buffer(buffer_sexp); - return Rcpp::wrap(io___BufferReader__initialize(buffer)); -END_RCPP +extern "C" SEXP _arrow_io___BufferReader__initialize(SEXP buffer_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type buffer(buffer_sexp); + return cpp11::as_sexp(io___BufferReader__initialize(buffer)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___BufferReader__initialize(SEXP buffer_sexp){ +extern "C" SEXP _arrow_io___BufferReader__initialize(SEXP buffer_sexp){ Rf_error("Cannot call io___BufferReader__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3815,16 +3815,16 @@ RcppExport SEXP _arrow_io___BufferReader__initialize(SEXP buffer_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) void io___Writable__write(const std::shared_ptr& stream, const std::shared_ptr& buf); -RcppExport SEXP _arrow_io___Writable__write(SEXP stream_sexp, SEXP buf_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - Rcpp::traits::input_parameter&>::type buf(buf_sexp); +extern "C" SEXP _arrow_io___Writable__write(SEXP stream_sexp, SEXP buf_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + arrow::r::Input&>::type buf(buf_sexp); io___Writable__write(stream, buf); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_io___Writable__write(SEXP stream_sexp, SEXP buf_sexp){ +extern "C" SEXP _arrow_io___Writable__write(SEXP stream_sexp, SEXP buf_sexp){ Rf_error("Cannot call io___Writable__write(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3832,14 +3832,14 @@ RcppExport SEXP _arrow_io___Writable__write(SEXP stream_sexp, SEXP buf_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) int64_t io___OutputStream__Tell(const std::shared_ptr& stream); -RcppExport SEXP _arrow_io___OutputStream__Tell(SEXP stream_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - return Rcpp::wrap(io___OutputStream__Tell(stream)); -END_RCPP +extern "C" SEXP _arrow_io___OutputStream__Tell(SEXP stream_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + return cpp11::as_sexp(io___OutputStream__Tell(stream)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___OutputStream__Tell(SEXP stream_sexp){ +extern "C" SEXP _arrow_io___OutputStream__Tell(SEXP stream_sexp){ Rf_error("Cannot call io___OutputStream__Tell(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3847,14 +3847,14 @@ RcppExport SEXP _arrow_io___OutputStream__Tell(SEXP stream_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr io___FileOutputStream__Open(const std::string& path); -RcppExport SEXP _arrow_io___FileOutputStream__Open(SEXP path_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type path(path_sexp); - return Rcpp::wrap(io___FileOutputStream__Open(path)); -END_RCPP +extern "C" SEXP _arrow_io___FileOutputStream__Open(SEXP path_sexp){ +BEGIN_CPP11 + arrow::r::Input::type path(path_sexp); + return cpp11::as_sexp(io___FileOutputStream__Open(path)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___FileOutputStream__Open(SEXP path_sexp){ +extern "C" SEXP _arrow_io___FileOutputStream__Open(SEXP path_sexp){ Rf_error("Cannot call io___FileOutputStream__Open(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3862,14 +3862,14 @@ RcppExport SEXP _arrow_io___FileOutputStream__Open(SEXP path_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr io___BufferOutputStream__Create(int64_t initial_capacity); -RcppExport SEXP _arrow_io___BufferOutputStream__Create(SEXP initial_capacity_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type initial_capacity(initial_capacity_sexp); - return Rcpp::wrap(io___BufferOutputStream__Create(initial_capacity)); -END_RCPP +extern "C" SEXP _arrow_io___BufferOutputStream__Create(SEXP initial_capacity_sexp){ +BEGIN_CPP11 + arrow::r::Input::type initial_capacity(initial_capacity_sexp); + return cpp11::as_sexp(io___BufferOutputStream__Create(initial_capacity)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___BufferOutputStream__Create(SEXP initial_capacity_sexp){ +extern "C" SEXP _arrow_io___BufferOutputStream__Create(SEXP initial_capacity_sexp){ Rf_error("Cannot call io___BufferOutputStream__Create(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3877,14 +3877,14 @@ RcppExport SEXP _arrow_io___BufferOutputStream__Create(SEXP initial_capacity_sex // io.cpp #if defined(ARROW_R_WITH_ARROW) int64_t io___BufferOutputStream__capacity(const std::shared_ptr& stream); -RcppExport SEXP _arrow_io___BufferOutputStream__capacity(SEXP stream_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - return Rcpp::wrap(io___BufferOutputStream__capacity(stream)); -END_RCPP +extern "C" SEXP _arrow_io___BufferOutputStream__capacity(SEXP stream_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + return cpp11::as_sexp(io___BufferOutputStream__capacity(stream)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___BufferOutputStream__capacity(SEXP stream_sexp){ +extern "C" SEXP _arrow_io___BufferOutputStream__capacity(SEXP stream_sexp){ Rf_error("Cannot call io___BufferOutputStream__capacity(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3892,14 +3892,14 @@ RcppExport SEXP _arrow_io___BufferOutputStream__capacity(SEXP stream_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr io___BufferOutputStream__Finish(const std::shared_ptr& stream); -RcppExport SEXP _arrow_io___BufferOutputStream__Finish(SEXP stream_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - return Rcpp::wrap(io___BufferOutputStream__Finish(stream)); -END_RCPP +extern "C" SEXP _arrow_io___BufferOutputStream__Finish(SEXP stream_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + return cpp11::as_sexp(io___BufferOutputStream__Finish(stream)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___BufferOutputStream__Finish(SEXP stream_sexp){ +extern "C" SEXP _arrow_io___BufferOutputStream__Finish(SEXP stream_sexp){ Rf_error("Cannot call io___BufferOutputStream__Finish(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3907,61 +3907,62 @@ RcppExport SEXP _arrow_io___BufferOutputStream__Finish(SEXP stream_sexp){ // io.cpp #if defined(ARROW_R_WITH_ARROW) int64_t io___BufferOutputStream__Tell(const std::shared_ptr& stream); -RcppExport SEXP _arrow_io___BufferOutputStream__Tell(SEXP stream_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - return Rcpp::wrap(io___BufferOutputStream__Tell(stream)); -END_RCPP +extern "C" SEXP _arrow_io___BufferOutputStream__Tell(SEXP stream_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + return cpp11::as_sexp(io___BufferOutputStream__Tell(stream)); +END_CPP11 } #else -RcppExport SEXP _arrow_io___BufferOutputStream__Tell(SEXP stream_sexp){ +extern "C" SEXP _arrow_io___BufferOutputStream__Tell(SEXP stream_sexp){ Rf_error("Cannot call io___BufferOutputStream__Tell(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // io.cpp #if defined(ARROW_R_WITH_ARROW) -void io___BufferOutputStream__Write(const std::shared_ptr& stream, RawVector_ bytes); -RcppExport SEXP _arrow_io___BufferOutputStream__Write(SEXP stream_sexp, SEXP bytes_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - Rcpp::traits::input_parameter::type bytes(bytes_sexp); +void io___BufferOutputStream__Write(const std::shared_ptr& stream, cpp11::raws bytes); +extern "C" SEXP _arrow_io___BufferOutputStream__Write(SEXP stream_sexp, SEXP bytes_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + arrow::r::Input::type bytes(bytes_sexp); io___BufferOutputStream__Write(stream, bytes); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_io___BufferOutputStream__Write(SEXP stream_sexp, SEXP bytes_sexp){ +extern "C" SEXP _arrow_io___BufferOutputStream__Write(SEXP stream_sexp, SEXP bytes_sexp){ Rf_error("Cannot call io___BufferOutputStream__Write(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // json.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr json___ReadOptions__initialize(List_ options); -RcppExport SEXP _arrow_json___ReadOptions__initialize(SEXP options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type options(options_sexp); - return Rcpp::wrap(json___ReadOptions__initialize(options)); -END_RCPP +std::shared_ptr json___ReadOptions__initialize(bool use_threads, int block_size); +extern "C" SEXP _arrow_json___ReadOptions__initialize(SEXP use_threads_sexp, SEXP block_size_sexp){ +BEGIN_CPP11 + arrow::r::Input::type use_threads(use_threads_sexp); + arrow::r::Input::type block_size(block_size_sexp); + return cpp11::as_sexp(json___ReadOptions__initialize(use_threads, block_size)); +END_CPP11 } #else -RcppExport SEXP _arrow_json___ReadOptions__initialize(SEXP options_sexp){ +extern "C" SEXP _arrow_json___ReadOptions__initialize(SEXP use_threads_sexp, SEXP block_size_sexp){ Rf_error("Cannot call json___ReadOptions__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // json.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr json___ParseOptions__initialize(List_ options); -RcppExport SEXP _arrow_json___ParseOptions__initialize(SEXP options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type options(options_sexp); - return Rcpp::wrap(json___ParseOptions__initialize(options)); -END_RCPP +std::shared_ptr json___ParseOptions__initialize(bool newlines_in_values); +extern "C" SEXP _arrow_json___ParseOptions__initialize(SEXP newlines_in_values_sexp){ +BEGIN_CPP11 + arrow::r::Input::type newlines_in_values(newlines_in_values_sexp); + return cpp11::as_sexp(json___ParseOptions__initialize(newlines_in_values)); +END_CPP11 } #else -RcppExport SEXP _arrow_json___ParseOptions__initialize(SEXP options_sexp){ +extern "C" SEXP _arrow_json___ParseOptions__initialize(SEXP newlines_in_values_sexp){ Rf_error("Cannot call json___ParseOptions__initialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3969,16 +3970,16 @@ RcppExport SEXP _arrow_json___ParseOptions__initialize(SEXP options_sexp){ // json.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr json___TableReader__Make(const std::shared_ptr& input, const std::shared_ptr& read_options, const std::shared_ptr& parse_options); -RcppExport SEXP _arrow_json___TableReader__Make(SEXP input_sexp, SEXP read_options_sexp, SEXP parse_options_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type input(input_sexp); - Rcpp::traits::input_parameter&>::type read_options(read_options_sexp); - Rcpp::traits::input_parameter&>::type parse_options(parse_options_sexp); - return Rcpp::wrap(json___TableReader__Make(input, read_options, parse_options)); -END_RCPP +extern "C" SEXP _arrow_json___TableReader__Make(SEXP input_sexp, SEXP read_options_sexp, SEXP parse_options_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type input(input_sexp); + arrow::r::Input&>::type read_options(read_options_sexp); + arrow::r::Input&>::type parse_options(parse_options_sexp); + return cpp11::as_sexp(json___TableReader__Make(input, read_options, parse_options)); +END_CPP11 } #else -RcppExport SEXP _arrow_json___TableReader__Make(SEXP input_sexp, SEXP read_options_sexp, SEXP parse_options_sexp){ +extern "C" SEXP _arrow_json___TableReader__Make(SEXP input_sexp, SEXP read_options_sexp, SEXP parse_options_sexp){ Rf_error("Cannot call json___TableReader__Make(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -3986,14 +3987,14 @@ RcppExport SEXP _arrow_json___TableReader__Make(SEXP input_sexp, SEXP read_optio // json.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr json___TableReader__Read(const std::shared_ptr& table_reader); -RcppExport SEXP _arrow_json___TableReader__Read(SEXP table_reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table_reader(table_reader_sexp); - return Rcpp::wrap(json___TableReader__Read(table_reader)); -END_RCPP +extern "C" SEXP _arrow_json___TableReader__Read(SEXP table_reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table_reader(table_reader_sexp); + return cpp11::as_sexp(json___TableReader__Read(table_reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_json___TableReader__Read(SEXP table_reader_sexp){ +extern "C" SEXP _arrow_json___TableReader__Read(SEXP table_reader_sexp){ Rf_error("Cannot call json___TableReader__Read(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4001,13 +4002,13 @@ RcppExport SEXP _arrow_json___TableReader__Read(SEXP table_reader_sexp){ // memorypool.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr MemoryPool__default(); -RcppExport SEXP _arrow_MemoryPool__default(){ -BEGIN_RCPP - return Rcpp::wrap(MemoryPool__default()); -END_RCPP +extern "C" SEXP _arrow_MemoryPool__default(){ +BEGIN_CPP11 + return cpp11::as_sexp(MemoryPool__default()); +END_CPP11 } #else -RcppExport SEXP _arrow_MemoryPool__default(){ +extern "C" SEXP _arrow_MemoryPool__default(){ Rf_error("Cannot call MemoryPool__default(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4015,14 +4016,14 @@ RcppExport SEXP _arrow_MemoryPool__default(){ // memorypool.cpp #if defined(ARROW_R_WITH_ARROW) int MemoryPool__bytes_allocated(const std::shared_ptr& pool); -RcppExport SEXP _arrow_MemoryPool__bytes_allocated(SEXP pool_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type pool(pool_sexp); - return Rcpp::wrap(MemoryPool__bytes_allocated(pool)); -END_RCPP +extern "C" SEXP _arrow_MemoryPool__bytes_allocated(SEXP pool_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type pool(pool_sexp); + return cpp11::as_sexp(MemoryPool__bytes_allocated(pool)); +END_CPP11 } #else -RcppExport SEXP _arrow_MemoryPool__bytes_allocated(SEXP pool_sexp){ +extern "C" SEXP _arrow_MemoryPool__bytes_allocated(SEXP pool_sexp){ Rf_error("Cannot call MemoryPool__bytes_allocated(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4030,14 +4031,14 @@ RcppExport SEXP _arrow_MemoryPool__bytes_allocated(SEXP pool_sexp){ // memorypool.cpp #if defined(ARROW_R_WITH_ARROW) int MemoryPool__max_memory(const std::shared_ptr& pool); -RcppExport SEXP _arrow_MemoryPool__max_memory(SEXP pool_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type pool(pool_sexp); - return Rcpp::wrap(MemoryPool__max_memory(pool)); -END_RCPP +extern "C" SEXP _arrow_MemoryPool__max_memory(SEXP pool_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type pool(pool_sexp); + return cpp11::as_sexp(MemoryPool__max_memory(pool)); +END_CPP11 } #else -RcppExport SEXP _arrow_MemoryPool__max_memory(SEXP pool_sexp){ +extern "C" SEXP _arrow_MemoryPool__max_memory(SEXP pool_sexp){ Rf_error("Cannot call MemoryPool__max_memory(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4045,14 +4046,14 @@ RcppExport SEXP _arrow_MemoryPool__max_memory(SEXP pool_sexp){ // message.cpp #if defined(ARROW_R_WITH_ARROW) int64_t ipc___Message__body_length(const std::unique_ptr& message); -RcppExport SEXP _arrow_ipc___Message__body_length(SEXP message_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type message(message_sexp); - return Rcpp::wrap(ipc___Message__body_length(message)); -END_RCPP +extern "C" SEXP _arrow_ipc___Message__body_length(SEXP message_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type message(message_sexp); + return cpp11::as_sexp(ipc___Message__body_length(message)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___Message__body_length(SEXP message_sexp){ +extern "C" SEXP _arrow_ipc___Message__body_length(SEXP message_sexp){ Rf_error("Cannot call ipc___Message__body_length(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4060,14 +4061,14 @@ RcppExport SEXP _arrow_ipc___Message__body_length(SEXP message_sexp){ // message.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___Message__metadata(const std::unique_ptr& message); -RcppExport SEXP _arrow_ipc___Message__metadata(SEXP message_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type message(message_sexp); - return Rcpp::wrap(ipc___Message__metadata(message)); -END_RCPP +extern "C" SEXP _arrow_ipc___Message__metadata(SEXP message_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type message(message_sexp); + return cpp11::as_sexp(ipc___Message__metadata(message)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___Message__metadata(SEXP message_sexp){ +extern "C" SEXP _arrow_ipc___Message__metadata(SEXP message_sexp){ Rf_error("Cannot call ipc___Message__metadata(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4075,14 +4076,14 @@ RcppExport SEXP _arrow_ipc___Message__metadata(SEXP message_sexp){ // message.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___Message__body(const std::unique_ptr& message); -RcppExport SEXP _arrow_ipc___Message__body(SEXP message_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type message(message_sexp); - return Rcpp::wrap(ipc___Message__body(message)); -END_RCPP +extern "C" SEXP _arrow_ipc___Message__body(SEXP message_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type message(message_sexp); + return cpp11::as_sexp(ipc___Message__body(message)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___Message__body(SEXP message_sexp){ +extern "C" SEXP _arrow_ipc___Message__body(SEXP message_sexp){ Rf_error("Cannot call ipc___Message__body(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4090,14 +4091,14 @@ RcppExport SEXP _arrow_ipc___Message__body(SEXP message_sexp){ // message.cpp #if defined(ARROW_R_WITH_ARROW) int64_t ipc___Message__Verify(const std::unique_ptr& message); -RcppExport SEXP _arrow_ipc___Message__Verify(SEXP message_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type message(message_sexp); - return Rcpp::wrap(ipc___Message__Verify(message)); -END_RCPP +extern "C" SEXP _arrow_ipc___Message__Verify(SEXP message_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type message(message_sexp); + return cpp11::as_sexp(ipc___Message__Verify(message)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___Message__Verify(SEXP message_sexp){ +extern "C" SEXP _arrow_ipc___Message__Verify(SEXP message_sexp){ Rf_error("Cannot call ipc___Message__Verify(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4105,14 +4106,14 @@ RcppExport SEXP _arrow_ipc___Message__Verify(SEXP message_sexp){ // message.cpp #if defined(ARROW_R_WITH_ARROW) arrow::ipc::MessageType ipc___Message__type(const std::unique_ptr& message); -RcppExport SEXP _arrow_ipc___Message__type(SEXP message_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type message(message_sexp); - return Rcpp::wrap(ipc___Message__type(message)); -END_RCPP +extern "C" SEXP _arrow_ipc___Message__type(SEXP message_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type message(message_sexp); + return cpp11::as_sexp(ipc___Message__type(message)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___Message__type(SEXP message_sexp){ +extern "C" SEXP _arrow_ipc___Message__type(SEXP message_sexp){ Rf_error("Cannot call ipc___Message__type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4120,15 +4121,15 @@ RcppExport SEXP _arrow_ipc___Message__type(SEXP message_sexp){ // message.cpp #if defined(ARROW_R_WITH_ARROW) bool ipc___Message__Equals(const std::unique_ptr& x, const std::unique_ptr& y); -RcppExport SEXP _arrow_ipc___Message__Equals(SEXP x_sexp, SEXP y_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter&>::type y(y_sexp); - return Rcpp::wrap(ipc___Message__Equals(x, y)); -END_RCPP +extern "C" SEXP _arrow_ipc___Message__Equals(SEXP x_sexp, SEXP y_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input&>::type y(y_sexp); + return cpp11::as_sexp(ipc___Message__Equals(x, y)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___Message__Equals(SEXP x_sexp, SEXP y_sexp){ +extern "C" SEXP _arrow_ipc___Message__Equals(SEXP x_sexp, SEXP y_sexp){ Rf_error("Cannot call ipc___Message__Equals(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4136,15 +4137,15 @@ RcppExport SEXP _arrow_ipc___Message__Equals(SEXP x_sexp, SEXP y_sexp){ // message.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___ReadRecordBatch__Message__Schema(const std::unique_ptr& message, const std::shared_ptr& schema); -RcppExport SEXP _arrow_ipc___ReadRecordBatch__Message__Schema(SEXP message_sexp, SEXP schema_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type message(message_sexp); - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - return Rcpp::wrap(ipc___ReadRecordBatch__Message__Schema(message, schema)); -END_RCPP +extern "C" SEXP _arrow_ipc___ReadRecordBatch__Message__Schema(SEXP message_sexp, SEXP schema_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type message(message_sexp); + arrow::r::Input&>::type schema(schema_sexp); + return cpp11::as_sexp(ipc___ReadRecordBatch__Message__Schema(message, schema)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___ReadRecordBatch__Message__Schema(SEXP message_sexp, SEXP schema_sexp){ +extern "C" SEXP _arrow_ipc___ReadRecordBatch__Message__Schema(SEXP message_sexp, SEXP schema_sexp){ Rf_error("Cannot call ipc___ReadRecordBatch__Message__Schema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4152,14 +4153,14 @@ RcppExport SEXP _arrow_ipc___ReadRecordBatch__Message__Schema(SEXP message_sexp, // message.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___ReadSchema_InputStream(const std::shared_ptr& stream); -RcppExport SEXP _arrow_ipc___ReadSchema_InputStream(SEXP stream_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - return Rcpp::wrap(ipc___ReadSchema_InputStream(stream)); -END_RCPP +extern "C" SEXP _arrow_ipc___ReadSchema_InputStream(SEXP stream_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + return cpp11::as_sexp(ipc___ReadSchema_InputStream(stream)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___ReadSchema_InputStream(SEXP stream_sexp){ +extern "C" SEXP _arrow_ipc___ReadSchema_InputStream(SEXP stream_sexp){ Rf_error("Cannot call ipc___ReadSchema_InputStream(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4167,14 +4168,14 @@ RcppExport SEXP _arrow_ipc___ReadSchema_InputStream(SEXP stream_sexp){ // message.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___ReadSchema_Message(const std::unique_ptr& message); -RcppExport SEXP _arrow_ipc___ReadSchema_Message(SEXP message_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type message(message_sexp); - return Rcpp::wrap(ipc___ReadSchema_Message(message)); -END_RCPP +extern "C" SEXP _arrow_ipc___ReadSchema_Message(SEXP message_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type message(message_sexp); + return cpp11::as_sexp(ipc___ReadSchema_Message(message)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___ReadSchema_Message(SEXP message_sexp){ +extern "C" SEXP _arrow_ipc___ReadSchema_Message(SEXP message_sexp){ Rf_error("Cannot call ipc___ReadSchema_Message(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4182,14 +4183,14 @@ RcppExport SEXP _arrow_ipc___ReadSchema_Message(SEXP message_sexp){ // message.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___MessageReader__Open(const std::shared_ptr& stream); -RcppExport SEXP _arrow_ipc___MessageReader__Open(SEXP stream_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - return Rcpp::wrap(ipc___MessageReader__Open(stream)); -END_RCPP +extern "C" SEXP _arrow_ipc___MessageReader__Open(SEXP stream_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + return cpp11::as_sexp(ipc___MessageReader__Open(stream)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___MessageReader__Open(SEXP stream_sexp){ +extern "C" SEXP _arrow_ipc___MessageReader__Open(SEXP stream_sexp){ Rf_error("Cannot call ipc___MessageReader__Open(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4197,14 +4198,14 @@ RcppExport SEXP _arrow_ipc___MessageReader__Open(SEXP stream_sexp){ // message.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___MessageReader__ReadNextMessage(const std::unique_ptr& reader); -RcppExport SEXP _arrow_ipc___MessageReader__ReadNextMessage(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(ipc___MessageReader__ReadNextMessage(reader)); -END_RCPP +extern "C" SEXP _arrow_ipc___MessageReader__ReadNextMessage(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(ipc___MessageReader__ReadNextMessage(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___MessageReader__ReadNextMessage(SEXP reader_sexp){ +extern "C" SEXP _arrow_ipc___MessageReader__ReadNextMessage(SEXP reader_sexp){ Rf_error("Cannot call ipc___MessageReader__ReadNextMessage(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4212,14 +4213,14 @@ RcppExport SEXP _arrow_ipc___MessageReader__ReadNextMessage(SEXP reader_sexp){ // message.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___ReadMessage(const std::shared_ptr& stream); -RcppExport SEXP _arrow_ipc___ReadMessage(SEXP stream_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - return Rcpp::wrap(ipc___ReadMessage(stream)); -END_RCPP +extern "C" SEXP _arrow_ipc___ReadMessage(SEXP stream_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + return cpp11::as_sexp(ipc___ReadMessage(stream)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___ReadMessage(SEXP stream_sexp){ +extern "C" SEXP _arrow_ipc___ReadMessage(SEXP stream_sexp){ Rf_error("Cannot call ipc___ReadMessage(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4227,14 +4228,14 @@ RcppExport SEXP _arrow_ipc___ReadMessage(SEXP stream_sexp){ // parquet.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr parquet___arrow___ArrowReaderProperties__Make(bool use_threads); -RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__Make(SEXP use_threads_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type use_threads(use_threads_sexp); - return Rcpp::wrap(parquet___arrow___ArrowReaderProperties__Make(use_threads)); -END_RCPP +extern "C" SEXP _arrow_parquet___arrow___ArrowReaderProperties__Make(SEXP use_threads_sexp){ +BEGIN_CPP11 + arrow::r::Input::type use_threads(use_threads_sexp); + return cpp11::as_sexp(parquet___arrow___ArrowReaderProperties__Make(use_threads)); +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__Make(SEXP use_threads_sexp){ +extern "C" SEXP _arrow_parquet___arrow___ArrowReaderProperties__Make(SEXP use_threads_sexp){ Rf_error("Cannot call parquet___arrow___ArrowReaderProperties__Make(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4242,16 +4243,16 @@ RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__Make(SEXP use_th // parquet.cpp #if defined(ARROW_R_WITH_ARROW) void parquet___arrow___ArrowReaderProperties__set_use_threads(const std::shared_ptr& properties, bool use_threads); -RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__set_use_threads(SEXP properties_sexp, SEXP use_threads_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type properties(properties_sexp); - Rcpp::traits::input_parameter::type use_threads(use_threads_sexp); +extern "C" SEXP _arrow_parquet___arrow___ArrowReaderProperties__set_use_threads(SEXP properties_sexp, SEXP use_threads_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type properties(properties_sexp); + arrow::r::Input::type use_threads(use_threads_sexp); parquet___arrow___ArrowReaderProperties__set_use_threads(properties, use_threads); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__set_use_threads(SEXP properties_sexp, SEXP use_threads_sexp){ +extern "C" SEXP _arrow_parquet___arrow___ArrowReaderProperties__set_use_threads(SEXP properties_sexp, SEXP use_threads_sexp){ Rf_error("Cannot call parquet___arrow___ArrowReaderProperties__set_use_threads(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4259,15 +4260,15 @@ RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__set_use_threads( // parquet.cpp #if defined(ARROW_R_WITH_ARROW) bool parquet___arrow___ArrowReaderProperties__get_use_threads(const std::shared_ptr& properties, bool use_threads); -RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__get_use_threads(SEXP properties_sexp, SEXP use_threads_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type properties(properties_sexp); - Rcpp::traits::input_parameter::type use_threads(use_threads_sexp); - return Rcpp::wrap(parquet___arrow___ArrowReaderProperties__get_use_threads(properties, use_threads)); -END_RCPP +extern "C" SEXP _arrow_parquet___arrow___ArrowReaderProperties__get_use_threads(SEXP properties_sexp, SEXP use_threads_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type properties(properties_sexp); + arrow::r::Input::type use_threads(use_threads_sexp); + return cpp11::as_sexp(parquet___arrow___ArrowReaderProperties__get_use_threads(properties, use_threads)); +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__get_use_threads(SEXP properties_sexp, SEXP use_threads_sexp){ +extern "C" SEXP _arrow_parquet___arrow___ArrowReaderProperties__get_use_threads(SEXP properties_sexp, SEXP use_threads_sexp){ Rf_error("Cannot call parquet___arrow___ArrowReaderProperties__get_use_threads(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4275,15 +4276,15 @@ RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__get_use_threads( // parquet.cpp #if defined(ARROW_R_WITH_ARROW) bool parquet___arrow___ArrowReaderProperties__get_read_dictionary(const std::shared_ptr& properties, int column_index); -RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__get_read_dictionary(SEXP properties_sexp, SEXP column_index_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type properties(properties_sexp); - Rcpp::traits::input_parameter::type column_index(column_index_sexp); - return Rcpp::wrap(parquet___arrow___ArrowReaderProperties__get_read_dictionary(properties, column_index)); -END_RCPP +extern "C" SEXP _arrow_parquet___arrow___ArrowReaderProperties__get_read_dictionary(SEXP properties_sexp, SEXP column_index_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type properties(properties_sexp); + arrow::r::Input::type column_index(column_index_sexp); + return cpp11::as_sexp(parquet___arrow___ArrowReaderProperties__get_read_dictionary(properties, column_index)); +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__get_read_dictionary(SEXP properties_sexp, SEXP column_index_sexp){ +extern "C" SEXP _arrow_parquet___arrow___ArrowReaderProperties__get_read_dictionary(SEXP properties_sexp, SEXP column_index_sexp){ Rf_error("Cannot call parquet___arrow___ArrowReaderProperties__get_read_dictionary(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4291,17 +4292,17 @@ RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__get_read_diction // parquet.cpp #if defined(ARROW_R_WITH_ARROW) void parquet___arrow___ArrowReaderProperties__set_read_dictionary(const std::shared_ptr& properties, int column_index, bool read_dict); -RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__set_read_dictionary(SEXP properties_sexp, SEXP column_index_sexp, SEXP read_dict_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type properties(properties_sexp); - Rcpp::traits::input_parameter::type column_index(column_index_sexp); - Rcpp::traits::input_parameter::type read_dict(read_dict_sexp); +extern "C" SEXP _arrow_parquet___arrow___ArrowReaderProperties__set_read_dictionary(SEXP properties_sexp, SEXP column_index_sexp, SEXP read_dict_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type properties(properties_sexp); + arrow::r::Input::type column_index(column_index_sexp); + arrow::r::Input::type read_dict(read_dict_sexp); parquet___arrow___ArrowReaderProperties__set_read_dictionary(properties, column_index, read_dict); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__set_read_dictionary(SEXP properties_sexp, SEXP column_index_sexp, SEXP read_dict_sexp){ +extern "C" SEXP _arrow_parquet___arrow___ArrowReaderProperties__set_read_dictionary(SEXP properties_sexp, SEXP column_index_sexp, SEXP read_dict_sexp){ Rf_error("Cannot call parquet___arrow___ArrowReaderProperties__set_read_dictionary(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4309,15 +4310,15 @@ RcppExport SEXP _arrow_parquet___arrow___ArrowReaderProperties__set_read_diction // parquet.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr parquet___arrow___FileReader__OpenFile(const std::shared_ptr& file, const std::shared_ptr& props); -RcppExport SEXP _arrow_parquet___arrow___FileReader__OpenFile(SEXP file_sexp, SEXP props_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file(file_sexp); - Rcpp::traits::input_parameter&>::type props(props_sexp); - return Rcpp::wrap(parquet___arrow___FileReader__OpenFile(file, props)); -END_RCPP +extern "C" SEXP _arrow_parquet___arrow___FileReader__OpenFile(SEXP file_sexp, SEXP props_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file(file_sexp); + arrow::r::Input&>::type props(props_sexp); + return cpp11::as_sexp(parquet___arrow___FileReader__OpenFile(file, props)); +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___FileReader__OpenFile(SEXP file_sexp, SEXP props_sexp){ +extern "C" SEXP _arrow_parquet___arrow___FileReader__OpenFile(SEXP file_sexp, SEXP props_sexp){ Rf_error("Cannot call parquet___arrow___FileReader__OpenFile(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4325,14 +4326,14 @@ RcppExport SEXP _arrow_parquet___arrow___FileReader__OpenFile(SEXP file_sexp, SE // parquet.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr parquet___arrow___FileReader__ReadTable1(const std::shared_ptr& reader); -RcppExport SEXP _arrow_parquet___arrow___FileReader__ReadTable1(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(parquet___arrow___FileReader__ReadTable1(reader)); -END_RCPP +extern "C" SEXP _arrow_parquet___arrow___FileReader__ReadTable1(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(parquet___arrow___FileReader__ReadTable1(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___FileReader__ReadTable1(SEXP reader_sexp){ +extern "C" SEXP _arrow_parquet___arrow___FileReader__ReadTable1(SEXP reader_sexp){ Rf_error("Cannot call parquet___arrow___FileReader__ReadTable1(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4340,15 +4341,15 @@ RcppExport SEXP _arrow_parquet___arrow___FileReader__ReadTable1(SEXP reader_sexp // parquet.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr parquet___arrow___FileReader__ReadTable2(const std::shared_ptr& reader, const std::vector& column_indices); -RcppExport SEXP _arrow_parquet___arrow___FileReader__ReadTable2(SEXP reader_sexp, SEXP column_indices_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - Rcpp::traits::input_parameter&>::type column_indices(column_indices_sexp); - return Rcpp::wrap(parquet___arrow___FileReader__ReadTable2(reader, column_indices)); -END_RCPP +extern "C" SEXP _arrow_parquet___arrow___FileReader__ReadTable2(SEXP reader_sexp, SEXP column_indices_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + arrow::r::Input&>::type column_indices(column_indices_sexp); + return cpp11::as_sexp(parquet___arrow___FileReader__ReadTable2(reader, column_indices)); +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___FileReader__ReadTable2(SEXP reader_sexp, SEXP column_indices_sexp){ +extern "C" SEXP _arrow_parquet___arrow___FileReader__ReadTable2(SEXP reader_sexp, SEXP column_indices_sexp){ Rf_error("Cannot call parquet___arrow___FileReader__ReadTable2(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4356,14 +4357,14 @@ RcppExport SEXP _arrow_parquet___arrow___FileReader__ReadTable2(SEXP reader_sexp // parquet.cpp #if defined(ARROW_R_WITH_ARROW) int64_t parquet___arrow___FileReader__num_rows(const std::shared_ptr& reader); -RcppExport SEXP _arrow_parquet___arrow___FileReader__num_rows(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(parquet___arrow___FileReader__num_rows(reader)); -END_RCPP +extern "C" SEXP _arrow_parquet___arrow___FileReader__num_rows(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(parquet___arrow___FileReader__num_rows(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___FileReader__num_rows(SEXP reader_sexp){ +extern "C" SEXP _arrow_parquet___arrow___FileReader__num_rows(SEXP reader_sexp){ Rf_error("Cannot call parquet___arrow___FileReader__num_rows(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4371,16 +4372,16 @@ RcppExport SEXP _arrow_parquet___arrow___FileReader__num_rows(SEXP reader_sexp){ // parquet.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr parquet___ArrowWriterProperties___create(bool allow_truncated_timestamps, bool use_deprecated_int96_timestamps, int timestamp_unit); -RcppExport SEXP _arrow_parquet___ArrowWriterProperties___create(SEXP allow_truncated_timestamps_sexp, SEXP use_deprecated_int96_timestamps_sexp, SEXP timestamp_unit_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type allow_truncated_timestamps(allow_truncated_timestamps_sexp); - Rcpp::traits::input_parameter::type use_deprecated_int96_timestamps(use_deprecated_int96_timestamps_sexp); - Rcpp::traits::input_parameter::type timestamp_unit(timestamp_unit_sexp); - return Rcpp::wrap(parquet___ArrowWriterProperties___create(allow_truncated_timestamps, use_deprecated_int96_timestamps, timestamp_unit)); -END_RCPP +extern "C" SEXP _arrow_parquet___ArrowWriterProperties___create(SEXP allow_truncated_timestamps_sexp, SEXP use_deprecated_int96_timestamps_sexp, SEXP timestamp_unit_sexp){ +BEGIN_CPP11 + arrow::r::Input::type allow_truncated_timestamps(allow_truncated_timestamps_sexp); + arrow::r::Input::type use_deprecated_int96_timestamps(use_deprecated_int96_timestamps_sexp); + arrow::r::Input::type timestamp_unit(timestamp_unit_sexp); + return cpp11::as_sexp(parquet___ArrowWriterProperties___create(allow_truncated_timestamps, use_deprecated_int96_timestamps, timestamp_unit)); +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___ArrowWriterProperties___create(SEXP allow_truncated_timestamps_sexp, SEXP use_deprecated_int96_timestamps_sexp, SEXP timestamp_unit_sexp){ +extern "C" SEXP _arrow_parquet___ArrowWriterProperties___create(SEXP allow_truncated_timestamps_sexp, SEXP use_deprecated_int96_timestamps_sexp, SEXP timestamp_unit_sexp){ Rf_error("Cannot call parquet___ArrowWriterProperties___create(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4388,13 +4389,13 @@ RcppExport SEXP _arrow_parquet___ArrowWriterProperties___create(SEXP allow_trunc // parquet.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr parquet___WriterProperties___Builder__create(); -RcppExport SEXP _arrow_parquet___WriterProperties___Builder__create(){ -BEGIN_RCPP - return Rcpp::wrap(parquet___WriterProperties___Builder__create()); -END_RCPP +extern "C" SEXP _arrow_parquet___WriterProperties___Builder__create(){ +BEGIN_CPP11 + return cpp11::as_sexp(parquet___WriterProperties___Builder__create()); +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___WriterProperties___Builder__create(){ +extern "C" SEXP _arrow_parquet___WriterProperties___Builder__create(){ Rf_error("Cannot call parquet___WriterProperties___Builder__create(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4402,88 +4403,88 @@ RcppExport SEXP _arrow_parquet___WriterProperties___Builder__create(){ // parquet.cpp #if defined(ARROW_R_WITH_ARROW) void parquet___WriterProperties___Builder__version(const std::shared_ptr& builder, const parquet::ParquetVersion::type& version); -RcppExport SEXP _arrow_parquet___WriterProperties___Builder__version(SEXP builder_sexp, SEXP version_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type builder(builder_sexp); - Rcpp::traits::input_parameter::type version(version_sexp); +extern "C" SEXP _arrow_parquet___WriterProperties___Builder__version(SEXP builder_sexp, SEXP version_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type builder(builder_sexp); + arrow::r::Input::type version(version_sexp); parquet___WriterProperties___Builder__version(builder, version); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___WriterProperties___Builder__version(SEXP builder_sexp, SEXP version_sexp){ +extern "C" SEXP _arrow_parquet___WriterProperties___Builder__version(SEXP builder_sexp, SEXP version_sexp){ Rf_error("Cannot call parquet___WriterProperties___Builder__version(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // parquet.cpp #if defined(ARROW_R_WITH_ARROW) -void parquet___ArrowWriterProperties___Builder__set_compressions(const std::shared_ptr& builder, const std::vector& paths, const Rcpp::IntegerVector& types); -RcppExport SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_compressions(SEXP builder_sexp, SEXP paths_sexp, SEXP types_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type builder(builder_sexp); - Rcpp::traits::input_parameter&>::type paths(paths_sexp); - Rcpp::traits::input_parameter::type types(types_sexp); +void parquet___ArrowWriterProperties___Builder__set_compressions(const std::shared_ptr& builder, const std::vector& paths, cpp11::integers types); +extern "C" SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_compressions(SEXP builder_sexp, SEXP paths_sexp, SEXP types_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type builder(builder_sexp); + arrow::r::Input&>::type paths(paths_sexp); + arrow::r::Input::type types(types_sexp); parquet___ArrowWriterProperties___Builder__set_compressions(builder, paths, types); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_compressions(SEXP builder_sexp, SEXP paths_sexp, SEXP types_sexp){ +extern "C" SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_compressions(SEXP builder_sexp, SEXP paths_sexp, SEXP types_sexp){ Rf_error("Cannot call parquet___ArrowWriterProperties___Builder__set_compressions(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // parquet.cpp #if defined(ARROW_R_WITH_ARROW) -void parquet___ArrowWriterProperties___Builder__set_compression_levels(const std::shared_ptr& builder, const std::vector& paths, const Rcpp::IntegerVector& levels); -RcppExport SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_compression_levels(SEXP builder_sexp, SEXP paths_sexp, SEXP levels_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type builder(builder_sexp); - Rcpp::traits::input_parameter&>::type paths(paths_sexp); - Rcpp::traits::input_parameter::type levels(levels_sexp); +void parquet___ArrowWriterProperties___Builder__set_compression_levels(const std::shared_ptr& builder, const std::vector& paths, cpp11::integers levels); +extern "C" SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_compression_levels(SEXP builder_sexp, SEXP paths_sexp, SEXP levels_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type builder(builder_sexp); + arrow::r::Input&>::type paths(paths_sexp); + arrow::r::Input::type levels(levels_sexp); parquet___ArrowWriterProperties___Builder__set_compression_levels(builder, paths, levels); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_compression_levels(SEXP builder_sexp, SEXP paths_sexp, SEXP levels_sexp){ +extern "C" SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_compression_levels(SEXP builder_sexp, SEXP paths_sexp, SEXP levels_sexp){ Rf_error("Cannot call parquet___ArrowWriterProperties___Builder__set_compression_levels(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // parquet.cpp #if defined(ARROW_R_WITH_ARROW) -void parquet___ArrowWriterProperties___Builder__set_use_dictionary(const std::shared_ptr& builder, const std::vector& paths, const Rcpp::LogicalVector& use_dictionary); -RcppExport SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_use_dictionary(SEXP builder_sexp, SEXP paths_sexp, SEXP use_dictionary_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type builder(builder_sexp); - Rcpp::traits::input_parameter&>::type paths(paths_sexp); - Rcpp::traits::input_parameter::type use_dictionary(use_dictionary_sexp); +void parquet___ArrowWriterProperties___Builder__set_use_dictionary(const std::shared_ptr& builder, const std::vector& paths, cpp11::logicals use_dictionary); +extern "C" SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_use_dictionary(SEXP builder_sexp, SEXP paths_sexp, SEXP use_dictionary_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type builder(builder_sexp); + arrow::r::Input&>::type paths(paths_sexp); + arrow::r::Input::type use_dictionary(use_dictionary_sexp); parquet___ArrowWriterProperties___Builder__set_use_dictionary(builder, paths, use_dictionary); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_use_dictionary(SEXP builder_sexp, SEXP paths_sexp, SEXP use_dictionary_sexp){ +extern "C" SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_use_dictionary(SEXP builder_sexp, SEXP paths_sexp, SEXP use_dictionary_sexp){ Rf_error("Cannot call parquet___ArrowWriterProperties___Builder__set_use_dictionary(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // parquet.cpp #if defined(ARROW_R_WITH_ARROW) -void parquet___ArrowWriterProperties___Builder__set_write_statistics(const std::shared_ptr& builder, const std::vector& paths, const Rcpp::LogicalVector& write_statistics); -RcppExport SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_write_statistics(SEXP builder_sexp, SEXP paths_sexp, SEXP write_statistics_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type builder(builder_sexp); - Rcpp::traits::input_parameter&>::type paths(paths_sexp); - Rcpp::traits::input_parameter::type write_statistics(write_statistics_sexp); +void parquet___ArrowWriterProperties___Builder__set_write_statistics(const std::shared_ptr& builder, const std::vector& paths, cpp11::logicals write_statistics); +extern "C" SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_write_statistics(SEXP builder_sexp, SEXP paths_sexp, SEXP write_statistics_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type builder(builder_sexp); + arrow::r::Input&>::type paths(paths_sexp); + arrow::r::Input::type write_statistics(write_statistics_sexp); parquet___ArrowWriterProperties___Builder__set_write_statistics(builder, paths, write_statistics); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_write_statistics(SEXP builder_sexp, SEXP paths_sexp, SEXP write_statistics_sexp){ +extern "C" SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_write_statistics(SEXP builder_sexp, SEXP paths_sexp, SEXP write_statistics_sexp){ Rf_error("Cannot call parquet___ArrowWriterProperties___Builder__set_write_statistics(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4491,16 +4492,16 @@ RcppExport SEXP _arrow_parquet___ArrowWriterProperties___Builder__set_write_stat // parquet.cpp #if defined(ARROW_R_WITH_ARROW) void parquet___ArrowWriterProperties___Builder__data_page_size(const std::shared_ptr& builder, int64_t data_page_size); -RcppExport SEXP _arrow_parquet___ArrowWriterProperties___Builder__data_page_size(SEXP builder_sexp, SEXP data_page_size_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type builder(builder_sexp); - Rcpp::traits::input_parameter::type data_page_size(data_page_size_sexp); +extern "C" SEXP _arrow_parquet___ArrowWriterProperties___Builder__data_page_size(SEXP builder_sexp, SEXP data_page_size_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type builder(builder_sexp); + arrow::r::Input::type data_page_size(data_page_size_sexp); parquet___ArrowWriterProperties___Builder__data_page_size(builder, data_page_size); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___ArrowWriterProperties___Builder__data_page_size(SEXP builder_sexp, SEXP data_page_size_sexp){ +extern "C" SEXP _arrow_parquet___ArrowWriterProperties___Builder__data_page_size(SEXP builder_sexp, SEXP data_page_size_sexp){ Rf_error("Cannot call parquet___ArrowWriterProperties___Builder__data_page_size(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4508,14 +4509,14 @@ RcppExport SEXP _arrow_parquet___ArrowWriterProperties___Builder__data_page_size // parquet.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr parquet___WriterProperties___Builder__build(const std::shared_ptr& builder); -RcppExport SEXP _arrow_parquet___WriterProperties___Builder__build(SEXP builder_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type builder(builder_sexp); - return Rcpp::wrap(parquet___WriterProperties___Builder__build(builder)); -END_RCPP +extern "C" SEXP _arrow_parquet___WriterProperties___Builder__build(SEXP builder_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type builder(builder_sexp); + return cpp11::as_sexp(parquet___WriterProperties___Builder__build(builder)); +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___WriterProperties___Builder__build(SEXP builder_sexp){ +extern "C" SEXP _arrow_parquet___WriterProperties___Builder__build(SEXP builder_sexp){ Rf_error("Cannot call parquet___WriterProperties___Builder__build(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4523,17 +4524,17 @@ RcppExport SEXP _arrow_parquet___WriterProperties___Builder__build(SEXP builder_ // parquet.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr parquet___arrow___ParquetFileWriter__Open(const std::shared_ptr& schema, const std::shared_ptr& sink, const std::shared_ptr& properties, const std::shared_ptr& arrow_properties); -RcppExport SEXP _arrow_parquet___arrow___ParquetFileWriter__Open(SEXP schema_sexp, SEXP sink_sexp, SEXP properties_sexp, SEXP arrow_properties_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - Rcpp::traits::input_parameter&>::type sink(sink_sexp); - Rcpp::traits::input_parameter&>::type properties(properties_sexp); - Rcpp::traits::input_parameter&>::type arrow_properties(arrow_properties_sexp); - return Rcpp::wrap(parquet___arrow___ParquetFileWriter__Open(schema, sink, properties, arrow_properties)); -END_RCPP +extern "C" SEXP _arrow_parquet___arrow___ParquetFileWriter__Open(SEXP schema_sexp, SEXP sink_sexp, SEXP properties_sexp, SEXP arrow_properties_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type schema(schema_sexp); + arrow::r::Input&>::type sink(sink_sexp); + arrow::r::Input&>::type properties(properties_sexp); + arrow::r::Input&>::type arrow_properties(arrow_properties_sexp); + return cpp11::as_sexp(parquet___arrow___ParquetFileWriter__Open(schema, sink, properties, arrow_properties)); +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___ParquetFileWriter__Open(SEXP schema_sexp, SEXP sink_sexp, SEXP properties_sexp, SEXP arrow_properties_sexp){ +extern "C" SEXP _arrow_parquet___arrow___ParquetFileWriter__Open(SEXP schema_sexp, SEXP sink_sexp, SEXP properties_sexp, SEXP arrow_properties_sexp){ Rf_error("Cannot call parquet___arrow___ParquetFileWriter__Open(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4541,17 +4542,17 @@ RcppExport SEXP _arrow_parquet___arrow___ParquetFileWriter__Open(SEXP schema_sex // parquet.cpp #if defined(ARROW_R_WITH_ARROW) void parquet___arrow___FileWriter__WriteTable(const std::shared_ptr& writer, const std::shared_ptr& table, int64_t chunk_size); -RcppExport SEXP _arrow_parquet___arrow___FileWriter__WriteTable(SEXP writer_sexp, SEXP table_sexp, SEXP chunk_size_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type writer(writer_sexp); - Rcpp::traits::input_parameter&>::type table(table_sexp); - Rcpp::traits::input_parameter::type chunk_size(chunk_size_sexp); +extern "C" SEXP _arrow_parquet___arrow___FileWriter__WriteTable(SEXP writer_sexp, SEXP table_sexp, SEXP chunk_size_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type writer(writer_sexp); + arrow::r::Input&>::type table(table_sexp); + arrow::r::Input::type chunk_size(chunk_size_sexp); parquet___arrow___FileWriter__WriteTable(writer, table, chunk_size); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___FileWriter__WriteTable(SEXP writer_sexp, SEXP table_sexp, SEXP chunk_size_sexp){ +extern "C" SEXP _arrow_parquet___arrow___FileWriter__WriteTable(SEXP writer_sexp, SEXP table_sexp, SEXP chunk_size_sexp){ Rf_error("Cannot call parquet___arrow___FileWriter__WriteTable(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4559,15 +4560,15 @@ RcppExport SEXP _arrow_parquet___arrow___FileWriter__WriteTable(SEXP writer_sexp // parquet.cpp #if defined(ARROW_R_WITH_ARROW) void parquet___arrow___FileWriter__Close(const std::shared_ptr& writer); -RcppExport SEXP _arrow_parquet___arrow___FileWriter__Close(SEXP writer_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type writer(writer_sexp); +extern "C" SEXP _arrow_parquet___arrow___FileWriter__Close(SEXP writer_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type writer(writer_sexp); parquet___arrow___FileWriter__Close(writer); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___FileWriter__Close(SEXP writer_sexp){ +extern "C" SEXP _arrow_parquet___arrow___FileWriter__Close(SEXP writer_sexp){ Rf_error("Cannot call parquet___arrow___FileWriter__Close(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4575,18 +4576,18 @@ RcppExport SEXP _arrow_parquet___arrow___FileWriter__Close(SEXP writer_sexp){ // parquet.cpp #if defined(ARROW_R_WITH_ARROW) void parquet___arrow___WriteTable(const std::shared_ptr& table, const std::shared_ptr& sink, const std::shared_ptr& properties, const std::shared_ptr& arrow_properties); -RcppExport SEXP _arrow_parquet___arrow___WriteTable(SEXP table_sexp, SEXP sink_sexp, SEXP properties_sexp, SEXP arrow_properties_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - Rcpp::traits::input_parameter&>::type sink(sink_sexp); - Rcpp::traits::input_parameter&>::type properties(properties_sexp); - Rcpp::traits::input_parameter&>::type arrow_properties(arrow_properties_sexp); +extern "C" SEXP _arrow_parquet___arrow___WriteTable(SEXP table_sexp, SEXP sink_sexp, SEXP properties_sexp, SEXP arrow_properties_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + arrow::r::Input&>::type sink(sink_sexp); + arrow::r::Input&>::type properties(properties_sexp); + arrow::r::Input&>::type arrow_properties(arrow_properties_sexp); parquet___arrow___WriteTable(table, sink, properties, arrow_properties); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___WriteTable(SEXP table_sexp, SEXP sink_sexp, SEXP properties_sexp, SEXP arrow_properties_sexp){ +extern "C" SEXP _arrow_parquet___arrow___WriteTable(SEXP table_sexp, SEXP sink_sexp, SEXP properties_sexp, SEXP arrow_properties_sexp){ Rf_error("Cannot call parquet___arrow___WriteTable(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4594,176 +4595,176 @@ RcppExport SEXP _arrow_parquet___arrow___WriteTable(SEXP table_sexp, SEXP sink_s // parquet.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr parquet___arrow___FileReader__GetSchema(const std::shared_ptr& reader); -RcppExport SEXP _arrow_parquet___arrow___FileReader__GetSchema(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(parquet___arrow___FileReader__GetSchema(reader)); -END_RCPP +extern "C" SEXP _arrow_parquet___arrow___FileReader__GetSchema(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(parquet___arrow___FileReader__GetSchema(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_parquet___arrow___FileReader__GetSchema(SEXP reader_sexp){ +extern "C" SEXP _arrow_parquet___arrow___FileReader__GetSchema(SEXP reader_sexp){ Rf_error("Cannot call parquet___arrow___FileReader__GetSchema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // py-to-r.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr ImportArray(uintptr_t array, uintptr_t schema); -RcppExport SEXP _arrow_ImportArray(SEXP array_sexp, SEXP schema_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type array(array_sexp); - Rcpp::traits::input_parameter::type schema(schema_sexp); - return Rcpp::wrap(ImportArray(array, schema)); -END_RCPP +std::shared_ptr ImportArray(arrow::r::Pointer array, arrow::r::Pointer schema); +extern "C" SEXP _arrow_ImportArray(SEXP array_sexp, SEXP schema_sexp){ +BEGIN_CPP11 + arrow::r::Input>::type array(array_sexp); + arrow::r::Input>::type schema(schema_sexp); + return cpp11::as_sexp(ImportArray(array, schema)); +END_CPP11 } #else -RcppExport SEXP _arrow_ImportArray(SEXP array_sexp, SEXP schema_sexp){ +extern "C" SEXP _arrow_ImportArray(SEXP array_sexp, SEXP schema_sexp){ Rf_error("Cannot call ImportArray(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // py-to-r.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr ImportRecordBatch(uintptr_t array, uintptr_t schema); -RcppExport SEXP _arrow_ImportRecordBatch(SEXP array_sexp, SEXP schema_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type array(array_sexp); - Rcpp::traits::input_parameter::type schema(schema_sexp); - return Rcpp::wrap(ImportRecordBatch(array, schema)); -END_RCPP +std::shared_ptr ImportRecordBatch(arrow::r::Pointer array, arrow::r::Pointer schema); +extern "C" SEXP _arrow_ImportRecordBatch(SEXP array_sexp, SEXP schema_sexp){ +BEGIN_CPP11 + arrow::r::Input>::type array(array_sexp); + arrow::r::Input>::type schema(schema_sexp); + return cpp11::as_sexp(ImportRecordBatch(array, schema)); +END_CPP11 } #else -RcppExport SEXP _arrow_ImportRecordBatch(SEXP array_sexp, SEXP schema_sexp){ +extern "C" SEXP _arrow_ImportRecordBatch(SEXP array_sexp, SEXP schema_sexp){ Rf_error("Cannot call ImportRecordBatch(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // py-to-r.cpp #if defined(ARROW_R_WITH_ARROW) -uintptr_t allocate_arrow_schema(); -RcppExport SEXP _arrow_allocate_arrow_schema(){ -BEGIN_RCPP - return Rcpp::wrap(allocate_arrow_schema()); -END_RCPP +arrow::r::Pointer allocate_arrow_schema(); +extern "C" SEXP _arrow_allocate_arrow_schema(){ +BEGIN_CPP11 + return cpp11::as_sexp(allocate_arrow_schema()); +END_CPP11 } #else -RcppExport SEXP _arrow_allocate_arrow_schema(){ +extern "C" SEXP _arrow_allocate_arrow_schema(){ Rf_error("Cannot call allocate_arrow_schema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // py-to-r.cpp #if defined(ARROW_R_WITH_ARROW) -void delete_arrow_schema(uintptr_t ptr); -RcppExport SEXP _arrow_delete_arrow_schema(SEXP ptr_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type ptr(ptr_sexp); +void delete_arrow_schema(arrow::r::Pointer ptr); +extern "C" SEXP _arrow_delete_arrow_schema(SEXP ptr_sexp){ +BEGIN_CPP11 + arrow::r::Input>::type ptr(ptr_sexp); delete_arrow_schema(ptr); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_delete_arrow_schema(SEXP ptr_sexp){ +extern "C" SEXP _arrow_delete_arrow_schema(SEXP ptr_sexp){ Rf_error("Cannot call delete_arrow_schema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // py-to-r.cpp #if defined(ARROW_R_WITH_ARROW) -uintptr_t allocate_arrow_array(); -RcppExport SEXP _arrow_allocate_arrow_array(){ -BEGIN_RCPP - return Rcpp::wrap(allocate_arrow_array()); -END_RCPP +arrow::r::Pointer allocate_arrow_array(); +extern "C" SEXP _arrow_allocate_arrow_array(){ +BEGIN_CPP11 + return cpp11::as_sexp(allocate_arrow_array()); +END_CPP11 } #else -RcppExport SEXP _arrow_allocate_arrow_array(){ +extern "C" SEXP _arrow_allocate_arrow_array(){ Rf_error("Cannot call allocate_arrow_array(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // py-to-r.cpp #if defined(ARROW_R_WITH_ARROW) -void delete_arrow_array(uintptr_t ptr); -RcppExport SEXP _arrow_delete_arrow_array(SEXP ptr_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type ptr(ptr_sexp); +void delete_arrow_array(arrow::r::Pointer ptr); +extern "C" SEXP _arrow_delete_arrow_array(SEXP ptr_sexp){ +BEGIN_CPP11 + arrow::r::Input>::type ptr(ptr_sexp); delete_arrow_array(ptr); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_delete_arrow_array(SEXP ptr_sexp){ +extern "C" SEXP _arrow_delete_arrow_array(SEXP ptr_sexp){ Rf_error("Cannot call delete_arrow_array(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // py-to-r.cpp #if defined(ARROW_R_WITH_ARROW) -void ExportType(const std::shared_ptr& type, uintptr_t ptr); -RcppExport SEXP _arrow_ExportType(SEXP type_sexp, SEXP ptr_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type type(type_sexp); - Rcpp::traits::input_parameter::type ptr(ptr_sexp); +void ExportType(const std::shared_ptr& type, arrow::r::Pointer ptr); +extern "C" SEXP _arrow_ExportType(SEXP type_sexp, SEXP ptr_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type type(type_sexp); + arrow::r::Input>::type ptr(ptr_sexp); ExportType(type, ptr); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_ExportType(SEXP type_sexp, SEXP ptr_sexp){ +extern "C" SEXP _arrow_ExportType(SEXP type_sexp, SEXP ptr_sexp){ Rf_error("Cannot call ExportType(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // py-to-r.cpp #if defined(ARROW_R_WITH_ARROW) -void ExportSchema(const std::shared_ptr& schema, uintptr_t ptr); -RcppExport SEXP _arrow_ExportSchema(SEXP schema_sexp, SEXP ptr_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - Rcpp::traits::input_parameter::type ptr(ptr_sexp); +void ExportSchema(const std::shared_ptr& schema, arrow::r::Pointer ptr); +extern "C" SEXP _arrow_ExportSchema(SEXP schema_sexp, SEXP ptr_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type schema(schema_sexp); + arrow::r::Input>::type ptr(ptr_sexp); ExportSchema(schema, ptr); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_ExportSchema(SEXP schema_sexp, SEXP ptr_sexp){ +extern "C" SEXP _arrow_ExportSchema(SEXP schema_sexp, SEXP ptr_sexp){ Rf_error("Cannot call ExportSchema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // py-to-r.cpp #if defined(ARROW_R_WITH_ARROW) -void ExportArray(const std::shared_ptr& array, uintptr_t ptr, uintptr_t schema_ptr); -RcppExport SEXP _arrow_ExportArray(SEXP array_sexp, SEXP ptr_sexp, SEXP schema_ptr_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type array(array_sexp); - Rcpp::traits::input_parameter::type ptr(ptr_sexp); - Rcpp::traits::input_parameter::type schema_ptr(schema_ptr_sexp); - ExportArray(array, ptr, schema_ptr); +void ExportArray(const std::shared_ptr& array, arrow::r::Pointer array_ptr, arrow::r::Pointer schema_ptr); +extern "C" SEXP _arrow_ExportArray(SEXP array_sexp, SEXP array_ptr_sexp, SEXP schema_ptr_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type array(array_sexp); + arrow::r::Input>::type array_ptr(array_ptr_sexp); + arrow::r::Input>::type schema_ptr(schema_ptr_sexp); + ExportArray(array, array_ptr, schema_ptr); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_ExportArray(SEXP array_sexp, SEXP ptr_sexp, SEXP schema_ptr_sexp){ +extern "C" SEXP _arrow_ExportArray(SEXP array_sexp, SEXP array_ptr_sexp, SEXP schema_ptr_sexp){ Rf_error("Cannot call ExportArray(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // py-to-r.cpp #if defined(ARROW_R_WITH_ARROW) -void ExportRecordBatch(const std::shared_ptr& batch, uintptr_t ptr, uintptr_t schema_ptr); -RcppExport SEXP _arrow_ExportRecordBatch(SEXP batch_sexp, SEXP ptr_sexp, SEXP schema_ptr_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch(batch_sexp); - Rcpp::traits::input_parameter::type ptr(ptr_sexp); - Rcpp::traits::input_parameter::type schema_ptr(schema_ptr_sexp); - ExportRecordBatch(batch, ptr, schema_ptr); +void ExportRecordBatch(const std::shared_ptr& batch, arrow::r::Pointer array_ptr, arrow::r::Pointer schema_ptr); +extern "C" SEXP _arrow_ExportRecordBatch(SEXP batch_sexp, SEXP array_ptr_sexp, SEXP schema_ptr_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch(batch_sexp); + arrow::r::Input>::type array_ptr(array_ptr_sexp); + arrow::r::Input>::type schema_ptr(schema_ptr_sexp); + ExportRecordBatch(batch, array_ptr, schema_ptr); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_ExportRecordBatch(SEXP batch_sexp, SEXP ptr_sexp, SEXP schema_ptr_sexp){ +extern "C" SEXP _arrow_ExportRecordBatch(SEXP batch_sexp, SEXP array_ptr_sexp, SEXP schema_ptr_sexp){ Rf_error("Cannot call ExportRecordBatch(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4771,14 +4772,14 @@ RcppExport SEXP _arrow_ExportRecordBatch(SEXP batch_sexp, SEXP ptr_sexp, SEXP sc // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) int RecordBatch__num_columns(const std::shared_ptr& x); -RcppExport SEXP _arrow_RecordBatch__num_columns(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(RecordBatch__num_columns(x)); -END_RCPP +extern "C" SEXP _arrow_RecordBatch__num_columns(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(RecordBatch__num_columns(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__num_columns(SEXP x_sexp){ +extern "C" SEXP _arrow_RecordBatch__num_columns(SEXP x_sexp){ Rf_error("Cannot call RecordBatch__num_columns(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4786,14 +4787,14 @@ RcppExport SEXP _arrow_RecordBatch__num_columns(SEXP x_sexp){ // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) int RecordBatch__num_rows(const std::shared_ptr& x); -RcppExport SEXP _arrow_RecordBatch__num_rows(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(RecordBatch__num_rows(x)); -END_RCPP +extern "C" SEXP _arrow_RecordBatch__num_rows(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(RecordBatch__num_rows(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__num_rows(SEXP x_sexp){ +extern "C" SEXP _arrow_RecordBatch__num_rows(SEXP x_sexp){ Rf_error("Cannot call RecordBatch__num_rows(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4801,30 +4802,30 @@ RcppExport SEXP _arrow_RecordBatch__num_rows(SEXP x_sexp){ // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr RecordBatch__schema(const std::shared_ptr& x); -RcppExport SEXP _arrow_RecordBatch__schema(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(RecordBatch__schema(x)); -END_RCPP +extern "C" SEXP _arrow_RecordBatch__schema(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(RecordBatch__schema(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__schema(SEXP x_sexp){ +extern "C" SEXP _arrow_RecordBatch__schema(SEXP x_sexp){ Rf_error("Cannot call RecordBatch__schema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr RecordBatch__ReplaceSchemaMetadata(const std::shared_ptr& x, Rcpp::CharacterVector metadata); -RcppExport SEXP _arrow_RecordBatch__ReplaceSchemaMetadata(SEXP x_sexp, SEXP metadata_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type metadata(metadata_sexp); - return Rcpp::wrap(RecordBatch__ReplaceSchemaMetadata(x, metadata)); -END_RCPP +std::shared_ptr RecordBatch__ReplaceSchemaMetadata(const std::shared_ptr& x, cpp11::strings metadata); +extern "C" SEXP _arrow_RecordBatch__ReplaceSchemaMetadata(SEXP x_sexp, SEXP metadata_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type metadata(metadata_sexp); + return cpp11::as_sexp(RecordBatch__ReplaceSchemaMetadata(x, metadata)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__ReplaceSchemaMetadata(SEXP x_sexp, SEXP metadata_sexp){ +extern "C" SEXP _arrow_RecordBatch__ReplaceSchemaMetadata(SEXP x_sexp, SEXP metadata_sexp){ Rf_error("Cannot call RecordBatch__ReplaceSchemaMetadata(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4832,30 +4833,30 @@ RcppExport SEXP _arrow_RecordBatch__ReplaceSchemaMetadata(SEXP x_sexp, SEXP meta // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) arrow::ArrayVector RecordBatch__columns(const std::shared_ptr& batch); -RcppExport SEXP _arrow_RecordBatch__columns(SEXP batch_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch(batch_sexp); - return Rcpp::wrap(RecordBatch__columns(batch)); -END_RCPP +extern "C" SEXP _arrow_RecordBatch__columns(SEXP batch_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch(batch_sexp); + return cpp11::as_sexp(RecordBatch__columns(batch)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__columns(SEXP batch_sexp){ +extern "C" SEXP _arrow_RecordBatch__columns(SEXP batch_sexp){ Rf_error("Cannot call RecordBatch__columns(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr RecordBatch__column(const std::shared_ptr& batch, int i); -RcppExport SEXP _arrow_RecordBatch__column(SEXP batch_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch(batch_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(RecordBatch__column(batch, i)); -END_RCPP +std::shared_ptr RecordBatch__column(const std::shared_ptr& batch, R_xlen_t i); +extern "C" SEXP _arrow_RecordBatch__column(SEXP batch_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch(batch_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(RecordBatch__column(batch, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__column(SEXP batch_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_RecordBatch__column(SEXP batch_sexp, SEXP i_sexp){ Rf_error("Cannot call RecordBatch__column(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -4863,158 +4864,143 @@ RcppExport SEXP _arrow_RecordBatch__column(SEXP batch_sexp, SEXP i_sexp){ // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr RecordBatch__GetColumnByName(const std::shared_ptr& batch, const std::string& name); -RcppExport SEXP _arrow_RecordBatch__GetColumnByName(SEXP batch_sexp, SEXP name_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch(batch_sexp); - Rcpp::traits::input_parameter::type name(name_sexp); - return Rcpp::wrap(RecordBatch__GetColumnByName(batch, name)); -END_RCPP +extern "C" SEXP _arrow_RecordBatch__GetColumnByName(SEXP batch_sexp, SEXP name_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch(batch_sexp); + arrow::r::Input::type name(name_sexp); + return cpp11::as_sexp(RecordBatch__GetColumnByName(batch, name)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__GetColumnByName(SEXP batch_sexp, SEXP name_sexp){ +extern "C" SEXP _arrow_RecordBatch__GetColumnByName(SEXP batch_sexp, SEXP name_sexp){ Rf_error("Cannot call RecordBatch__GetColumnByName(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr RecordBatch__select(const std::shared_ptr& batch, const Rcpp::IntegerVector& indices); -RcppExport SEXP _arrow_RecordBatch__select(SEXP batch_sexp, SEXP indices_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch(batch_sexp); - Rcpp::traits::input_parameter::type indices(indices_sexp); - return Rcpp::wrap(RecordBatch__select(batch, indices)); -END_RCPP +std::shared_ptr RecordBatch__select(const std::shared_ptr& batch, cpp11::integers indices); +extern "C" SEXP _arrow_RecordBatch__select(SEXP batch_sexp, SEXP indices_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch(batch_sexp); + arrow::r::Input::type indices(indices_sexp); + return cpp11::as_sexp(RecordBatch__select(batch, indices)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__select(SEXP batch_sexp, SEXP indices_sexp){ +extern "C" SEXP _arrow_RecordBatch__select(SEXP batch_sexp, SEXP indices_sexp){ Rf_error("Cannot call RecordBatch__select(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif -// recordbatch.cpp -#if defined(ARROW_R_WITH_ARROW) -std::shared_ptr RecordBatch__from_dataframe(Rcpp::DataFrame tbl); -RcppExport SEXP _arrow_RecordBatch__from_dataframe(SEXP tbl_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type tbl(tbl_sexp); - return Rcpp::wrap(RecordBatch__from_dataframe(tbl)); -END_RCPP -} -#else -RcppExport SEXP _arrow_RecordBatch__from_dataframe(SEXP tbl_sexp){ - Rf_error("Cannot call RecordBatch__from_dataframe(). Please use arrow::install_arrow() to install required runtime libraries. "); -} -#endif - // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) bool RecordBatch__Equals(const std::shared_ptr& self, const std::shared_ptr& other, bool check_metadata); -RcppExport SEXP _arrow_RecordBatch__Equals(SEXP self_sexp, SEXP other_sexp, SEXP check_metadata_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type self(self_sexp); - Rcpp::traits::input_parameter&>::type other(other_sexp); - Rcpp::traits::input_parameter::type check_metadata(check_metadata_sexp); - return Rcpp::wrap(RecordBatch__Equals(self, other, check_metadata)); -END_RCPP +extern "C" SEXP _arrow_RecordBatch__Equals(SEXP self_sexp, SEXP other_sexp, SEXP check_metadata_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type self(self_sexp); + arrow::r::Input&>::type other(other_sexp); + arrow::r::Input::type check_metadata(check_metadata_sexp); + return cpp11::as_sexp(RecordBatch__Equals(self, other, check_metadata)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__Equals(SEXP self_sexp, SEXP other_sexp, SEXP check_metadata_sexp){ +extern "C" SEXP _arrow_RecordBatch__Equals(SEXP self_sexp, SEXP other_sexp, SEXP check_metadata_sexp){ Rf_error("Cannot call RecordBatch__Equals(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr RecordBatch__RemoveColumn(const std::shared_ptr& batch, int i); -RcppExport SEXP _arrow_RecordBatch__RemoveColumn(SEXP batch_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch(batch_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(RecordBatch__RemoveColumn(batch, i)); -END_RCPP +std::shared_ptr RecordBatch__RemoveColumn(const std::shared_ptr& batch, R_xlen_t i); +extern "C" SEXP _arrow_RecordBatch__RemoveColumn(SEXP batch_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch(batch_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(RecordBatch__RemoveColumn(batch, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__RemoveColumn(SEXP batch_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_RecordBatch__RemoveColumn(SEXP batch_sexp, SEXP i_sexp){ Rf_error("Cannot call RecordBatch__RemoveColumn(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) -std::string RecordBatch__column_name(const std::shared_ptr& batch, int i); -RcppExport SEXP _arrow_RecordBatch__column_name(SEXP batch_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch(batch_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(RecordBatch__column_name(batch, i)); -END_RCPP +std::string RecordBatch__column_name(const std::shared_ptr& batch, R_xlen_t i); +extern "C" SEXP _arrow_RecordBatch__column_name(SEXP batch_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch(batch_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(RecordBatch__column_name(batch, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__column_name(SEXP batch_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_RecordBatch__column_name(SEXP batch_sexp, SEXP i_sexp){ Rf_error("Cannot call RecordBatch__column_name(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) -Rcpp::CharacterVector RecordBatch__names(const std::shared_ptr& batch); -RcppExport SEXP _arrow_RecordBatch__names(SEXP batch_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch(batch_sexp); - return Rcpp::wrap(RecordBatch__names(batch)); -END_RCPP +cpp11::writable::strings RecordBatch__names(const std::shared_ptr& batch); +extern "C" SEXP _arrow_RecordBatch__names(SEXP batch_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch(batch_sexp); + return cpp11::as_sexp(RecordBatch__names(batch)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__names(SEXP batch_sexp){ +extern "C" SEXP _arrow_RecordBatch__names(SEXP batch_sexp){ Rf_error("Cannot call RecordBatch__names(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr RecordBatch__Slice1(const std::shared_ptr& self, int offset); -RcppExport SEXP _arrow_RecordBatch__Slice1(SEXP self_sexp, SEXP offset_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type self(self_sexp); - Rcpp::traits::input_parameter::type offset(offset_sexp); - return Rcpp::wrap(RecordBatch__Slice1(self, offset)); -END_RCPP +std::shared_ptr RecordBatch__Slice1(const std::shared_ptr& self, R_xlen_t offset); +extern "C" SEXP _arrow_RecordBatch__Slice1(SEXP self_sexp, SEXP offset_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type self(self_sexp); + arrow::r::Input::type offset(offset_sexp); + return cpp11::as_sexp(RecordBatch__Slice1(self, offset)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__Slice1(SEXP self_sexp, SEXP offset_sexp){ +extern "C" SEXP _arrow_RecordBatch__Slice1(SEXP self_sexp, SEXP offset_sexp){ Rf_error("Cannot call RecordBatch__Slice1(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr RecordBatch__Slice2(const std::shared_ptr& self, int offset, int length); -RcppExport SEXP _arrow_RecordBatch__Slice2(SEXP self_sexp, SEXP offset_sexp, SEXP length_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type self(self_sexp); - Rcpp::traits::input_parameter::type offset(offset_sexp); - Rcpp::traits::input_parameter::type length(length_sexp); - return Rcpp::wrap(RecordBatch__Slice2(self, offset, length)); -END_RCPP +std::shared_ptr RecordBatch__Slice2(const std::shared_ptr& self, R_xlen_t offset, R_xlen_t length); +extern "C" SEXP _arrow_RecordBatch__Slice2(SEXP self_sexp, SEXP offset_sexp, SEXP length_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type self(self_sexp); + arrow::r::Input::type offset(offset_sexp); + arrow::r::Input::type length(length_sexp); + return cpp11::as_sexp(RecordBatch__Slice2(self, offset, length)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__Slice2(SEXP self_sexp, SEXP offset_sexp, SEXP length_sexp){ +extern "C" SEXP _arrow_RecordBatch__Slice2(SEXP self_sexp, SEXP offset_sexp, SEXP length_sexp){ Rf_error("Cannot call RecordBatch__Slice2(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) -Rcpp::RawVector ipc___SerializeRecordBatch__Raw(const std::shared_ptr& batch); -RcppExport SEXP _arrow_ipc___SerializeRecordBatch__Raw(SEXP batch_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch(batch_sexp); - return Rcpp::wrap(ipc___SerializeRecordBatch__Raw(batch)); -END_RCPP +cpp11::raws ipc___SerializeRecordBatch__Raw(const std::shared_ptr& batch); +extern "C" SEXP _arrow_ipc___SerializeRecordBatch__Raw(SEXP batch_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch(batch_sexp); + return cpp11::as_sexp(ipc___SerializeRecordBatch__Raw(batch)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___SerializeRecordBatch__Raw(SEXP batch_sexp){ +extern "C" SEXP _arrow_ipc___SerializeRecordBatch__Raw(SEXP batch_sexp){ Rf_error("Cannot call ipc___SerializeRecordBatch__Raw(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5022,15 +5008,15 @@ RcppExport SEXP _arrow_ipc___SerializeRecordBatch__Raw(SEXP batch_sexp){ // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___ReadRecordBatch__InputStream__Schema(const std::shared_ptr& stream, const std::shared_ptr& schema); -RcppExport SEXP _arrow_ipc___ReadRecordBatch__InputStream__Schema(SEXP stream_sexp, SEXP schema_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - return Rcpp::wrap(ipc___ReadRecordBatch__InputStream__Schema(stream, schema)); -END_RCPP +extern "C" SEXP _arrow_ipc___ReadRecordBatch__InputStream__Schema(SEXP stream_sexp, SEXP schema_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + arrow::r::Input&>::type schema(schema_sexp); + return cpp11::as_sexp(ipc___ReadRecordBatch__InputStream__Schema(stream, schema)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___ReadRecordBatch__InputStream__Schema(SEXP stream_sexp, SEXP schema_sexp){ +extern "C" SEXP _arrow_ipc___ReadRecordBatch__InputStream__Schema(SEXP stream_sexp, SEXP schema_sexp){ Rf_error("Cannot call ipc___ReadRecordBatch__InputStream__Schema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5038,15 +5024,15 @@ RcppExport SEXP _arrow_ipc___ReadRecordBatch__InputStream__Schema(SEXP stream_se // recordbatch.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr RecordBatch__from_arrays(SEXP schema_sxp, SEXP lst); -RcppExport SEXP _arrow_RecordBatch__from_arrays(SEXP schema_sxp_sexp, SEXP lst_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type schema_sxp(schema_sxp_sexp); - Rcpp::traits::input_parameter::type lst(lst_sexp); - return Rcpp::wrap(RecordBatch__from_arrays(schema_sxp, lst)); -END_RCPP +extern "C" SEXP _arrow_RecordBatch__from_arrays(SEXP schema_sxp_sexp, SEXP lst_sexp){ +BEGIN_CPP11 + arrow::r::Input::type schema_sxp(schema_sxp_sexp); + arrow::r::Input::type lst(lst_sexp); + return cpp11::as_sexp(RecordBatch__from_arrays(schema_sxp, lst)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatch__from_arrays(SEXP schema_sxp_sexp, SEXP lst_sexp){ +extern "C" SEXP _arrow_RecordBatch__from_arrays(SEXP schema_sxp_sexp, SEXP lst_sexp){ Rf_error("Cannot call RecordBatch__from_arrays(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5054,14 +5040,14 @@ RcppExport SEXP _arrow_RecordBatch__from_arrays(SEXP schema_sxp_sexp, SEXP lst_s // recordbatchreader.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr RecordBatchReader__schema(const std::shared_ptr& reader); -RcppExport SEXP _arrow_RecordBatchReader__schema(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(RecordBatchReader__schema(reader)); -END_RCPP +extern "C" SEXP _arrow_RecordBatchReader__schema(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(RecordBatchReader__schema(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatchReader__schema(SEXP reader_sexp){ +extern "C" SEXP _arrow_RecordBatchReader__schema(SEXP reader_sexp){ Rf_error("Cannot call RecordBatchReader__schema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5069,14 +5055,14 @@ RcppExport SEXP _arrow_RecordBatchReader__schema(SEXP reader_sexp){ // recordbatchreader.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr RecordBatchReader__ReadNext(const std::shared_ptr& reader); -RcppExport SEXP _arrow_RecordBatchReader__ReadNext(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(RecordBatchReader__ReadNext(reader)); -END_RCPP +extern "C" SEXP _arrow_RecordBatchReader__ReadNext(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(RecordBatchReader__ReadNext(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_RecordBatchReader__ReadNext(SEXP reader_sexp){ +extern "C" SEXP _arrow_RecordBatchReader__ReadNext(SEXP reader_sexp){ Rf_error("Cannot call RecordBatchReader__ReadNext(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5084,14 +5070,14 @@ RcppExport SEXP _arrow_RecordBatchReader__ReadNext(SEXP reader_sexp){ // recordbatchreader.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___RecordBatchStreamReader__Open(const std::shared_ptr& stream); -RcppExport SEXP _arrow_ipc___RecordBatchStreamReader__Open(SEXP stream_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - return Rcpp::wrap(ipc___RecordBatchStreamReader__Open(stream)); -END_RCPP +extern "C" SEXP _arrow_ipc___RecordBatchStreamReader__Open(SEXP stream_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + return cpp11::as_sexp(ipc___RecordBatchStreamReader__Open(stream)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___RecordBatchStreamReader__Open(SEXP stream_sexp){ +extern "C" SEXP _arrow_ipc___RecordBatchStreamReader__Open(SEXP stream_sexp){ Rf_error("Cannot call ipc___RecordBatchStreamReader__Open(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5099,14 +5085,14 @@ RcppExport SEXP _arrow_ipc___RecordBatchStreamReader__Open(SEXP stream_sexp){ // recordbatchreader.cpp #if defined(ARROW_R_WITH_ARROW) std::vector> ipc___RecordBatchStreamReader__batches(const std::shared_ptr& reader); -RcppExport SEXP _arrow_ipc___RecordBatchStreamReader__batches(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(ipc___RecordBatchStreamReader__batches(reader)); -END_RCPP +extern "C" SEXP _arrow_ipc___RecordBatchStreamReader__batches(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(ipc___RecordBatchStreamReader__batches(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___RecordBatchStreamReader__batches(SEXP reader_sexp){ +extern "C" SEXP _arrow_ipc___RecordBatchStreamReader__batches(SEXP reader_sexp){ Rf_error("Cannot call ipc___RecordBatchStreamReader__batches(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5114,14 +5100,14 @@ RcppExport SEXP _arrow_ipc___RecordBatchStreamReader__batches(SEXP reader_sexp){ // recordbatchreader.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___RecordBatchFileReader__schema(const std::shared_ptr& reader); -RcppExport SEXP _arrow_ipc___RecordBatchFileReader__schema(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(ipc___RecordBatchFileReader__schema(reader)); -END_RCPP +extern "C" SEXP _arrow_ipc___RecordBatchFileReader__schema(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(ipc___RecordBatchFileReader__schema(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___RecordBatchFileReader__schema(SEXP reader_sexp){ +extern "C" SEXP _arrow_ipc___RecordBatchFileReader__schema(SEXP reader_sexp){ Rf_error("Cannot call ipc___RecordBatchFileReader__schema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5129,14 +5115,14 @@ RcppExport SEXP _arrow_ipc___RecordBatchFileReader__schema(SEXP reader_sexp){ // recordbatchreader.cpp #if defined(ARROW_R_WITH_ARROW) int ipc___RecordBatchFileReader__num_record_batches(const std::shared_ptr& reader); -RcppExport SEXP _arrow_ipc___RecordBatchFileReader__num_record_batches(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(ipc___RecordBatchFileReader__num_record_batches(reader)); -END_RCPP +extern "C" SEXP _arrow_ipc___RecordBatchFileReader__num_record_batches(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(ipc___RecordBatchFileReader__num_record_batches(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___RecordBatchFileReader__num_record_batches(SEXP reader_sexp){ +extern "C" SEXP _arrow_ipc___RecordBatchFileReader__num_record_batches(SEXP reader_sexp){ Rf_error("Cannot call ipc___RecordBatchFileReader__num_record_batches(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5144,15 +5130,15 @@ RcppExport SEXP _arrow_ipc___RecordBatchFileReader__num_record_batches(SEXP read // recordbatchreader.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___RecordBatchFileReader__ReadRecordBatch(const std::shared_ptr& reader, int i); -RcppExport SEXP _arrow_ipc___RecordBatchFileReader__ReadRecordBatch(SEXP reader_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(ipc___RecordBatchFileReader__ReadRecordBatch(reader, i)); -END_RCPP +extern "C" SEXP _arrow_ipc___RecordBatchFileReader__ReadRecordBatch(SEXP reader_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(ipc___RecordBatchFileReader__ReadRecordBatch(reader, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___RecordBatchFileReader__ReadRecordBatch(SEXP reader_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_ipc___RecordBatchFileReader__ReadRecordBatch(SEXP reader_sexp, SEXP i_sexp){ Rf_error("Cannot call ipc___RecordBatchFileReader__ReadRecordBatch(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5160,14 +5146,14 @@ RcppExport SEXP _arrow_ipc___RecordBatchFileReader__ReadRecordBatch(SEXP reader_ // recordbatchreader.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___RecordBatchFileReader__Open(const std::shared_ptr& file); -RcppExport SEXP _arrow_ipc___RecordBatchFileReader__Open(SEXP file_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type file(file_sexp); - return Rcpp::wrap(ipc___RecordBatchFileReader__Open(file)); -END_RCPP +extern "C" SEXP _arrow_ipc___RecordBatchFileReader__Open(SEXP file_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type file(file_sexp); + return cpp11::as_sexp(ipc___RecordBatchFileReader__Open(file)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___RecordBatchFileReader__Open(SEXP file_sexp){ +extern "C" SEXP _arrow_ipc___RecordBatchFileReader__Open(SEXP file_sexp){ Rf_error("Cannot call ipc___RecordBatchFileReader__Open(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5175,14 +5161,14 @@ RcppExport SEXP _arrow_ipc___RecordBatchFileReader__Open(SEXP file_sexp){ // recordbatchreader.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Table__from_RecordBatchFileReader(const std::shared_ptr& reader); -RcppExport SEXP _arrow_Table__from_RecordBatchFileReader(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(Table__from_RecordBatchFileReader(reader)); -END_RCPP +extern "C" SEXP _arrow_Table__from_RecordBatchFileReader(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(Table__from_RecordBatchFileReader(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__from_RecordBatchFileReader(SEXP reader_sexp){ +extern "C" SEXP _arrow_Table__from_RecordBatchFileReader(SEXP reader_sexp){ Rf_error("Cannot call Table__from_RecordBatchFileReader(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5190,14 +5176,14 @@ RcppExport SEXP _arrow_Table__from_RecordBatchFileReader(SEXP reader_sexp){ // recordbatchreader.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Table__from_RecordBatchStreamReader(const std::shared_ptr& reader); -RcppExport SEXP _arrow_Table__from_RecordBatchStreamReader(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(Table__from_RecordBatchStreamReader(reader)); -END_RCPP +extern "C" SEXP _arrow_Table__from_RecordBatchStreamReader(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(Table__from_RecordBatchStreamReader(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__from_RecordBatchStreamReader(SEXP reader_sexp){ +extern "C" SEXP _arrow_Table__from_RecordBatchStreamReader(SEXP reader_sexp){ Rf_error("Cannot call Table__from_RecordBatchStreamReader(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5205,14 +5191,14 @@ RcppExport SEXP _arrow_Table__from_RecordBatchStreamReader(SEXP reader_sexp){ // recordbatchreader.cpp #if defined(ARROW_R_WITH_ARROW) std::vector> ipc___RecordBatchFileReader__batches(const std::shared_ptr& reader); -RcppExport SEXP _arrow_ipc___RecordBatchFileReader__batches(SEXP reader_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type reader(reader_sexp); - return Rcpp::wrap(ipc___RecordBatchFileReader__batches(reader)); -END_RCPP +extern "C" SEXP _arrow_ipc___RecordBatchFileReader__batches(SEXP reader_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type reader(reader_sexp); + return cpp11::as_sexp(ipc___RecordBatchFileReader__batches(reader)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___RecordBatchFileReader__batches(SEXP reader_sexp){ +extern "C" SEXP _arrow_ipc___RecordBatchFileReader__batches(SEXP reader_sexp){ Rf_error("Cannot call ipc___RecordBatchFileReader__batches(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5220,16 +5206,16 @@ RcppExport SEXP _arrow_ipc___RecordBatchFileReader__batches(SEXP reader_sexp){ // recordbatchwriter.cpp #if defined(ARROW_R_WITH_ARROW) void ipc___RecordBatchWriter__WriteRecordBatch(const std::shared_ptr& batch_writer, const std::shared_ptr& batch); -RcppExport SEXP _arrow_ipc___RecordBatchWriter__WriteRecordBatch(SEXP batch_writer_sexp, SEXP batch_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch_writer(batch_writer_sexp); - Rcpp::traits::input_parameter&>::type batch(batch_sexp); +extern "C" SEXP _arrow_ipc___RecordBatchWriter__WriteRecordBatch(SEXP batch_writer_sexp, SEXP batch_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch_writer(batch_writer_sexp); + arrow::r::Input&>::type batch(batch_sexp); ipc___RecordBatchWriter__WriteRecordBatch(batch_writer, batch); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___RecordBatchWriter__WriteRecordBatch(SEXP batch_writer_sexp, SEXP batch_sexp){ +extern "C" SEXP _arrow_ipc___RecordBatchWriter__WriteRecordBatch(SEXP batch_writer_sexp, SEXP batch_sexp){ Rf_error("Cannot call ipc___RecordBatchWriter__WriteRecordBatch(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5237,16 +5223,16 @@ RcppExport SEXP _arrow_ipc___RecordBatchWriter__WriteRecordBatch(SEXP batch_writ // recordbatchwriter.cpp #if defined(ARROW_R_WITH_ARROW) void ipc___RecordBatchWriter__WriteTable(const std::shared_ptr& batch_writer, const std::shared_ptr& table); -RcppExport SEXP _arrow_ipc___RecordBatchWriter__WriteTable(SEXP batch_writer_sexp, SEXP table_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch_writer(batch_writer_sexp); - Rcpp::traits::input_parameter&>::type table(table_sexp); +extern "C" SEXP _arrow_ipc___RecordBatchWriter__WriteTable(SEXP batch_writer_sexp, SEXP table_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch_writer(batch_writer_sexp); + arrow::r::Input&>::type table(table_sexp); ipc___RecordBatchWriter__WriteTable(batch_writer, table); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___RecordBatchWriter__WriteTable(SEXP batch_writer_sexp, SEXP table_sexp){ +extern "C" SEXP _arrow_ipc___RecordBatchWriter__WriteTable(SEXP batch_writer_sexp, SEXP table_sexp){ Rf_error("Cannot call ipc___RecordBatchWriter__WriteTable(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5254,15 +5240,15 @@ RcppExport SEXP _arrow_ipc___RecordBatchWriter__WriteTable(SEXP batch_writer_sex // recordbatchwriter.cpp #if defined(ARROW_R_WITH_ARROW) void ipc___RecordBatchWriter__Close(const std::shared_ptr& batch_writer); -RcppExport SEXP _arrow_ipc___RecordBatchWriter__Close(SEXP batch_writer_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type batch_writer(batch_writer_sexp); +extern "C" SEXP _arrow_ipc___RecordBatchWriter__Close(SEXP batch_writer_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type batch_writer(batch_writer_sexp); ipc___RecordBatchWriter__Close(batch_writer); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___RecordBatchWriter__Close(SEXP batch_writer_sexp){ +extern "C" SEXP _arrow_ipc___RecordBatchWriter__Close(SEXP batch_writer_sexp){ Rf_error("Cannot call ipc___RecordBatchWriter__Close(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5270,17 +5256,17 @@ RcppExport SEXP _arrow_ipc___RecordBatchWriter__Close(SEXP batch_writer_sexp){ // recordbatchwriter.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___RecordBatchFileWriter__Open(const std::shared_ptr& stream, const std::shared_ptr& schema, bool use_legacy_format, arrow::ipc::MetadataVersion metadata_version); -RcppExport SEXP _arrow_ipc___RecordBatchFileWriter__Open(SEXP stream_sexp, SEXP schema_sexp, SEXP use_legacy_format_sexp, SEXP metadata_version_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - Rcpp::traits::input_parameter::type use_legacy_format(use_legacy_format_sexp); - Rcpp::traits::input_parameter::type metadata_version(metadata_version_sexp); - return Rcpp::wrap(ipc___RecordBatchFileWriter__Open(stream, schema, use_legacy_format, metadata_version)); -END_RCPP +extern "C" SEXP _arrow_ipc___RecordBatchFileWriter__Open(SEXP stream_sexp, SEXP schema_sexp, SEXP use_legacy_format_sexp, SEXP metadata_version_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + arrow::r::Input&>::type schema(schema_sexp); + arrow::r::Input::type use_legacy_format(use_legacy_format_sexp); + arrow::r::Input::type metadata_version(metadata_version_sexp); + return cpp11::as_sexp(ipc___RecordBatchFileWriter__Open(stream, schema, use_legacy_format, metadata_version)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___RecordBatchFileWriter__Open(SEXP stream_sexp, SEXP schema_sexp, SEXP use_legacy_format_sexp, SEXP metadata_version_sexp){ +extern "C" SEXP _arrow_ipc___RecordBatchFileWriter__Open(SEXP stream_sexp, SEXP schema_sexp, SEXP use_legacy_format_sexp, SEXP metadata_version_sexp){ Rf_error("Cannot call ipc___RecordBatchFileWriter__Open(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5288,17 +5274,17 @@ RcppExport SEXP _arrow_ipc___RecordBatchFileWriter__Open(SEXP stream_sexp, SEXP // recordbatchwriter.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr ipc___RecordBatchStreamWriter__Open(const std::shared_ptr& stream, const std::shared_ptr& schema, bool use_legacy_format, arrow::ipc::MetadataVersion metadata_version); -RcppExport SEXP _arrow_ipc___RecordBatchStreamWriter__Open(SEXP stream_sexp, SEXP schema_sexp, SEXP use_legacy_format_sexp, SEXP metadata_version_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type stream(stream_sexp); - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - Rcpp::traits::input_parameter::type use_legacy_format(use_legacy_format_sexp); - Rcpp::traits::input_parameter::type metadata_version(metadata_version_sexp); - return Rcpp::wrap(ipc___RecordBatchStreamWriter__Open(stream, schema, use_legacy_format, metadata_version)); -END_RCPP +extern "C" SEXP _arrow_ipc___RecordBatchStreamWriter__Open(SEXP stream_sexp, SEXP schema_sexp, SEXP use_legacy_format_sexp, SEXP metadata_version_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type stream(stream_sexp); + arrow::r::Input&>::type schema(schema_sexp); + arrow::r::Input::type use_legacy_format(use_legacy_format_sexp); + arrow::r::Input::type metadata_version(metadata_version_sexp); + return cpp11::as_sexp(ipc___RecordBatchStreamWriter__Open(stream, schema, use_legacy_format, metadata_version)); +END_CPP11 } #else -RcppExport SEXP _arrow_ipc___RecordBatchStreamWriter__Open(SEXP stream_sexp, SEXP schema_sexp, SEXP use_legacy_format_sexp, SEXP metadata_version_sexp){ +extern "C" SEXP _arrow_ipc___RecordBatchStreamWriter__Open(SEXP stream_sexp, SEXP schema_sexp, SEXP use_legacy_format_sexp, SEXP metadata_version_sexp){ Rf_error("Cannot call ipc___RecordBatchStreamWriter__Open(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5306,15 +5292,15 @@ RcppExport SEXP _arrow_ipc___RecordBatchStreamWriter__Open(SEXP stream_sexp, SEX // scalar.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Array__GetScalar(const std::shared_ptr& x, int64_t i); -RcppExport SEXP _arrow_Array__GetScalar(SEXP x_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(Array__GetScalar(x, i)); -END_RCPP +extern "C" SEXP _arrow_Array__GetScalar(SEXP x_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(Array__GetScalar(x, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_Array__GetScalar(SEXP x_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_Array__GetScalar(SEXP x_sexp, SEXP i_sexp){ Rf_error("Cannot call Array__GetScalar(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5322,14 +5308,14 @@ RcppExport SEXP _arrow_Array__GetScalar(SEXP x_sexp, SEXP i_sexp){ // scalar.cpp #if defined(ARROW_R_WITH_ARROW) std::string Scalar__ToString(const std::shared_ptr& s); -RcppExport SEXP _arrow_Scalar__ToString(SEXP s_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type s(s_sexp); - return Rcpp::wrap(Scalar__ToString(s)); -END_RCPP +extern "C" SEXP _arrow_Scalar__ToString(SEXP s_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type s(s_sexp); + return cpp11::as_sexp(Scalar__ToString(s)); +END_CPP11 } #else -RcppExport SEXP _arrow_Scalar__ToString(SEXP s_sexp){ +extern "C" SEXP _arrow_Scalar__ToString(SEXP s_sexp){ Rf_error("Cannot call Scalar__ToString(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5337,15 +5323,15 @@ RcppExport SEXP _arrow_Scalar__ToString(SEXP s_sexp){ // scalar.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Scalar__CastTo(const std::shared_ptr& s, const std::shared_ptr& t); -RcppExport SEXP _arrow_Scalar__CastTo(SEXP s_sexp, SEXP t_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type s(s_sexp); - Rcpp::traits::input_parameter&>::type t(t_sexp); - return Rcpp::wrap(Scalar__CastTo(s, t)); -END_RCPP +extern "C" SEXP _arrow_Scalar__CastTo(SEXP s_sexp, SEXP t_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type s(s_sexp); + arrow::r::Input&>::type t(t_sexp); + return cpp11::as_sexp(Scalar__CastTo(s, t)); +END_CPP11 } #else -RcppExport SEXP _arrow_Scalar__CastTo(SEXP s_sexp, SEXP t_sexp){ +extern "C" SEXP _arrow_Scalar__CastTo(SEXP s_sexp, SEXP t_sexp){ Rf_error("Cannot call Scalar__CastTo(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5353,15 +5339,15 @@ RcppExport SEXP _arrow_Scalar__CastTo(SEXP s_sexp, SEXP t_sexp){ // scalar.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr StructScalar__field(const std::shared_ptr& s, int i); -RcppExport SEXP _arrow_StructScalar__field(SEXP s_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type s(s_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(StructScalar__field(s, i)); -END_RCPP +extern "C" SEXP _arrow_StructScalar__field(SEXP s_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type s(s_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(StructScalar__field(s, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_StructScalar__field(SEXP s_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_StructScalar__field(SEXP s_sexp, SEXP i_sexp){ Rf_error("Cannot call StructScalar__field(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5369,15 +5355,15 @@ RcppExport SEXP _arrow_StructScalar__field(SEXP s_sexp, SEXP i_sexp){ // scalar.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr StructScalar__GetFieldByName(const std::shared_ptr& s, const std::string& name); -RcppExport SEXP _arrow_StructScalar__GetFieldByName(SEXP s_sexp, SEXP name_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type s(s_sexp); - Rcpp::traits::input_parameter::type name(name_sexp); - return Rcpp::wrap(StructScalar__GetFieldByName(s, name)); -END_RCPP +extern "C" SEXP _arrow_StructScalar__GetFieldByName(SEXP s_sexp, SEXP name_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type s(s_sexp); + arrow::r::Input::type name(name_sexp); + return cpp11::as_sexp(StructScalar__GetFieldByName(s, name)); +END_CPP11 } #else -RcppExport SEXP _arrow_StructScalar__GetFieldByName(SEXP s_sexp, SEXP name_sexp){ +extern "C" SEXP _arrow_StructScalar__GetFieldByName(SEXP s_sexp, SEXP name_sexp){ Rf_error("Cannot call StructScalar__GetFieldByName(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5385,14 +5371,14 @@ RcppExport SEXP _arrow_StructScalar__GetFieldByName(SEXP s_sexp, SEXP name_sexp) // scalar.cpp #if defined(ARROW_R_WITH_ARROW) SEXP Scalar__as_vector(const std::shared_ptr& scalar); -RcppExport SEXP _arrow_Scalar__as_vector(SEXP scalar_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type scalar(scalar_sexp); - return Rcpp::wrap(Scalar__as_vector(scalar)); -END_RCPP +extern "C" SEXP _arrow_Scalar__as_vector(SEXP scalar_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type scalar(scalar_sexp); + return cpp11::as_sexp(Scalar__as_vector(scalar)); +END_CPP11 } #else -RcppExport SEXP _arrow_Scalar__as_vector(SEXP scalar_sexp){ +extern "C" SEXP _arrow_Scalar__as_vector(SEXP scalar_sexp){ Rf_error("Cannot call Scalar__as_vector(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5400,14 +5386,14 @@ RcppExport SEXP _arrow_Scalar__as_vector(SEXP scalar_sexp){ // scalar.cpp #if defined(ARROW_R_WITH_ARROW) bool Scalar__is_valid(const std::shared_ptr& s); -RcppExport SEXP _arrow_Scalar__is_valid(SEXP s_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type s(s_sexp); - return Rcpp::wrap(Scalar__is_valid(s)); -END_RCPP +extern "C" SEXP _arrow_Scalar__is_valid(SEXP s_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type s(s_sexp); + return cpp11::as_sexp(Scalar__is_valid(s)); +END_CPP11 } #else -RcppExport SEXP _arrow_Scalar__is_valid(SEXP s_sexp){ +extern "C" SEXP _arrow_Scalar__is_valid(SEXP s_sexp){ Rf_error("Cannot call Scalar__is_valid(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5415,29 +5401,29 @@ RcppExport SEXP _arrow_Scalar__is_valid(SEXP s_sexp){ // scalar.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Scalar__type(const std::shared_ptr& s); -RcppExport SEXP _arrow_Scalar__type(SEXP s_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type s(s_sexp); - return Rcpp::wrap(Scalar__type(s)); -END_RCPP +extern "C" SEXP _arrow_Scalar__type(SEXP s_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type s(s_sexp); + return cpp11::as_sexp(Scalar__type(s)); +END_CPP11 } #else -RcppExport SEXP _arrow_Scalar__type(SEXP s_sexp){ +extern "C" SEXP _arrow_Scalar__type(SEXP s_sexp){ Rf_error("Cannot call Scalar__type(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // schema.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr schema_(Rcpp::List fields); -RcppExport SEXP _arrow_schema_(SEXP fields_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type fields(fields_sexp); - return Rcpp::wrap(schema_(fields)); -END_RCPP +std::shared_ptr schema_(const std::vector>& fields); +extern "C" SEXP _arrow_schema_(SEXP fields_sexp){ +BEGIN_CPP11 + arrow::r::Input>&>::type fields(fields_sexp); + return cpp11::as_sexp(schema_(fields)); +END_CPP11 } #else -RcppExport SEXP _arrow_schema_(SEXP fields_sexp){ +extern "C" SEXP _arrow_schema_(SEXP fields_sexp){ Rf_error("Cannot call schema_(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5445,14 +5431,14 @@ RcppExport SEXP _arrow_schema_(SEXP fields_sexp){ // schema.cpp #if defined(ARROW_R_WITH_ARROW) std::string Schema__ToString(const std::shared_ptr& s); -RcppExport SEXP _arrow_Schema__ToString(SEXP s_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type s(s_sexp); - return Rcpp::wrap(Schema__ToString(s)); -END_RCPP +extern "C" SEXP _arrow_Schema__ToString(SEXP s_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type s(s_sexp); + return cpp11::as_sexp(Schema__ToString(s)); +END_CPP11 } #else -RcppExport SEXP _arrow_Schema__ToString(SEXP s_sexp){ +extern "C" SEXP _arrow_Schema__ToString(SEXP s_sexp){ Rf_error("Cannot call Schema__ToString(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5460,14 +5446,14 @@ RcppExport SEXP _arrow_Schema__ToString(SEXP s_sexp){ // schema.cpp #if defined(ARROW_R_WITH_ARROW) int Schema__num_fields(const std::shared_ptr& s); -RcppExport SEXP _arrow_Schema__num_fields(SEXP s_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type s(s_sexp); - return Rcpp::wrap(Schema__num_fields(s)); -END_RCPP +extern "C" SEXP _arrow_Schema__num_fields(SEXP s_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type s(s_sexp); + return cpp11::as_sexp(Schema__num_fields(s)); +END_CPP11 } #else -RcppExport SEXP _arrow_Schema__num_fields(SEXP s_sexp){ +extern "C" SEXP _arrow_Schema__num_fields(SEXP s_sexp){ Rf_error("Cannot call Schema__num_fields(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5475,15 +5461,15 @@ RcppExport SEXP _arrow_Schema__num_fields(SEXP s_sexp){ // schema.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Schema__field(const std::shared_ptr& s, int i); -RcppExport SEXP _arrow_Schema__field(SEXP s_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type s(s_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(Schema__field(s, i)); -END_RCPP +extern "C" SEXP _arrow_Schema__field(SEXP s_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type s(s_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(Schema__field(s, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_Schema__field(SEXP s_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_Schema__field(SEXP s_sexp, SEXP i_sexp){ Rf_error("Cannot call Schema__field(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5491,15 +5477,15 @@ RcppExport SEXP _arrow_Schema__field(SEXP s_sexp, SEXP i_sexp){ // schema.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Schema__GetFieldByName(const std::shared_ptr& s, std::string x); -RcppExport SEXP _arrow_Schema__GetFieldByName(SEXP s_sexp, SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type s(s_sexp); - Rcpp::traits::input_parameter::type x(x_sexp); - return Rcpp::wrap(Schema__GetFieldByName(s, x)); -END_RCPP +extern "C" SEXP _arrow_Schema__GetFieldByName(SEXP s_sexp, SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type s(s_sexp); + arrow::r::Input::type x(x_sexp); + return cpp11::as_sexp(Schema__GetFieldByName(s, x)); +END_CPP11 } #else -RcppExport SEXP _arrow_Schema__GetFieldByName(SEXP s_sexp, SEXP x_sexp){ +extern "C" SEXP _arrow_Schema__GetFieldByName(SEXP s_sexp, SEXP x_sexp){ Rf_error("Cannot call Schema__GetFieldByName(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5507,14 +5493,14 @@ RcppExport SEXP _arrow_Schema__GetFieldByName(SEXP s_sexp, SEXP x_sexp){ // schema.cpp #if defined(ARROW_R_WITH_ARROW) std::vector> Schema__fields(const std::shared_ptr& schema); -RcppExport SEXP _arrow_Schema__fields(SEXP schema_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - return Rcpp::wrap(Schema__fields(schema)); -END_RCPP +extern "C" SEXP _arrow_Schema__fields(SEXP schema_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type schema(schema_sexp); + return cpp11::as_sexp(Schema__fields(schema)); +END_CPP11 } #else -RcppExport SEXP _arrow_Schema__fields(SEXP schema_sexp){ +extern "C" SEXP _arrow_Schema__fields(SEXP schema_sexp){ Rf_error("Cannot call Schema__fields(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5522,14 +5508,14 @@ RcppExport SEXP _arrow_Schema__fields(SEXP schema_sexp){ // schema.cpp #if defined(ARROW_R_WITH_ARROW) std::vector Schema__field_names(const std::shared_ptr& schema); -RcppExport SEXP _arrow_Schema__field_names(SEXP schema_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - return Rcpp::wrap(Schema__field_names(schema)); -END_RCPP +extern "C" SEXP _arrow_Schema__field_names(SEXP schema_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type schema(schema_sexp); + return cpp11::as_sexp(Schema__field_names(schema)); +END_CPP11 } #else -RcppExport SEXP _arrow_Schema__field_names(SEXP schema_sexp){ +extern "C" SEXP _arrow_Schema__field_names(SEXP schema_sexp){ Rf_error("Cannot call Schema__field_names(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5537,60 +5523,60 @@ RcppExport SEXP _arrow_Schema__field_names(SEXP schema_sexp){ // schema.cpp #if defined(ARROW_R_WITH_ARROW) bool Schema__HasMetadata(const std::shared_ptr& schema); -RcppExport SEXP _arrow_Schema__HasMetadata(SEXP schema_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - return Rcpp::wrap(Schema__HasMetadata(schema)); -END_RCPP +extern "C" SEXP _arrow_Schema__HasMetadata(SEXP schema_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type schema(schema_sexp); + return cpp11::as_sexp(Schema__HasMetadata(schema)); +END_CPP11 } #else -RcppExport SEXP _arrow_Schema__HasMetadata(SEXP schema_sexp){ +extern "C" SEXP _arrow_Schema__HasMetadata(SEXP schema_sexp){ Rf_error("Cannot call Schema__HasMetadata(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // schema.cpp #if defined(ARROW_R_WITH_ARROW) -Rcpp::List Schema__metadata(const std::shared_ptr& schema); -RcppExport SEXP _arrow_Schema__metadata(SEXP schema_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - return Rcpp::wrap(Schema__metadata(schema)); -END_RCPP +cpp11::writable::list Schema__metadata(const std::shared_ptr& schema); +extern "C" SEXP _arrow_Schema__metadata(SEXP schema_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type schema(schema_sexp); + return cpp11::as_sexp(Schema__metadata(schema)); +END_CPP11 } #else -RcppExport SEXP _arrow_Schema__metadata(SEXP schema_sexp){ +extern "C" SEXP _arrow_Schema__metadata(SEXP schema_sexp){ Rf_error("Cannot call Schema__metadata(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // schema.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr Schema__WithMetadata(const std::shared_ptr& schema, Rcpp::CharacterVector metadata); -RcppExport SEXP _arrow_Schema__WithMetadata(SEXP schema_sexp, SEXP metadata_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - Rcpp::traits::input_parameter::type metadata(metadata_sexp); - return Rcpp::wrap(Schema__WithMetadata(schema, metadata)); -END_RCPP +std::shared_ptr Schema__WithMetadata(const std::shared_ptr& schema, cpp11::strings metadata); +extern "C" SEXP _arrow_Schema__WithMetadata(SEXP schema_sexp, SEXP metadata_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type schema(schema_sexp); + arrow::r::Input::type metadata(metadata_sexp); + return cpp11::as_sexp(Schema__WithMetadata(schema, metadata)); +END_CPP11 } #else -RcppExport SEXP _arrow_Schema__WithMetadata(SEXP schema_sexp, SEXP metadata_sexp){ +extern "C" SEXP _arrow_Schema__WithMetadata(SEXP schema_sexp, SEXP metadata_sexp){ Rf_error("Cannot call Schema__WithMetadata(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // schema.cpp #if defined(ARROW_R_WITH_ARROW) -Rcpp::RawVector Schema__serialize(const std::shared_ptr& schema); -RcppExport SEXP _arrow_Schema__serialize(SEXP schema_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - return Rcpp::wrap(Schema__serialize(schema)); -END_RCPP +cpp11::writable::raws Schema__serialize(const std::shared_ptr& schema); +extern "C" SEXP _arrow_Schema__serialize(SEXP schema_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type schema(schema_sexp); + return cpp11::as_sexp(Schema__serialize(schema)); +END_CPP11 } #else -RcppExport SEXP _arrow_Schema__serialize(SEXP schema_sexp){ +extern "C" SEXP _arrow_Schema__serialize(SEXP schema_sexp){ Rf_error("Cannot call Schema__serialize(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5598,16 +5584,16 @@ RcppExport SEXP _arrow_Schema__serialize(SEXP schema_sexp){ // schema.cpp #if defined(ARROW_R_WITH_ARROW) bool Schema__Equals(const std::shared_ptr& schema, const std::shared_ptr& other, bool check_metadata); -RcppExport SEXP _arrow_Schema__Equals(SEXP schema_sexp, SEXP other_sexp, SEXP check_metadata_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type schema(schema_sexp); - Rcpp::traits::input_parameter&>::type other(other_sexp); - Rcpp::traits::input_parameter::type check_metadata(check_metadata_sexp); - return Rcpp::wrap(Schema__Equals(schema, other, check_metadata)); -END_RCPP +extern "C" SEXP _arrow_Schema__Equals(SEXP schema_sexp, SEXP other_sexp, SEXP check_metadata_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type schema(schema_sexp); + arrow::r::Input&>::type other(other_sexp); + arrow::r::Input::type check_metadata(check_metadata_sexp); + return cpp11::as_sexp(Schema__Equals(schema, other, check_metadata)); +END_CPP11 } #else -RcppExport SEXP _arrow_Schema__Equals(SEXP schema_sexp, SEXP other_sexp, SEXP check_metadata_sexp){ +extern "C" SEXP _arrow_Schema__Equals(SEXP schema_sexp, SEXP other_sexp, SEXP check_metadata_sexp){ Rf_error("Cannot call Schema__Equals(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5615,44 +5601,29 @@ RcppExport SEXP _arrow_Schema__Equals(SEXP schema_sexp, SEXP other_sexp, SEXP ch // schema.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr arrow__UnifySchemas(const std::vector>& schemas); -RcppExport SEXP _arrow_arrow__UnifySchemas(SEXP schemas_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter>&>::type schemas(schemas_sexp); - return Rcpp::wrap(arrow__UnifySchemas(schemas)); -END_RCPP +extern "C" SEXP _arrow_arrow__UnifySchemas(SEXP schemas_sexp){ +BEGIN_CPP11 + arrow::r::Input>&>::type schemas(schemas_sexp); + return cpp11::as_sexp(arrow__UnifySchemas(schemas)); +END_CPP11 } #else -RcppExport SEXP _arrow_arrow__UnifySchemas(SEXP schemas_sexp){ +extern "C" SEXP _arrow_arrow__UnifySchemas(SEXP schemas_sexp){ Rf_error("Cannot call arrow__UnifySchemas(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif -// table.cpp -#if defined(ARROW_R_WITH_ARROW) -std::shared_ptr Table__from_dataframe(DataFrame tbl); -RcppExport SEXP _arrow_Table__from_dataframe(SEXP tbl_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type tbl(tbl_sexp); - return Rcpp::wrap(Table__from_dataframe(tbl)); -END_RCPP -} -#else -RcppExport SEXP _arrow_Table__from_dataframe(SEXP tbl_sexp){ - Rf_error("Cannot call Table__from_dataframe(). Please use arrow::install_arrow() to install required runtime libraries. "); -} -#endif - // table.cpp #if defined(ARROW_R_WITH_ARROW) int Table__num_columns(const std::shared_ptr& x); -RcppExport SEXP _arrow_Table__num_columns(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(Table__num_columns(x)); -END_RCPP +extern "C" SEXP _arrow_Table__num_columns(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(Table__num_columns(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__num_columns(SEXP x_sexp){ +extern "C" SEXP _arrow_Table__num_columns(SEXP x_sexp){ Rf_error("Cannot call Table__num_columns(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5660,14 +5631,14 @@ RcppExport SEXP _arrow_Table__num_columns(SEXP x_sexp){ // table.cpp #if defined(ARROW_R_WITH_ARROW) int Table__num_rows(const std::shared_ptr& x); -RcppExport SEXP _arrow_Table__num_rows(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(Table__num_rows(x)); -END_RCPP +extern "C" SEXP _arrow_Table__num_rows(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(Table__num_rows(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__num_rows(SEXP x_sexp){ +extern "C" SEXP _arrow_Table__num_rows(SEXP x_sexp){ Rf_error("Cannot call Table__num_rows(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5675,62 +5646,62 @@ RcppExport SEXP _arrow_Table__num_rows(SEXP x_sexp){ // table.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Table__schema(const std::shared_ptr& x); -RcppExport SEXP _arrow_Table__schema(SEXP x_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - return Rcpp::wrap(Table__schema(x)); -END_RCPP +extern "C" SEXP _arrow_Table__schema(SEXP x_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + return cpp11::as_sexp(Table__schema(x)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__schema(SEXP x_sexp){ +extern "C" SEXP _arrow_Table__schema(SEXP x_sexp){ Rf_error("Cannot call Table__schema(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // table.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr Table__ReplaceSchemaMetadata(const std::shared_ptr& x, Rcpp::CharacterVector metadata); -RcppExport SEXP _arrow_Table__ReplaceSchemaMetadata(SEXP x_sexp, SEXP metadata_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type x(x_sexp); - Rcpp::traits::input_parameter::type metadata(metadata_sexp); - return Rcpp::wrap(Table__ReplaceSchemaMetadata(x, metadata)); -END_RCPP +std::shared_ptr Table__ReplaceSchemaMetadata(const std::shared_ptr& x, cpp11::strings metadata); +extern "C" SEXP _arrow_Table__ReplaceSchemaMetadata(SEXP x_sexp, SEXP metadata_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type x(x_sexp); + arrow::r::Input::type metadata(metadata_sexp); + return cpp11::as_sexp(Table__ReplaceSchemaMetadata(x, metadata)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__ReplaceSchemaMetadata(SEXP x_sexp, SEXP metadata_sexp){ +extern "C" SEXP _arrow_Table__ReplaceSchemaMetadata(SEXP x_sexp, SEXP metadata_sexp){ Rf_error("Cannot call Table__ReplaceSchemaMetadata(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // table.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr Table__column(const std::shared_ptr& table, int i); -RcppExport SEXP _arrow_Table__column(SEXP table_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(Table__column(table, i)); -END_RCPP +std::shared_ptr Table__column(const std::shared_ptr& table, R_xlen_t i); +extern "C" SEXP _arrow_Table__column(SEXP table_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(Table__column(table, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__column(SEXP table_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_Table__column(SEXP table_sexp, SEXP i_sexp){ Rf_error("Cannot call Table__column(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // table.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr Table__field(const std::shared_ptr& table, int i); -RcppExport SEXP _arrow_Table__field(SEXP table_sexp, SEXP i_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - Rcpp::traits::input_parameter::type i(i_sexp); - return Rcpp::wrap(Table__field(table, i)); -END_RCPP +std::shared_ptr Table__field(const std::shared_ptr& table, R_xlen_t i); +extern "C" SEXP _arrow_Table__field(SEXP table_sexp, SEXP i_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + arrow::r::Input::type i(i_sexp); + return cpp11::as_sexp(Table__field(table, i)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__field(SEXP table_sexp, SEXP i_sexp){ +extern "C" SEXP _arrow_Table__field(SEXP table_sexp, SEXP i_sexp){ Rf_error("Cannot call Table__field(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5738,14 +5709,14 @@ RcppExport SEXP _arrow_Table__field(SEXP table_sexp, SEXP i_sexp){ // table.cpp #if defined(ARROW_R_WITH_ARROW) std::vector> Table__columns(const std::shared_ptr& table); -RcppExport SEXP _arrow_Table__columns(SEXP table_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - return Rcpp::wrap(Table__columns(table)); -END_RCPP +extern "C" SEXP _arrow_Table__columns(SEXP table_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + return cpp11::as_sexp(Table__columns(table)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__columns(SEXP table_sexp){ +extern "C" SEXP _arrow_Table__columns(SEXP table_sexp){ Rf_error("Cannot call Table__columns(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5753,47 +5724,47 @@ RcppExport SEXP _arrow_Table__columns(SEXP table_sexp){ // table.cpp #if defined(ARROW_R_WITH_ARROW) std::vector Table__ColumnNames(const std::shared_ptr& table); -RcppExport SEXP _arrow_Table__ColumnNames(SEXP table_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - return Rcpp::wrap(Table__ColumnNames(table)); -END_RCPP +extern "C" SEXP _arrow_Table__ColumnNames(SEXP table_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + return cpp11::as_sexp(Table__ColumnNames(table)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__ColumnNames(SEXP table_sexp){ +extern "C" SEXP _arrow_Table__ColumnNames(SEXP table_sexp){ Rf_error("Cannot call Table__ColumnNames(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // table.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr Table__Slice1(const std::shared_ptr& table, int offset); -RcppExport SEXP _arrow_Table__Slice1(SEXP table_sexp, SEXP offset_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - Rcpp::traits::input_parameter::type offset(offset_sexp); - return Rcpp::wrap(Table__Slice1(table, offset)); -END_RCPP +std::shared_ptr Table__Slice1(const std::shared_ptr& table, R_xlen_t offset); +extern "C" SEXP _arrow_Table__Slice1(SEXP table_sexp, SEXP offset_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + arrow::r::Input::type offset(offset_sexp); + return cpp11::as_sexp(Table__Slice1(table, offset)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__Slice1(SEXP table_sexp, SEXP offset_sexp){ +extern "C" SEXP _arrow_Table__Slice1(SEXP table_sexp, SEXP offset_sexp){ Rf_error("Cannot call Table__Slice1(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // table.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr Table__Slice2(const std::shared_ptr& table, int offset, int length); -RcppExport SEXP _arrow_Table__Slice2(SEXP table_sexp, SEXP offset_sexp, SEXP length_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - Rcpp::traits::input_parameter::type offset(offset_sexp); - Rcpp::traits::input_parameter::type length(length_sexp); - return Rcpp::wrap(Table__Slice2(table, offset, length)); -END_RCPP +std::shared_ptr Table__Slice2(const std::shared_ptr& table, R_xlen_t offset, R_xlen_t length); +extern "C" SEXP _arrow_Table__Slice2(SEXP table_sexp, SEXP offset_sexp, SEXP length_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + arrow::r::Input::type offset(offset_sexp); + arrow::r::Input::type length(length_sexp); + return cpp11::as_sexp(Table__Slice2(table, offset, length)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__Slice2(SEXP table_sexp, SEXP offset_sexp, SEXP length_sexp){ +extern "C" SEXP _arrow_Table__Slice2(SEXP table_sexp, SEXP offset_sexp, SEXP length_sexp){ Rf_error("Cannot call Table__Slice2(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5801,16 +5772,16 @@ RcppExport SEXP _arrow_Table__Slice2(SEXP table_sexp, SEXP offset_sexp, SEXP len // table.cpp #if defined(ARROW_R_WITH_ARROW) bool Table__Equals(const std::shared_ptr& lhs, const std::shared_ptr& rhs, bool check_metadata); -RcppExport SEXP _arrow_Table__Equals(SEXP lhs_sexp, SEXP rhs_sexp, SEXP check_metadata_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type lhs(lhs_sexp); - Rcpp::traits::input_parameter&>::type rhs(rhs_sexp); - Rcpp::traits::input_parameter::type check_metadata(check_metadata_sexp); - return Rcpp::wrap(Table__Equals(lhs, rhs, check_metadata)); -END_RCPP +extern "C" SEXP _arrow_Table__Equals(SEXP lhs_sexp, SEXP rhs_sexp, SEXP check_metadata_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type lhs(lhs_sexp); + arrow::r::Input&>::type rhs(rhs_sexp); + arrow::r::Input::type check_metadata(check_metadata_sexp); + return cpp11::as_sexp(Table__Equals(lhs, rhs, check_metadata)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__Equals(SEXP lhs_sexp, SEXP rhs_sexp, SEXP check_metadata_sexp){ +extern "C" SEXP _arrow_Table__Equals(SEXP lhs_sexp, SEXP rhs_sexp, SEXP check_metadata_sexp){ Rf_error("Cannot call Table__Equals(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5818,14 +5789,14 @@ RcppExport SEXP _arrow_Table__Equals(SEXP lhs_sexp, SEXP rhs_sexp, SEXP check_me // table.cpp #if defined(ARROW_R_WITH_ARROW) bool Table__Validate(const std::shared_ptr& table); -RcppExport SEXP _arrow_Table__Validate(SEXP table_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - return Rcpp::wrap(Table__Validate(table)); -END_RCPP +extern "C" SEXP _arrow_Table__Validate(SEXP table_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + return cpp11::as_sexp(Table__Validate(table)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__Validate(SEXP table_sexp){ +extern "C" SEXP _arrow_Table__Validate(SEXP table_sexp){ Rf_error("Cannot call Table__Validate(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5833,14 +5804,14 @@ RcppExport SEXP _arrow_Table__Validate(SEXP table_sexp){ // table.cpp #if defined(ARROW_R_WITH_ARROW) bool Table__ValidateFull(const std::shared_ptr& table); -RcppExport SEXP _arrow_Table__ValidateFull(SEXP table_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - return Rcpp::wrap(Table__ValidateFull(table)); -END_RCPP +extern "C" SEXP _arrow_Table__ValidateFull(SEXP table_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + return cpp11::as_sexp(Table__ValidateFull(table)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__ValidateFull(SEXP table_sexp){ +extern "C" SEXP _arrow_Table__ValidateFull(SEXP table_sexp){ Rf_error("Cannot call Table__ValidateFull(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5848,47 +5819,78 @@ RcppExport SEXP _arrow_Table__ValidateFull(SEXP table_sexp){ // table.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Table__GetColumnByName(const std::shared_ptr& table, const std::string& name); -RcppExport SEXP _arrow_Table__GetColumnByName(SEXP table_sexp, SEXP name_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - Rcpp::traits::input_parameter::type name(name_sexp); - return Rcpp::wrap(Table__GetColumnByName(table, name)); -END_RCPP +extern "C" SEXP _arrow_Table__GetColumnByName(SEXP table_sexp, SEXP name_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + arrow::r::Input::type name(name_sexp); + return cpp11::as_sexp(Table__GetColumnByName(table, name)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__GetColumnByName(SEXP table_sexp, SEXP name_sexp){ +extern "C" SEXP _arrow_Table__GetColumnByName(SEXP table_sexp, SEXP name_sexp){ Rf_error("Cannot call Table__GetColumnByName(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif // table.cpp #if defined(ARROW_R_WITH_ARROW) -std::shared_ptr Table__select(const std::shared_ptr& table, const Rcpp::IntegerVector& indices); -RcppExport SEXP _arrow_Table__select(SEXP table_sexp, SEXP indices_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter&>::type table(table_sexp); - Rcpp::traits::input_parameter::type indices(indices_sexp); - return Rcpp::wrap(Table__select(table, indices)); -END_RCPP +std::shared_ptr Table__select(const std::shared_ptr& table, cpp11::integers indices); +extern "C" SEXP _arrow_Table__select(SEXP table_sexp, SEXP indices_sexp){ +BEGIN_CPP11 + arrow::r::Input&>::type table(table_sexp); + arrow::r::Input::type indices(indices_sexp); + return cpp11::as_sexp(Table__select(table, indices)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__select(SEXP table_sexp, SEXP indices_sexp){ +extern "C" SEXP _arrow_Table__select(SEXP table_sexp, SEXP indices_sexp){ Rf_error("Cannot call Table__select(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif +// table.cpp +#if defined(ARROW_R_WITH_ARROW) +bool all_record_batches(SEXP lst); +extern "C" SEXP _arrow_all_record_batches(SEXP lst_sexp){ +BEGIN_CPP11 + arrow::r::Input::type lst(lst_sexp); + return cpp11::as_sexp(all_record_batches(lst)); +END_CPP11 +} +#else +extern "C" SEXP _arrow_all_record_batches(SEXP lst_sexp){ + Rf_error("Cannot call all_record_batches(). Please use arrow::install_arrow() to install required runtime libraries. "); +} +#endif + +// table.cpp +#if defined(ARROW_R_WITH_ARROW) +std::shared_ptr Table__from_record_batches(const std::vector>& batches, SEXP schema_sxp); +extern "C" SEXP _arrow_Table__from_record_batches(SEXP batches_sexp, SEXP schema_sxp_sexp){ +BEGIN_CPP11 + arrow::r::Input>&>::type batches(batches_sexp); + arrow::r::Input::type schema_sxp(schema_sxp_sexp); + return cpp11::as_sexp(Table__from_record_batches(batches, schema_sxp)); +END_CPP11 +} +#else +extern "C" SEXP _arrow_Table__from_record_batches(SEXP batches_sexp, SEXP schema_sxp_sexp){ + Rf_error("Cannot call Table__from_record_batches(). Please use arrow::install_arrow() to install required runtime libraries. "); +} +#endif + // table.cpp #if defined(ARROW_R_WITH_ARROW) std::shared_ptr Table__from_dots(SEXP lst, SEXP schema_sxp); -RcppExport SEXP _arrow_Table__from_dots(SEXP lst_sexp, SEXP schema_sxp_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type lst(lst_sexp); - Rcpp::traits::input_parameter::type schema_sxp(schema_sxp_sexp); - return Rcpp::wrap(Table__from_dots(lst, schema_sxp)); -END_RCPP +extern "C" SEXP _arrow_Table__from_dots(SEXP lst_sexp, SEXP schema_sxp_sexp){ +BEGIN_CPP11 + arrow::r::Input::type lst(lst_sexp); + arrow::r::Input::type schema_sxp(schema_sxp_sexp); + return cpp11::as_sexp(Table__from_dots(lst, schema_sxp)); +END_CPP11 } #else -RcppExport SEXP _arrow_Table__from_dots(SEXP lst_sexp, SEXP schema_sxp_sexp){ +extern "C" SEXP _arrow_Table__from_dots(SEXP lst_sexp, SEXP schema_sxp_sexp){ Rf_error("Cannot call Table__from_dots(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5896,13 +5898,13 @@ RcppExport SEXP _arrow_Table__from_dots(SEXP lst_sexp, SEXP schema_sxp_sexp){ // threadpool.cpp #if defined(ARROW_R_WITH_ARROW) int GetCpuThreadPoolCapacity(); -RcppExport SEXP _arrow_GetCpuThreadPoolCapacity(){ -BEGIN_RCPP - return Rcpp::wrap(GetCpuThreadPoolCapacity()); -END_RCPP +extern "C" SEXP _arrow_GetCpuThreadPoolCapacity(){ +BEGIN_CPP11 + return cpp11::as_sexp(GetCpuThreadPoolCapacity()); +END_CPP11 } #else -RcppExport SEXP _arrow_GetCpuThreadPoolCapacity(){ +extern "C" SEXP _arrow_GetCpuThreadPoolCapacity(){ Rf_error("Cannot call GetCpuThreadPoolCapacity(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -5910,15 +5912,15 @@ RcppExport SEXP _arrow_GetCpuThreadPoolCapacity(){ // threadpool.cpp #if defined(ARROW_R_WITH_ARROW) void SetCpuThreadPoolCapacity(int threads); -RcppExport SEXP _arrow_SetCpuThreadPoolCapacity(SEXP threads_sexp){ -BEGIN_RCPP - Rcpp::traits::input_parameter::type threads(threads_sexp); +extern "C" SEXP _arrow_SetCpuThreadPoolCapacity(SEXP threads_sexp){ +BEGIN_CPP11 + arrow::r::Input::type threads(threads_sexp); SetCpuThreadPoolCapacity(threads); return R_NilValue; -END_RCPP +END_CPP11 } #else -RcppExport SEXP _arrow_SetCpuThreadPoolCapacity(SEXP threads_sexp){ +extern "C" SEXP _arrow_SetCpuThreadPoolCapacity(SEXP threads_sexp){ Rf_error("Cannot call SetCpuThreadPoolCapacity(). Please use arrow::install_arrow() to install required runtime libraries. "); } #endif @@ -6091,7 +6093,7 @@ static const R_CallMethodDef CallEntries[] = { { "_arrow_list__", (DL_FUNC) &_arrow_list__, 1}, { "_arrow_large_list__", (DL_FUNC) &_arrow_large_list__, 1}, { "_arrow_fixed_size_list__", (DL_FUNC) &_arrow_fixed_size_list__, 2}, - { "_arrow_struct_", (DL_FUNC) &_arrow_struct_, 1}, + { "_arrow_struct__", (DL_FUNC) &_arrow_struct__, 1}, { "_arrow_DataType__ToString", (DL_FUNC) &_arrow_DataType__ToString, 1}, { "_arrow_DataType__name", (DL_FUNC) &_arrow_DataType__name, 1}, { "_arrow_DataType__Equals", (DL_FUNC) &_arrow_DataType__Equals, 2}, @@ -6200,7 +6202,7 @@ static const R_CallMethodDef CallEntries[] = { { "_arrow_io___BufferOutputStream__Finish", (DL_FUNC) &_arrow_io___BufferOutputStream__Finish, 1}, { "_arrow_io___BufferOutputStream__Tell", (DL_FUNC) &_arrow_io___BufferOutputStream__Tell, 1}, { "_arrow_io___BufferOutputStream__Write", (DL_FUNC) &_arrow_io___BufferOutputStream__Write, 2}, - { "_arrow_json___ReadOptions__initialize", (DL_FUNC) &_arrow_json___ReadOptions__initialize, 1}, + { "_arrow_json___ReadOptions__initialize", (DL_FUNC) &_arrow_json___ReadOptions__initialize, 2}, { "_arrow_json___ParseOptions__initialize", (DL_FUNC) &_arrow_json___ParseOptions__initialize, 1}, { "_arrow_json___TableReader__Make", (DL_FUNC) &_arrow_json___TableReader__Make, 3}, { "_arrow_json___TableReader__Read", (DL_FUNC) &_arrow_json___TableReader__Read, 1}, @@ -6260,7 +6262,6 @@ static const R_CallMethodDef CallEntries[] = { { "_arrow_RecordBatch__column", (DL_FUNC) &_arrow_RecordBatch__column, 2}, { "_arrow_RecordBatch__GetColumnByName", (DL_FUNC) &_arrow_RecordBatch__GetColumnByName, 2}, { "_arrow_RecordBatch__select", (DL_FUNC) &_arrow_RecordBatch__select, 2}, - { "_arrow_RecordBatch__from_dataframe", (DL_FUNC) &_arrow_RecordBatch__from_dataframe, 1}, { "_arrow_RecordBatch__Equals", (DL_FUNC) &_arrow_RecordBatch__Equals, 3}, { "_arrow_RecordBatch__RemoveColumn", (DL_FUNC) &_arrow_RecordBatch__RemoveColumn, 2}, { "_arrow_RecordBatch__column_name", (DL_FUNC) &_arrow_RecordBatch__column_name, 2}, @@ -6307,7 +6308,6 @@ static const R_CallMethodDef CallEntries[] = { { "_arrow_Schema__serialize", (DL_FUNC) &_arrow_Schema__serialize, 1}, { "_arrow_Schema__Equals", (DL_FUNC) &_arrow_Schema__Equals, 3}, { "_arrow_arrow__UnifySchemas", (DL_FUNC) &_arrow_arrow__UnifySchemas, 1}, - { "_arrow_Table__from_dataframe", (DL_FUNC) &_arrow_Table__from_dataframe, 1}, { "_arrow_Table__num_columns", (DL_FUNC) &_arrow_Table__num_columns, 1}, { "_arrow_Table__num_rows", (DL_FUNC) &_arrow_Table__num_rows, 1}, { "_arrow_Table__schema", (DL_FUNC) &_arrow_Table__schema, 1}, @@ -6323,13 +6323,15 @@ static const R_CallMethodDef CallEntries[] = { { "_arrow_Table__ValidateFull", (DL_FUNC) &_arrow_Table__ValidateFull, 1}, { "_arrow_Table__GetColumnByName", (DL_FUNC) &_arrow_Table__GetColumnByName, 2}, { "_arrow_Table__select", (DL_FUNC) &_arrow_Table__select, 2}, + { "_arrow_all_record_batches", (DL_FUNC) &_arrow_all_record_batches, 1}, + { "_arrow_Table__from_record_batches", (DL_FUNC) &_arrow_Table__from_record_batches, 2}, { "_arrow_Table__from_dots", (DL_FUNC) &_arrow_Table__from_dots, 2}, { "_arrow_GetCpuThreadPoolCapacity", (DL_FUNC) &_arrow_GetCpuThreadPoolCapacity, 0}, { "_arrow_SetCpuThreadPoolCapacity", (DL_FUNC) &_arrow_SetCpuThreadPoolCapacity, 1}, {NULL, NULL, 0} }; -RcppExport void R_init_arrow(DllInfo* dll){ +extern "C" void R_init_arrow(DllInfo* dll){ R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); R_useDynamicSymbols(dll, FALSE); } diff --git a/r/src/arrow_cpp11.h b/r/src/arrow_cpp11.h new file mode 100644 index 00000000000..a59003229b9 --- /dev/null +++ b/r/src/arrow_cpp11.h @@ -0,0 +1,312 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include // for strlen +#include +#include +#include +#include +#undef Free + +namespace cpp11 { + +template +SEXP as_sexp(const std::shared_ptr& ptr); + +template +SEXP as_sexp(const std::vector>& vec); + +} // namespace cpp11 + +// TODO: move this include up once we can resolve this issue in cpp11 +// https://github.com/apache/arrow/pull/7819#discussion_r471664878 +#include + +// borrowed from enc package +// because R does not make these macros available (i.e. from Defn.h) +#define UTF8_MASK (1 << 3) +#define ASCII_MASK (1 << 6) + +#define IS_ASCII(x) (LEVELS(x) & ASCII_MASK) +#define IS_UTF8(x) (LEVELS(x) & UTF8_MASK) + +namespace arrow { +namespace r { + +template +struct Pointer { + Pointer() : ptr_(new T()) {} + explicit Pointer(SEXP x) + : ptr_(reinterpret_cast(static_cast(REAL(x)[0]))) {} + + inline operator SEXP() const { + return Rf_ScalarReal(static_cast(reinterpret_cast(ptr_))); + } + + inline operator T*() const { return ptr_; } + + inline void finalize() { delete ptr_; } + + T* ptr_; +}; + +// until cpp11 has a similar class +class complexs { + public: + using value_type = Rcomplex; + + explicit complexs(SEXP x) : data_(x) {} + + inline R_xlen_t size() const { return XLENGTH(data_); } + + inline operator SEXP() const { return data_; } + + private: + cpp11::sexp data_; +}; + +// functions that need to be called from an unwind_protect() +namespace unsafe { + +inline const char* utf8_string(SEXP s) { + if (!IS_UTF8(s) && !IS_ASCII(s)) { + return Rf_translateCharUTF8(s); + } else { + return CHAR(s); + } +} + +inline R_xlen_t r_string_size(SEXP s) { + if (s == NA_STRING) { + return 0; + } else if (IS_ASCII(s) || IS_UTF8(s)) { + return XLENGTH(s); + } else { + return strlen(Rf_translateCharUTF8(s)); + } +} + +} // namespace unsafe + +inline SEXP utf8_strings(SEXP x) { + return cpp11::unwind_protect([x] { + R_xlen_t n = XLENGTH(x); + for (R_xlen_t i = 0; i < n; i++) { + SEXP s = STRING_ELT(x, i); + if (s != NA_STRING && !IS_UTF8(s) && !IS_ASCII(s)) { + SET_STRING_ELT(x, i, Rf_mkCharCE(Rf_translateCharUTF8(s), CE_UTF8)); + } + } + return x; + }); +} + +struct symbols { + static SEXP units; + static SEXP tzone; + static SEXP xp; + static SEXP dot_Internal; + static SEXP inspect; + static SEXP row_names; + static SEXP serialize_arrow_r_metadata; + static SEXP as_list; + static SEXP ptype; + static SEXP byte_width; + static SEXP list_size; +}; + +struct data { + static SEXP classes_POSIXct; + static SEXP classes_metadata_r; + static SEXP classes_vctrs_list_of; + static SEXP classes_tbl_df; + + static SEXP classes_arrow_binary; + static SEXP classes_arrow_large_binary; + static SEXP classes_arrow_fixed_size_binary; + + static SEXP classes_arrow_list; + static SEXP classes_arrow_large_list; + static SEXP classes_arrow_fixed_size_list; + + static SEXP classes_factor; + static SEXP classes_ordered; + + static SEXP names_metadata; + static SEXP empty_raw; +}; + +struct ns { + static SEXP arrow; +}; + +template +Pointer r6_to_pointer(SEXP self) { + return reinterpret_cast( + R_ExternalPtrAddr(Rf_findVarInFrame(self, arrow::r::symbols::xp))); +} + +// T is either std::shared_ptr or std::unique_ptr +// e.g. T = std::shared_ptr +template +class ExternalPtrInput { + public: + explicit ExternalPtrInput(SEXP self) : ptr_(r6_to_pointer(self)) {} + + operator const T&() const { return *ptr_; } + + private: + const T* ptr_; +}; + +template +class VectorExternalPtrInput { + public: + explicit VectorExternalPtrInput(SEXP self) : vec_(XLENGTH(self)) { + R_xlen_t i = 0; + for (auto& element : vec_) { + element = *r6_to_pointer(VECTOR_ELT(self, i++)); + } + } + operator const std::vector&() const { return vec_; } + + private: + std::vector vec_; +}; + +template +class DefaultInput { + public: + explicit DefaultInput(SEXP from) : from_(from) {} + + operator T() const { return cpp11::as_cpp(from_); } + + private: + SEXP from_; +}; + +template +class ConstReferenceInput { + public: + explicit ConstReferenceInput(SEXP from) : obj_(cpp11::as_cpp(from)) {} + + using const_reference = const T&; + operator const_reference() const { return obj_; } + + private: + T obj_; +}; + +template +struct Input { + using type = DefaultInput; +}; + +template +struct Input { + using type = ConstReferenceInput::type>; +}; + +template +struct Input&> { + using type = ExternalPtrInput>; +}; + +template +struct Input&> { + using type = ExternalPtrInput>; +}; + +template +struct Input>&> { + using type = VectorExternalPtrInput>; +}; + +template +Rvector to_r_vector(const std::vector>& x, + ToVectorElement&& to_element) { + R_xlen_t n = x.size(); + Rvector out(n); + for (R_xlen_t i = 0; i < n; i++) { + out[i] = to_element(x[i]); + } + return out; +} + +template +cpp11::writable::strings to_r_strings(const std::vector>& x, + ToString&& to_string) { + return to_r_vector(x, std::forward(to_string)); +} + +template +cpp11::writable::list to_r_list(const std::vector>& x) { + auto as_sexp = [](const std::shared_ptr& t) { return cpp11::as_sexp(t); }; + return to_r_vector(x, as_sexp); +} + +template +cpp11::writable::list to_r_list(const std::vector>& x, + ToListElement&& to_element) { + auto as_sexp = [&](const std::shared_ptr& t) { + return cpp11::as_sexp(to_element(t)); + }; + return to_r_vector(x, as_sexp); +} + +inline cpp11::writable::integers short_row_names(int n) { return {NA_INTEGER, -n}; } + +template +std::vector from_r_list(cpp11::list args) { + std::vector vec; + R_xlen_t n = args.size(); + for (R_xlen_t i = 0; i < n; i++) { + vec.push_back(cpp11::as_cpp(args[i])); + } + return vec; +} + +} // namespace r +} // namespace arrow + +namespace cpp11 { + +template +using enable_if_shared_ptr = typename std::enable_if< + std::is_same, T>::value, T>::type; + +template +enable_if_shared_ptr as_cpp(SEXP from) { + return arrow::r::ExternalPtrInput(from); +} + +template +SEXP as_sexp(const std::shared_ptr& ptr) { + return cpp11::external_pointer>(new std::shared_ptr(ptr)); +} + +template +SEXP as_sexp(const std::vector>& vec) { + return arrow::r::to_r_list(vec); +} + +template +enable_if_enum as_sexp(E e) { + return as_sexp(static_cast(e)); +} + +} // namespace cpp11 diff --git a/r/src/arrow_exports.h b/r/src/arrow_exports.h index f568d2a14b9..92d451de795 100644 --- a/r/src/arrow_exports.h +++ b/r/src/arrow_exports.h @@ -19,7 +19,7 @@ #pragma once -#include "./arrow_rcpp.h" +#include "./arrow_cpp11.h" #if defined(ARROW_R_WITH_ARROW) #include @@ -83,15 +83,4 @@ class FileWriter; } // namespace arrow } // namespace parquet -RCPP_EXPOSED_ENUM_NODECL(arrow::Type::type) -RCPP_EXPOSED_ENUM_NODECL(arrow::DateUnit) -RCPP_EXPOSED_ENUM_NODECL(arrow::ipc::MetadataVersion) -RCPP_EXPOSED_ENUM_NODECL(arrow::TimeUnit::type) -RCPP_EXPOSED_ENUM_NODECL(arrow::StatusCode) -RCPP_EXPOSED_ENUM_NODECL(arrow::io::FileMode::type) -RCPP_EXPOSED_ENUM_NODECL(arrow::ipc::MessageType) -RCPP_EXPOSED_ENUM_NODECL(arrow::Compression::type) -RCPP_EXPOSED_ENUM_NODECL(arrow::fs::FileType) -RCPP_EXPOSED_ENUM_NODECL(parquet::ParquetVersion::type) - #endif diff --git a/r/src/arrow_rcpp.h b/r/src/arrow_rcpp.h deleted file mode 100644 index a0a05815c01..00000000000 --- a/r/src/arrow_rcpp.h +++ /dev/null @@ -1,186 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one -// or more contributor license agreements. See the NOTICE file -// distributed with this work for additional information -// regarding copyright ownership. The ASF licenses this file -// to you under the Apache License, Version 2.0 (the -// "License"); you may not use this file except in compliance -// with the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -#include - -#include -#include -#include -#include -#undef Free - -namespace arrow { -namespace r { -struct symbols { - static SEXP units; - static SEXP tzone; - static SEXP xp; - static SEXP dot_Internal; - static SEXP inspect; - static SEXP row_names; - static SEXP serialize_arrow_r_metadata; - static SEXP as_list; - static SEXP ptype; - static SEXP byte_width; - static SEXP list_size; -}; - -struct data { - static SEXP classes_POSIXct; - static SEXP classes_metadata_r; - static SEXP classes_vctrs_list_of; - - static SEXP classes_arrow_binary; - static SEXP classes_arrow_large_binary; - static SEXP classes_arrow_fixed_size_binary; - - static SEXP classes_arrow_list; - static SEXP classes_arrow_large_list; - static SEXP classes_arrow_fixed_size_list; - - static SEXP classes_factor; - static SEXP classes_ordered; - - static SEXP names_metadata; - static SEXP empty_raw; -}; - -struct ns { - static SEXP arrow; -}; - -} // namespace r -} // namespace arrow - -namespace Rcpp { -namespace internal { - -template -Pointer r6_to_smart_pointer(SEXP self) { - return reinterpret_cast( - R_ExternalPtrAddr(Rf_findVarInFrame(self, arrow::r::symbols::xp))); -} - -} // namespace internal - -template -class ConstReferenceSmartPtrInputParameter { - public: - using const_reference = const T&; - - explicit ConstReferenceSmartPtrInputParameter(SEXP self) - : ptr(internal::r6_to_smart_pointer(self)) {} - - inline operator const_reference() { return *ptr; } - - private: - const T* ptr; -}; - -template -class ConstReferenceVectorSmartPtrInputParameter { - public: - using const_reference = const std::vector&; - - explicit ConstReferenceVectorSmartPtrInputParameter(SEXP self) : vec() { - R_xlen_t n = XLENGTH(self); - for (R_xlen_t i = 0; i < n; i++) { - vec.push_back(*internal::r6_to_smart_pointer(VECTOR_ELT(self, i))); - } - } - - inline operator const_reference() { return vec; } - - private: - std::vector vec; -}; - -namespace traits { - -template -struct input_parameter&> { - typedef typename Rcpp::ConstReferenceSmartPtrInputParameter> type; -}; - -template -struct input_parameter&> { - typedef typename Rcpp::ConstReferenceSmartPtrInputParameter> type; -}; - -template -struct input_parameter>&> { - typedef typename Rcpp::ConstReferenceVectorSmartPtrInputParameter> - type; -}; - -struct wrap_type_shared_ptr_tag {}; -struct wrap_type_unique_ptr_tag {}; - -template -struct wrap_type_traits> { - using wrap_category = wrap_type_shared_ptr_tag; -}; - -template -struct wrap_type_traits> { - using wrap_category = wrap_type_unique_ptr_tag; -}; - -} // namespace traits - -namespace internal { - -template -inline SEXP wrap_dispatch(const T& x, Rcpp::traits::wrap_type_shared_ptr_tag); - -template -inline SEXP wrap_dispatch(const T& x, Rcpp::traits::wrap_type_unique_ptr_tag); - -} // namespace internal -} // namespace Rcpp - -#include - -namespace Rcpp { -namespace internal { - -template -inline SEXP wrap_dispatch(const T& x, Rcpp::traits::wrap_type_shared_ptr_tag) { - return Rcpp::XPtr>( - new std::shared_ptr(x)); -} - -template -inline SEXP wrap_dispatch(const T& x, Rcpp::traits::wrap_type_unique_ptr_tag) { - return Rcpp::XPtr>( - new std::unique_ptr(const_cast(x).release())); -} - -} // namespace internal - -} // namespace Rcpp - -namespace Rcpp { -using NumericVector_ = Rcpp::Vector; -using IntegerVector_ = Rcpp::Vector; -using LogicalVector_ = Rcpp::Vector; -using StringVector_ = Rcpp::Vector; -using CharacterVector_ = StringVector_; -using RawVector_ = Rcpp::Vector; -using List_ = Rcpp::Vector; - -} // namespace Rcpp diff --git a/r/src/arrow_types.h b/r/src/arrow_types.h index 7221bf93a04..6e664ff5e5a 100644 --- a/r/src/arrow_types.h +++ b/r/src/arrow_types.h @@ -17,29 +17,14 @@ #pragma once -#include "./arrow_rcpp.h" +#include -template -struct NoDelete { - inline void operator()(T* ptr) {} -}; - -namespace Rcpp { - -template -inline constexpr typename Rcpp::Vector::stored_type default_value() { - return Rcpp::Vector::get_na(); -} -template <> -inline constexpr Rbyte default_value() { - return 0; -} - -} // namespace Rcpp +#include "./arrow_cpp11.h" #if defined(ARROW_R_WITH_ARROW) #include // for RBuffer definition below +#include #include #include @@ -48,19 +33,16 @@ inline constexpr Rbyte default_value() { #include #include -RCPP_EXPOSED_ENUM_NODECL(arrow::StatusCode) - SEXP ChunkedArray__as_vector(const std::shared_ptr& chunked_array); SEXP Array__as_vector(const std::shared_ptr& array); std::shared_ptr Array__from_vector(SEXP x, SEXP type); std::shared_ptr RecordBatch__from_arrays(SEXP, SEXP); -std::shared_ptr RecordBatch__from_dataframe(Rcpp::DataFrame tbl); namespace arrow { static inline void StopIfNotOk(const Status& status) { if (!(status.ok())) { - Rcpp::stop(status.ToString()); + cpp11::stop(status.ToString()); } } @@ -74,68 +56,53 @@ namespace r { std::shared_ptr InferArrowType(SEXP x); -template -inline std::shared_ptr extract(SEXP x) { - return Rcpp::ConstReferenceSmartPtrInputParameter>(x); -} - Status count_fields(SEXP lst, int* out); std::shared_ptr Array__from_vector( SEXP x, const std::shared_ptr& type, bool type_inferred); -template -std::vector> List_to_shared_ptr_vector(SEXP x) { - std::vector> vec; - R_xlen_t n = Rf_xlength(x); - for (R_xlen_t i = 0; i < n; i++) { - Rcpp::ConstReferenceSmartPtrInputParameter> ptr(VECTOR_ELT(x, i)); - vec.push_back(ptr); - } - return vec; -} - void inspect(SEXP obj); // the integer64 sentinel constexpr int64_t NA_INT64 = std::numeric_limits::min(); -template > +template class RBuffer : public MutableBuffer { public: - explicit RBuffer(Vec vec) - : MutableBuffer(reinterpret_cast(vec.begin()), - vec.size() * sizeof(typename Vec::stored_type)), + explicit RBuffer(RVector vec) + : MutableBuffer(reinterpret_cast(DATAPTR(vec)), + vec.size() * sizeof(typename RVector::value_type)), vec_(vec) {} private: // vec_ holds the memory - Vec vec_; + RVector vec_; }; std::shared_ptr InferArrowTypeFromFactor(SEXP); -void validate_slice_offset(int offset, int len); +void validate_slice_offset(R_xlen_t offset, int64_t len); -void validate_slice_length(int length, int available); +void validate_slice_length(R_xlen_t length, int64_t available); void validate_index(int i, int len); template -void TraverseDots(SEXP dots, int num_fields, Lambda lambda) { - SEXP names = Rf_getAttrib(dots, R_NamesSymbol); +void TraverseDots(cpp11::list dots, int num_fields, Lambda lambda) { + cpp11::strings names(dots.attr(R_NamesSymbol)); for (R_xlen_t i = 0, j = 0; j < num_fields; i++) { - SEXP name_i = STRING_ELT(names, i); - SEXP x_i = VECTOR_ELT(dots, i); - - if (LENGTH(name_i) == 0) { - SEXP names_x_i = Rf_getAttrib(x_i, R_NamesSymbol); - for (R_xlen_t k = 0; k < XLENGTH(x_i); k++, j++) { - lambda(j, VECTOR_ELT(x_i, k), STRING_ELT(names_x_i, k)); + auto name_i = names[i]; + + if (name_i.size() == 0) { + cpp11::list x_i = dots[i]; + cpp11::strings names_x_i(x_i.attr(R_NamesSymbol)); + R_xlen_t n_i = x_i.size(); + for (R_xlen_t k = 0; k < n_i; k++, j++) { + lambda(j, x_i[k], names_x_i[k]); } } else { - lambda(j, x_i, name_i); + lambda(j, dots[i], name_i); j++; } } diff --git a/r/src/buffer.cpp b/r/src/buffer.cpp index 09ab39a5f98..2814677343d 100644 --- a/r/src/buffer.cpp +++ b/r/src/buffer.cpp @@ -43,23 +43,23 @@ int64_t Buffer__size(const std::shared_ptr& buffer) { std::shared_ptr r___RBuffer__initialize(SEXP x) { switch (TYPEOF(x)) { case RAWSXP: - return std::make_shared>(x); + return std::make_shared>(x); case REALSXP: - return std::make_shared>(x); + return std::make_shared>(x); case INTSXP: - return std::make_shared>(x); + return std::make_shared>(x); case CPLXSXP: - return std::make_shared>(x); + return std::make_shared>( + arrow::r::complexs(x)); default: - Rcpp::stop( - tfm::format("R object of type %s not supported", Rf_type2char(TYPEOF(x)))); + break; } - return nullptr; + cpp11::stop("R object of type <%s> not supported", Rf_type2char(TYPEOF(x))); } // [[arrow::export]] -Rcpp::RawVector Buffer__data(const std::shared_ptr& buffer) { - return Rcpp::RawVector(buffer->data(), buffer->data() + buffer->size()); +cpp11::writable::raws Buffer__data(const std::shared_ptr& buffer) { + return cpp11::writable::raws(buffer->data(), buffer->data() + buffer->size()); } // [[arrow::export]] diff --git a/r/src/chunkedarray.cpp b/r/src/chunkedarray.cpp index a451739f323..f52f20ee0de 100644 --- a/r/src/chunkedarray.cpp +++ b/r/src/chunkedarray.cpp @@ -17,9 +17,6 @@ #include "./arrow_types.h" -using Rcpp::List; -using Rcpp::wrap; - #if defined(ARROW_R_WITH_ARROW) #include @@ -47,8 +44,9 @@ std::shared_ptr ChunkedArray__chunk( } // [[arrow::export]] -List ChunkedArray__chunks(const std::shared_ptr& chunked_array) { - return wrap(chunked_array->chunks()); +cpp11::list ChunkedArray__chunks( + const std::shared_ptr& chunked_array) { + return cpp11::as_sexp(chunked_array->chunks()); } // [[arrow::export]] @@ -59,14 +57,15 @@ std::shared_ptr ChunkedArray__type( // [[arrow::export]] std::shared_ptr ChunkedArray__Slice1( - const std::shared_ptr& chunked_array, int offset) { + const std::shared_ptr& chunked_array, R_xlen_t offset) { arrow::r::validate_slice_offset(offset, chunked_array->length()); return chunked_array->Slice(offset); } // [[arrow::export]] std::shared_ptr ChunkedArray__Slice2( - const std::shared_ptr& chunked_array, int offset, int length) { + const std::shared_ptr& chunked_array, R_xlen_t offset, + R_xlen_t length) { arrow::r::validate_slice_offset(offset, chunked_array->length()); arrow::r::validate_slice_length(length, chunked_array->length() - offset); return chunked_array->Slice(offset, length); diff --git a/r/src/compression.cpp b/r/src/compression.cpp index 038390b71b4..c406649a74b 100644 --- a/r/src/compression.cpp +++ b/r/src/compression.cpp @@ -21,11 +21,9 @@ #include #include -RCPP_EXPOSED_ENUM_NODECL(arrow::Compression::type) - // [[arrow::export]] std::shared_ptr util___Codec__Create(arrow::Compression::type codec, - int compression_level) { + R_xlen_t compression_level) { return ValueOrStop(arrow::util::Codec::Create(codec, compression_level)); } diff --git a/r/src/compute.cpp b/r/src/compute.cpp index 8d185220dd0..2fced04fcce 100644 --- a/r/src/compute.cpp +++ b/r/src/compute.cpp @@ -23,8 +23,6 @@ #include #include -using Rcpp::List_; - // [[arrow::export]] std::shared_ptr compute___CastOptions__initialize( bool allow_int_overflow, bool allow_time_truncate, bool allow_float_truncate) { @@ -86,13 +84,15 @@ std::shared_ptr Table__cast( template std::shared_ptr MaybeUnbox(const char* class_name, SEXP x) { if (Rf_inherits(x, "ArrowObject") && Rf_inherits(x, class_name)) { - Rcpp::ConstReferenceSmartPtrInputParameter> obj(x); - return static_cast>(obj); + return cpp11::as_cpp>(x); } return nullptr; } -arrow::Datum to_datum(SEXP x) { +namespace cpp11 { + +template <> +arrow::Datum as_cpp(SEXP x) { if (auto array = MaybeUnbox("Array", x)) { return array; } @@ -115,40 +115,44 @@ arrow::Datum to_datum(SEXP x) { // This assumes that R objects have already been converted to Arrow objects; // that seems right but should we do the wrapping here too/instead? - Rcpp::stop("to_datum: Not implemented for type %s", Rf_type2char(TYPEOF(x))); + cpp11::stop("to_datum: Not implemented for type %s", Rf_type2char(TYPEOF(x))); + return arrow::Datum(); } +} // namespace cpp11 SEXP from_datum(arrow::Datum datum) { switch (datum.kind()) { case arrow::Datum::SCALAR: - return Rcpp::wrap(datum.scalar()); + return cpp11::as_sexp(datum.scalar()); case arrow::Datum::ARRAY: - return Rcpp::wrap(datum.make_array()); + return cpp11::as_sexp(datum.make_array()); case arrow::Datum::CHUNKED_ARRAY: - return Rcpp::wrap(datum.chunked_array()); + return cpp11::as_sexp(datum.chunked_array()); case arrow::Datum::RECORD_BATCH: - return Rcpp::wrap(datum.record_batch()); + return cpp11::as_sexp(datum.record_batch()); case arrow::Datum::TABLE: - return Rcpp::wrap(datum.table()); + return cpp11::as_sexp(datum.table()); default: break; } auto str = datum.ToString(); - Rcpp::stop("from_datum: Not implemented for Datum %s", str.c_str()); + cpp11::stop("from_datum: Not implemented for Datum %s", str.c_str()); + return R_NilValue; } std::shared_ptr make_compute_options( - std::string func_name, List_ options) { + std::string func_name, cpp11::list options) { if (func_name == "filter") { using Options = arrow::compute::FilterOptions; auto out = std::make_shared(Options::Defaults()); - if (!Rf_isNull(options["keep_na"]) && options["keep_na"]) { + SEXP keep_na = options["keep_na"]; + if (!Rf_isNull(keep_na) && cpp11::as_cpp(keep_na)) { out->null_selection_behavior = Options::EMIT_NULL; } return out; @@ -163,7 +167,8 @@ std::shared_ptr make_compute_options( if (func_name == "min_max") { using Options = arrow::compute::MinMaxOptions; auto out = std::make_shared(Options::Defaults()); - out->null_handling = options["na.rm"] ? Options::SKIP : Options::OUTPUT_NULL; + out->null_handling = + cpp11::as_cpp(options["na.rm"]) ? Options::SKIP : Options::OUTPUT_NULL; return out; } @@ -171,12 +176,9 @@ std::shared_ptr make_compute_options( } // [[arrow::export]] -SEXP compute__CallFunction(std::string func_name, List_ args, List_ options) { +SEXP compute__CallFunction(std::string func_name, cpp11::list args, cpp11::list options) { auto opts = make_compute_options(func_name, options); - std::vector datum_args; - for (auto arg : args) { - datum_args.push_back(to_datum(arg)); - } + auto datum_args = arrow::r::from_r_list(args); auto out = ValueOrStop(arrow::compute::CallFunction(func_name, datum_args, opts.get())); return from_datum(out); } diff --git a/r/src/csv.cpp b/r/src/csv.cpp index 9275c827c18..ce9c068bd41 100644 --- a/r/src/csv.cpp +++ b/r/src/csv.cpp @@ -17,53 +17,51 @@ #include "./arrow_types.h" -using Rcpp::CharacterVector; -using Rcpp::List_; - #if defined(ARROW_R_WITH_ARROW) #include // [[arrow::export]] -std::shared_ptr csv___ReadOptions__initialize(List_ options) { +std::shared_ptr csv___ReadOptions__initialize( + cpp11::list options) { auto res = std::make_shared(arrow::csv::ReadOptions::Defaults()); - res->use_threads = options["use_threads"]; - res->block_size = options["block_size"]; - res->skip_rows = options["skip_rows"]; - res->column_names = Rcpp::as>(options["column_names"]); - res->autogenerate_column_names = options["autogenerate_column_names"]; + res->use_threads = cpp11::as_cpp(options["use_threads"]); + res->block_size = cpp11::as_cpp(options["block_size"]); + res->skip_rows = cpp11::as_cpp(options["skip_rows"]); + res->column_names = cpp11::as_cpp>(options["column_names"]); + res->autogenerate_column_names = + cpp11::as_cpp(options["autogenerate_column_names"]); return res; } -inline char get_char(CharacterVector x) { return CHAR(STRING_ELT(x, 0))[0]; } - // [[arrow::export]] -std::shared_ptr csv___ParseOptions__initialize(List_ options) { +std::shared_ptr csv___ParseOptions__initialize( + cpp11::list options) { auto res = std::make_shared(arrow::csv::ParseOptions::Defaults()); - res->delimiter = get_char(options["delimiter"]); - res->quoting = options["quoting"]; - res->quote_char = get_char(options["quote_char"]); - res->double_quote = options["double_quote"]; - res->escape_char = get_char(options["escape_char"]); - res->newlines_in_values = options["newlines_in_values"]; - res->ignore_empty_lines = options["ignore_empty_lines"]; + res->delimiter = cpp11::as_cpp(options["delimiter"]); + res->quoting = cpp11::as_cpp(options["quoting"]); + res->quote_char = cpp11::as_cpp(options["quote_char"]); + res->double_quote = cpp11::as_cpp(options["double_quote"]); + res->escape_char = cpp11::as_cpp(options["escape_char"]); + res->newlines_in_values = cpp11::as_cpp(options["newlines_in_values"]); + res->ignore_empty_lines = cpp11::as_cpp(options["ignore_empty_lines"]); return res; } // [[arrow::export]] std::shared_ptr csv___ConvertOptions__initialize( - List_ options) { + cpp11::list options) { auto res = std::make_shared( arrow::csv::ConvertOptions::Defaults()); - res->check_utf8 = options["check_utf8"]; + res->check_utf8 = cpp11::as_cpp(options["check_utf8"]); // Recognized spellings for null values - res->null_values = Rcpp::as>(options["null_values"]); + res->null_values = cpp11::as_cpp>(options["null_values"]); // Whether string / binary columns can have null values. // If true, then strings in "null_values" are considered null for string columns. // If false, then all strings are valid string values. - res->strings_can_be_null = options["strings_can_be_null"]; + res->strings_can_be_null = cpp11::as_cpp(options["strings_can_be_null"]); // TODO: there are more conversion options available: // // Optional per-column types (disabling type inference on those columns) // std::unordered_map> column_types; diff --git a/r/src/dataset.cpp b/r/src/dataset.cpp index 873524397a0..185946b38e1 100644 --- a/r/src/dataset.cpp +++ b/r/src/dataset.cpp @@ -27,9 +27,6 @@ namespace ds = ::arrow::dataset; namespace fs = ::arrow::fs; -using Rcpp::CharacterVector; -using Rcpp::String; - // Dataset, UnionDataset, FileSystemDataset // [[arrow::export]] @@ -163,13 +160,13 @@ std::string dataset___FileFormat__type_name( // [[arrow::export]] std::shared_ptr dataset___ParquetFileFormat__Make( - bool use_buffered_stream, int64_t buffer_size, CharacterVector dict_columns) { + bool use_buffered_stream, int64_t buffer_size, cpp11::strings dict_columns) { auto fmt = std::make_shared(); fmt->reader_options.use_buffered_stream = use_buffered_stream; fmt->reader_options.buffer_size = buffer_size; - auto dict_columns_vector = Rcpp::as>(dict_columns); + auto dict_columns_vector = cpp11::as_cpp>(dict_columns); auto& d = fmt->reader_options.dict_columns; std::move(dict_columns_vector.begin(), dict_columns_vector.end(), std::inserter(d, d.end())); diff --git a/r/src/datatype.cpp b/r/src/datatype.cpp index 3d6d0c9a753..81d2bd40dd7 100644 --- a/r/src/datatype.cpp +++ b/r/src/datatype.cpp @@ -17,18 +17,9 @@ #include "./arrow_types.h" -using Rcpp::CharacterVector; -using Rcpp::List; -using Rcpp::stop; -using Rcpp::wrap; - #if defined(ARROW_R_WITH_ARROW) #include -RCPP_EXPOSED_ENUM_NODECL(arrow::Type::type) -RCPP_EXPOSED_ENUM_NODECL(arrow::DateUnit) -RCPP_EXPOSED_ENUM_NODECL(arrow::TimeUnit::type) - // [[arrow::export]] bool shared_ptr_is_null(SEXP xp) { return reinterpret_cast*>(R_ExternalPtrAddr(xp))->get() == @@ -108,12 +99,12 @@ std::shared_ptr Decimal128Type__initialize(int32_t precision, } // [[arrow::export]] -std::shared_ptr FixedSizeBinary__initialize(int32_t byte_width) { +std::shared_ptr FixedSizeBinary__initialize(R_xlen_t byte_width) { if (byte_width == NA_INTEGER) { - Rcpp::stop("'byte_width' cannot be NA"); + cpp11::stop("'byte_width' cannot be NA"); } if (byte_width < 1) { - Rcpp::stop("'byte_width' must be > 0"); + cpp11::stop("'byte_width' must be > 0"); } return arrow::fixed_size_binary(byte_width); } @@ -137,54 +128,55 @@ std::shared_ptr Time64__initialize(arrow::TimeUnit::type unit) // [[arrow::export]] SEXP list__(SEXP x) { if (Rf_inherits(x, "Field")) { - Rcpp::ConstReferenceSmartPtrInputParameter> field(x); - return wrap(arrow::list(field)); + auto field = cpp11::as_cpp>(x); + return cpp11::as_sexp(arrow::list(field)); } if (Rf_inherits(x, "DataType")) { - Rcpp::ConstReferenceSmartPtrInputParameter> type(x); - return wrap(arrow::list(type)); + auto type = cpp11::as_cpp>(x); + return cpp11::as_sexp(arrow::list(type)); } - stop("incompatible"); + cpp11::stop("incompatible"); return R_NilValue; } // [[arrow::export]] SEXP large_list__(SEXP x) { if (Rf_inherits(x, "Field")) { - Rcpp::ConstReferenceSmartPtrInputParameter> field(x); - return wrap(arrow::large_list(field)); + auto field = cpp11::as_cpp>(x); + return cpp11::as_sexp(arrow::large_list(field)); } if (Rf_inherits(x, "DataType")) { - Rcpp::ConstReferenceSmartPtrInputParameter> type(x); - return wrap(arrow::large_list(type)); + auto type = cpp11::as_cpp>(x); + return cpp11::as_sexp(arrow::large_list(type)); } - stop("incompatible"); + cpp11::stop("incompatible"); return R_NilValue; } // [[arrow::export]] SEXP fixed_size_list__(SEXP x, int list_size) { if (Rf_inherits(x, "Field")) { - Rcpp::ConstReferenceSmartPtrInputParameter> field(x); - return wrap(arrow::fixed_size_list(field, list_size)); + auto field = cpp11::as_cpp>(x); + return cpp11::as_sexp(arrow::fixed_size_list(field, list_size)); } if (Rf_inherits(x, "DataType")) { - Rcpp::ConstReferenceSmartPtrInputParameter> type(x); - return wrap(arrow::fixed_size_list(type, list_size)); + auto type = cpp11::as_cpp>(x); + return cpp11::as_sexp(arrow::fixed_size_list(type, list_size)); } - stop("incompatible"); + cpp11::stop("incompatible"); return R_NilValue; } // [[arrow::export]] -std::shared_ptr struct_(List fields) { - return arrow::struct_(arrow::r::List_to_shared_ptr_vector(fields)); +std::shared_ptr struct__( + const std::vector>& fields) { + return arrow::struct_(fields); } // [[arrow::export]] @@ -209,8 +201,9 @@ int DataType__num_children(const std::shared_ptr& type) { } // [[arrow::export]] -List DataType__children_pointer(const std::shared_ptr& type) { - return List(type->fields().begin(), type->fields().end()); +cpp11::writable::list DataType__children_pointer( + const std::shared_ptr& type) { + return arrow::r::to_r_list(type->fields()); } // [[arrow::export]] diff --git a/r/src/feather.cpp b/r/src/feather.cpp index b66da47965d..22bdd7acde0 100644 --- a/r/src/feather.cpp +++ b/r/src/feather.cpp @@ -65,7 +65,7 @@ std::shared_ptr ipc___feather___Reader__Read( StopIfNotOk(reader->Read(&table)); break; default: - Rcpp::stop("incompatible column specification"); + cpp11::stop("incompatible column specification"); break; } @@ -79,15 +79,11 @@ std::shared_ptr ipc___feather___Reader__Open( } // [[arrow::export]] -Rcpp::CharacterVector ipc___feather___Reader__column_names( +cpp11::writable::strings ipc___feather___Reader__column_names( const std::shared_ptr& reader) { - auto sch = reader->schema(); - int64_t n = sch->num_fields(); - Rcpp::CharacterVector out(n); - for (int i = 0; i < n; i++) { - out[i] = sch->field(i)->name(); - } - return out; + return arrow::r::to_r_strings( + reader->schema()->fields(), + [](const std::shared_ptr& field) { return field->name(); }); } #endif diff --git a/r/src/filesystem.cpp b/r/src/filesystem.cpp index ccead59f6cb..5fd8eb7e165 100644 --- a/r/src/filesystem.cpp +++ b/r/src/filesystem.cpp @@ -16,6 +16,7 @@ // under the License. #include "./arrow_types.h" + #if defined(ARROW_R_WITH_ARROW) #include @@ -23,8 +24,6 @@ namespace fs = ::arrow::fs; -RCPP_EXPOSED_ENUM_NODECL(arrow::fs::FileType) - // FileInfo // [[arrow::export]] @@ -223,11 +222,12 @@ std::shared_ptr fs___SubTreeFileSystem__create( } // [[arrow::export]] -Rcpp::List fs___FileSystemFromUri(const std::string& path) { +cpp11::writable::list fs___FileSystemFromUri(const std::string& path) { + using cpp11::literals::operator"" _nm; + std::string out_path; auto file_system = ValueOrStop(fs::FileSystemFromUri(path, &out_path)); - return Rcpp::List::create(Rcpp::Named("fs") = file_system, - Rcpp::Named("path") = out_path); + return cpp11::writable::list({"fs"_nm = file_system, "path"_nm = out_path}); } #endif diff --git a/r/src/io.cpp b/r/src/io.cpp index 763a653bee5..8cfbea02149 100644 --- a/r/src/io.cpp +++ b/r/src/io.cpp @@ -17,14 +17,10 @@ #include "./arrow_types.h" -using Rcpp::RawVector_; - #if defined(ARROW_R_WITH_ARROW) #include #include -RCPP_EXPOSED_ENUM_NODECL(arrow::io::FileMode::type) - // ------ arrow::io::Readable // [[arrow::export]] @@ -178,8 +174,8 @@ int64_t io___BufferOutputStream__Tell( // [[arrow::export]] void io___BufferOutputStream__Write( - const std::shared_ptr& stream, RawVector_ bytes) { - StopIfNotOk(stream->Write(bytes.begin(), bytes.size())); + const std::shared_ptr& stream, cpp11::raws bytes) { + StopIfNotOk(stream->Write(RAW(bytes), bytes.size())); } #endif diff --git a/r/src/json.cpp b/r/src/json.cpp index edeeb343cca..52e50373777 100644 --- a/r/src/json.cpp +++ b/r/src/json.cpp @@ -20,24 +20,22 @@ #include -using Rcpp::CharacterVector; -using Rcpp::List_; - // [[arrow::export]] -std::shared_ptr json___ReadOptions__initialize(List_ options) { +std::shared_ptr json___ReadOptions__initialize(bool use_threads, + int block_size) { auto res = std::make_shared(arrow::json::ReadOptions::Defaults()); - res->use_threads = options["use_threads"]; - res->block_size = options["block_size"]; + res->use_threads = use_threads; + res->block_size = block_size; return res; } // [[arrow::export]] std::shared_ptr json___ParseOptions__initialize( - List_ options) { + bool newlines_in_values) { auto res = std::make_shared(arrow::json::ParseOptions::Defaults()); - res->newlines_in_values = options["newlines_in_values"]; + res->newlines_in_values = newlines_in_values; return res; } diff --git a/r/src/memorypool.cpp b/r/src/memorypool.cpp index 1d475caf235..bc2f576d76e 100644 --- a/r/src/memorypool.cpp +++ b/r/src/memorypool.cpp @@ -22,7 +22,7 @@ // [[arrow::export]] std::shared_ptr MemoryPool__default() { return std::shared_ptr(arrow::default_memory_pool(), - NoDelete()); + [](arrow::MemoryPool* not_deleted) {}); } // [[arrow::export]] diff --git a/r/src/message.cpp b/r/src/message.cpp index 8ec5a3faab0..fd50007d93d 100644 --- a/r/src/message.cpp +++ b/r/src/message.cpp @@ -21,8 +21,6 @@ #include #include -RCPP_EXPOSED_ENUM_NODECL(arrow::ipc::MessageType) - // [[arrow::export]] int64_t ipc___Message__body_length(const std::unique_ptr& message) { return message->body_length(); diff --git a/r/src/parquet.cpp b/r/src/parquet.cpp index 626e58c23af..40d0d1d67cd 100644 --- a/r/src/parquet.cpp +++ b/r/src/parquet.cpp @@ -24,8 +24,6 @@ #include #include -RCPP_EXPOSED_ENUM_NODECL(parquet::ParquetVersion::type) - // [[arrow::export]] std::shared_ptr parquet___arrow___ArrowReaderProperties__Make(bool use_threads) { @@ -142,7 +140,7 @@ void parquet___WriterProperties___Builder__version( // [[arrow::export]] void parquet___ArrowWriterProperties___Builder__set_compressions( const std::shared_ptr& builder, - const std::vector& paths, const Rcpp::IntegerVector& types) { + const std::vector& paths, cpp11::integers types) { auto n = types.size(); if (n == 1) { builder->compression(static_cast(types[0])); @@ -156,7 +154,7 @@ void parquet___ArrowWriterProperties___Builder__set_compressions( // [[arrow::export]] void parquet___ArrowWriterProperties___Builder__set_compression_levels( const std::shared_ptr& builder, - const std::vector& paths, const Rcpp::IntegerVector& levels) { + const std::vector& paths, cpp11::integers levels) { auto n = levels.size(); if (n == 1) { builder->compression_level(levels[0]); @@ -170,10 +168,10 @@ void parquet___ArrowWriterProperties___Builder__set_compression_levels( // [[arrow::export]] void parquet___ArrowWriterProperties___Builder__set_use_dictionary( const std::shared_ptr& builder, - const std::vector& paths, const Rcpp::LogicalVector& use_dictionary) { + const std::vector& paths, cpp11::logicals use_dictionary) { auto n = use_dictionary.size(); if (n == 1) { - if (use_dictionary[0]) { + if (use_dictionary[0] == TRUE) { builder->enable_dictionary(); } else { builder->disable_dictionary(); @@ -181,7 +179,7 @@ void parquet___ArrowWriterProperties___Builder__set_use_dictionary( } else { builder->disable_dictionary(); for (decltype(n) i = 0; i < n; i++) { - if (use_dictionary[i]) { + if (use_dictionary[i] == TRUE) { builder->enable_dictionary(paths[i]); } else { builder->disable_dictionary(paths[i]); @@ -193,10 +191,10 @@ void parquet___ArrowWriterProperties___Builder__set_use_dictionary( // [[arrow::export]] void parquet___ArrowWriterProperties___Builder__set_write_statistics( const std::shared_ptr& builder, - const std::vector& paths, const Rcpp::LogicalVector& write_statistics) { + const std::vector& paths, cpp11::logicals write_statistics) { auto n = write_statistics.size(); if (n == 1) { - if (write_statistics[0]) { + if (write_statistics[0] == TRUE) { builder->enable_statistics(); } else { builder->disable_statistics(); @@ -204,7 +202,7 @@ void parquet___ArrowWriterProperties___Builder__set_write_statistics( } else { builder->disable_statistics(); for (decltype(n) i = 0; i < n; i++) { - if (write_statistics[i]) { + if (write_statistics[i] == TRUE) { builder->enable_statistics(paths[i]); } else { builder->disable_statistics(paths[i]); diff --git a/r/src/py-to-r.cpp b/r/src/py-to-r.cpp index 91b5ebc617d..d2ff13bc2f2 100644 --- a/r/src/py-to-r.cpp +++ b/r/src/py-to-r.cpp @@ -18,60 +18,56 @@ #include "./arrow_types.h" #if defined(ARROW_R_WITH_ARROW) -#include // [[arrow::export]] -std::shared_ptr ImportArray(uintptr_t array, uintptr_t schema) { - return ValueOrStop(arrow::ImportArray(reinterpret_cast(array), - reinterpret_cast(schema))); +std::shared_ptr ImportArray(arrow::r::Pointer array, + arrow::r::Pointer schema) { + return ValueOrStop(arrow::ImportArray(array, schema)); } // [[arrow::export]] -std::shared_ptr ImportRecordBatch(uintptr_t array, uintptr_t schema) { - return ValueOrStop( - arrow::ImportRecordBatch(reinterpret_cast(array), - reinterpret_cast(schema))); +std::shared_ptr ImportRecordBatch( + arrow::r::Pointer array, + arrow::r::Pointer schema) { + return ValueOrStop(arrow::ImportRecordBatch(array, schema)); } // [[arrow::export]] -uintptr_t allocate_arrow_schema() { return reinterpret_cast(new ArrowSchema); } +arrow::r::Pointer allocate_arrow_schema() { return {}; } // [[arrow::export]] -void delete_arrow_schema(uintptr_t ptr) { - delete reinterpret_cast(ptr); -} +void delete_arrow_schema(arrow::r::Pointer ptr) { ptr.finalize(); } // [[arrow::export]] -uintptr_t allocate_arrow_array() { return reinterpret_cast(new ArrowArray); } +arrow::r::Pointer allocate_arrow_array() { return {}; } // [[arrow::export]] -void delete_arrow_array(uintptr_t ptr) { - delete reinterpret_cast(ptr); -} +void delete_arrow_array(arrow::r::Pointer ptr) { ptr.finalize(); } // [[arrow::export]] -void ExportType(const std::shared_ptr& type, uintptr_t ptr) { - StopIfNotOk(arrow::ExportType(*type, reinterpret_cast(ptr))); +void ExportType(const std::shared_ptr& type, + arrow::r::Pointer ptr) { + StopIfNotOk(arrow::ExportType(*type, ptr)); } // [[arrow::export]] -void ExportSchema(const std::shared_ptr& schema, uintptr_t ptr) { - StopIfNotOk(arrow::ExportSchema(*schema, reinterpret_cast(ptr))); +void ExportSchema(const std::shared_ptr& schema, + arrow::r::Pointer ptr) { + StopIfNotOk(arrow::ExportSchema(*schema, ptr)); } // [[arrow::export]] -void ExportArray(const std::shared_ptr& array, uintptr_t ptr, - uintptr_t schema_ptr) { - StopIfNotOk(arrow::ExportArray(*array, reinterpret_cast(ptr), - reinterpret_cast(schema_ptr))); +void ExportArray(const std::shared_ptr& array, + arrow::r::Pointer array_ptr, + arrow::r::Pointer schema_ptr) { + StopIfNotOk(arrow::ExportArray(*array, array_ptr, schema_ptr)); } // [[arrow::export]] -void ExportRecordBatch(const std::shared_ptr& batch, uintptr_t ptr, - uintptr_t schema_ptr) { - StopIfNotOk( - arrow::ExportRecordBatch(*batch, reinterpret_cast(ptr), - reinterpret_cast(schema_ptr))); +void ExportRecordBatch(const std::shared_ptr& batch, + arrow::r::Pointer array_ptr, + arrow::r::Pointer schema_ptr) { + StopIfNotOk(arrow::ExportRecordBatch(*batch, array_ptr, schema_ptr)); } #endif diff --git a/r/src/recordbatch.cpp b/r/src/recordbatch.cpp index 922bae2217e..3ad5ae485ad 100644 --- a/r/src/recordbatch.cpp +++ b/r/src/recordbatch.cpp @@ -44,9 +44,11 @@ std::shared_ptr RecordBatch__schema( // [[arrow::export]] std::shared_ptr RecordBatch__ReplaceSchemaMetadata( - const std::shared_ptr& x, Rcpp::CharacterVector metadata) { - auto kv = std::shared_ptr(new arrow::KeyValueMetadata( - metadata.names(), Rcpp::as>(metadata))); + const std::shared_ptr& x, cpp11::strings metadata) { + auto vec_metadata = cpp11::as_cpp>(metadata); + auto names_metadata = cpp11::as_cpp>(metadata.names()); + auto kv = std::shared_ptr( + new arrow::KeyValueMetadata(names_metadata, vec_metadata)); return x->ReplaceSchemaMetadata(kv); } @@ -63,7 +65,7 @@ arrow::ArrayVector RecordBatch__columns( // [[arrow::export]] std::shared_ptr RecordBatch__column( - const std::shared_ptr& batch, int i) { + const std::shared_ptr& batch, R_xlen_t i) { arrow::r::validate_index(i, batch->num_columns()); return batch->column(i); } @@ -76,8 +78,7 @@ std::shared_ptr RecordBatch__GetColumnByName( // [[arrow::export]] std::shared_ptr RecordBatch__select( - const std::shared_ptr& batch, - const Rcpp::IntegerVector& indices) { + const std::shared_ptr& batch, cpp11::integers indices) { R_xlen_t n = indices.size(); auto nrows = batch->num_rows(); @@ -94,24 +95,6 @@ std::shared_ptr RecordBatch__select( return arrow::RecordBatch::Make(schema, nrows, columns); } -// [[arrow::export]] -std::shared_ptr RecordBatch__from_dataframe(Rcpp::DataFrame tbl) { - Rcpp::CharacterVector names = tbl.names(); - - std::vector> fields; - std::vector> arrays; - - for (int i = 0; i < tbl.size(); i++) { - SEXP x = tbl[i]; - arrays.push_back(Array__from_vector(x, R_NilValue)); - fields.push_back( - std::make_shared(std::string(names[i]), arrays[i]->type())); - } - auto schema = std::make_shared(std::move(fields)); - - return arrow::RecordBatch::Make(schema, tbl.nrow(), std::move(arrays)); -} - // [[arrow::export]] bool RecordBatch__Equals(const std::shared_ptr& self, const std::shared_ptr& other, @@ -121,23 +104,23 @@ bool RecordBatch__Equals(const std::shared_ptr& self, // [[arrow::export]] std::shared_ptr RecordBatch__RemoveColumn( - const std::shared_ptr& batch, int i) { + const std::shared_ptr& batch, R_xlen_t i) { arrow::r::validate_index(i, batch->num_columns()); return ValueOrStop(batch->RemoveColumn(i)); } // [[arrow::export]] std::string RecordBatch__column_name(const std::shared_ptr& batch, - int i) { + R_xlen_t i) { arrow::r::validate_index(i, batch->num_columns()); return batch->column_name(i); } // [[arrow::export]] -Rcpp::CharacterVector RecordBatch__names( +cpp11::writable::strings RecordBatch__names( const std::shared_ptr& batch) { int n = batch->num_columns(); - Rcpp::CharacterVector names(n); + cpp11::writable::strings names(n); for (int i = 0; i < n; i++) { names[i] = batch->column_name(i); } @@ -146,31 +129,31 @@ Rcpp::CharacterVector RecordBatch__names( // [[arrow::export]] std::shared_ptr RecordBatch__Slice1( - const std::shared_ptr& self, int offset) { + const std::shared_ptr& self, R_xlen_t offset) { arrow::r::validate_slice_offset(offset, self->num_rows()); return self->Slice(offset); } // [[arrow::export]] std::shared_ptr RecordBatch__Slice2( - const std::shared_ptr& self, int offset, int length) { + const std::shared_ptr& self, R_xlen_t offset, R_xlen_t length) { arrow::r::validate_slice_offset(offset, self->num_rows()); arrow::r::validate_slice_length(length, self->num_rows() - offset); return self->Slice(offset, length); } // [[arrow::export]] -Rcpp::RawVector ipc___SerializeRecordBatch__Raw( +cpp11::raws ipc___SerializeRecordBatch__Raw( const std::shared_ptr& batch) { // how many bytes do we need ? int64_t size; StopIfNotOk(arrow::ipc::GetRecordBatchSize(*batch, &size)); // allocate the result raw vector - Rcpp::RawVector out(Rcpp::no_init(size)); + cpp11::writable::raws out(size); // serialize into the bytes of the raw vector - auto buffer = std::make_shared>(out); + auto buffer = std::make_shared>(out); arrow::io::FixedSizeBufferWriter stream(buffer); StopIfNotOk(arrow::ipc::SerializeRecordBatch( *batch, arrow::ipc::IpcWriteOptions::Defaults(), &stream)); @@ -237,37 +220,22 @@ std::shared_ptr RecordBatch__from_arrays__known_schema( StopIfNotOk(arrow::r::count_fields(lst, &num_fields)); if (schema->num_fields() != num_fields) { - Rcpp::stop("incompatible. schema has %d fields, and %d arrays are supplied", - schema->num_fields(), num_fields); + cpp11::stop("incompatible. schema has %d fields, and %d arrays are supplied", + schema->num_fields(), num_fields); } // convert lst to a vector of arrow::Array std::vector> arrays(num_fields); - SEXP names = Rf_getAttrib(lst, R_NamesSymbol); - auto fill_array = [&arrays, &schema](int j, SEXP x, SEXP name) { - name = Rf_mkCharCE(Rf_translateCharUTF8(name), CE_UTF8); - if (schema->field(j)->name() != CHAR(name)) { - Rcpp::stop("field at index %d has name '%s' != '%s'", j + 1, - schema->field(j)->name(), CHAR(name)); + auto fill_array = [&arrays, &schema](int j, SEXP x, std::string name) { + if (schema->field(j)->name() != name) { + cpp11::stop("field at index %d has name '%s' != '%s'", j + 1, + schema->field(j)->name().c_str(), name.c_str()); } arrays[j] = arrow::r::Array__from_vector(x, schema->field(j)->type(), false); }; - for (R_xlen_t i = 0, j = 0; j < num_fields; i++) { - SEXP name_i = STRING_ELT(names, i); - SEXP x_i = VECTOR_ELT(lst, i); - - if (LENGTH(name_i) == 0) { - SEXP names_x_i = Rf_getAttrib(x_i, R_NamesSymbol); - for (R_xlen_t k = 0; k < XLENGTH(x_i); k++, j++) { - fill_array(j, VECTOR_ELT(x_i, k), STRING_ELT(names_x_i, k)); - } - } else { - fill_array(j, x_i, name_i); - j++; - } - } + arrow::r::TraverseDots(lst, num_fields, fill_array); int64_t num_rows = 0; StopIfNotOk(arrow::r::check_consistent_array_size(arrays, &num_rows)); @@ -280,7 +248,7 @@ namespace r { arrow::Status CollectRecordBatchArrays( SEXP lst, const std::shared_ptr& schema, int num_fields, bool inferred, std::vector>& arrays) { - auto extract_one_array = [&arrays, &schema, inferred](int j, SEXP x, SEXP name) { + auto extract_one_array = [&arrays, &schema, inferred](int j, SEXP x, cpp11::r_string) { arrays[j] = arrow::r::Array__from_vector(x, schema->field(j)->type(), inferred); }; arrow::r::TraverseDots(lst, num_fields, extract_one_array); diff --git a/r/src/recordbatchreader.cpp b/r/src/recordbatchreader.cpp index 93b54251148..7ecb42002a9 100644 --- a/r/src/recordbatchreader.cpp +++ b/r/src/recordbatchreader.cpp @@ -78,7 +78,7 @@ int ipc___RecordBatchFileReader__num_record_batches( std::shared_ptr ipc___RecordBatchFileReader__ReadRecordBatch( const std::shared_ptr& reader, int i) { if (i < 0 && i >= reader->num_record_batches()) { - Rcpp::stop("Record batch index out of bounds"); + cpp11::stop("Record batch index out of bounds"); } return ValueOrStop(reader->ReadRecordBatch(i)); } diff --git a/r/src/recordbatchwriter.cpp b/r/src/recordbatchwriter.cpp index 9d038dd42ba..865773c01e9 100644 --- a/r/src/recordbatchwriter.cpp +++ b/r/src/recordbatchwriter.cpp @@ -20,8 +20,6 @@ #if defined(ARROW_R_WITH_ARROW) #include -RCPP_EXPOSED_ENUM_NODECL(arrow::ipc::MetadataVersion) - // [[arrow::export]] void ipc___RecordBatchWriter__WriteRecordBatch( const std::shared_ptr& batch_writer, diff --git a/r/src/schema.cpp b/r/src/schema.cpp index 15e7027b815..5cbaf7e0e20 100644 --- a/r/src/schema.cpp +++ b/r/src/schema.cpp @@ -24,8 +24,9 @@ #include // [[arrow::export]] -std::shared_ptr schema_(Rcpp::List fields) { - return arrow::schema(arrow::r::List_to_shared_ptr_vector(fields)); +std::shared_ptr schema_( + const std::vector>& fields) { + return arrow::schema(fields); } // [[arrow::export]] @@ -42,7 +43,7 @@ int Schema__num_fields(const std::shared_ptr& s) { std::shared_ptr Schema__field(const std::shared_ptr& s, int i) { if (i >= s->num_fields() || i < 0) { - Rcpp::stop("Invalid field index for schema."); + cpp11::stop("Invalid field index for schema."); } return s->field(i); @@ -72,47 +73,45 @@ bool Schema__HasMetadata(const std::shared_ptr& schema) { } // [[arrow::export]] -Rcpp::List Schema__metadata(const std::shared_ptr& schema) { +cpp11::writable::list Schema__metadata(const std::shared_ptr& schema) { auto meta = schema->metadata(); int64_t n = 0; if (schema->HasMetadata()) { n = meta->size(); } - Rcpp::List out(n); + cpp11::writable::list out(n); std::vector names_out(n); for (int i = 0; i < n; i++) { auto key = meta->key(i); - out[i] = meta->value(i); + out[i] = cpp11::as_sexp(meta->value(i)); if (key == "r") { - Rf_setAttrib(out[i], R_ClassSymbol, arrow::r::data::classes_metadata_r); + Rf_classgets(out[i], arrow::r::data::classes_metadata_r); } names_out[i] = key; } - out.attr("names") = names_out; + out.names() = names_out; return out; } // [[arrow::export]] std::shared_ptr Schema__WithMetadata( - const std::shared_ptr& schema, Rcpp::CharacterVector metadata) { - auto kv = std::shared_ptr(new arrow::KeyValueMetadata( - metadata.names(), Rcpp::as>(metadata))); - return schema->WithMetadata(kv); + const std::shared_ptr& schema, cpp11::strings metadata) { + auto values = cpp11::as_cpp>(metadata); + auto names = cpp11::as_cpp>(metadata.attr("names")); + + auto kv = + std::make_shared(std::move(names), std::move(values)); + return schema->WithMetadata(std::move(kv)); } // [[arrow::export]] -Rcpp::RawVector Schema__serialize(const std::shared_ptr& schema) { +cpp11::writable::raws Schema__serialize(const std::shared_ptr& schema) { arrow::ipc::DictionaryMemo empty_memo; - std::shared_ptr out = - ValueOrStop(arrow::ipc::SerializeSchema(*schema, &empty_memo)); - + auto out = ValueOrStop(arrow::ipc::SerializeSchema(*schema, &empty_memo)); auto n = out->size(); - Rcpp::RawVector vec(out->size()); - std::copy_n(out->data(), n, vec.begin()); - - return vec; + return cpp11::writable::raws(out->data(), out->data() + n); } // [[arrow::export]] diff --git a/r/src/symbols.cpp b/r/src/symbols.cpp index f087f82ccad..423c9503a4c 100644 --- a/r/src/symbols.cpp +++ b/r/src/symbols.cpp @@ -37,58 +37,46 @@ SEXP precious(SEXP x) { return x; } -// return R string vector, e.g. -// strings({"foo", "bar"}) returns a size 2 STRSXP -SEXP strings(std::initializer_list list) { - size_t n = list.size(); - SEXP s = PROTECT(Rf_allocVector(STRSXP, n)); - - auto it = list.begin(); - for (size_t i = 0; i < n; i++, ++it) { - SET_STRING_ELT(s, i, Rf_mkCharLen(it->c_str(), it->size())); - } - - UNPROTECT(1); - return s; -} - // returns the namespace environment for package `name` SEXP r_namespace(std::string name) { - SEXP s_name = PROTECT(strings({name})); + SEXP s_name = PROTECT(cpp11::writable::strings({name})); SEXP ns = R_FindNamespace(s_name); UNPROTECT(1); return ns; } -SEXP data::classes_POSIXct = precious(strings({"POSIXct", "POSIXt"})); -SEXP data::classes_metadata_r = precious(strings({"arrow_r_metadata"})); +SEXP data::classes_POSIXct = precious(cpp11::writable::strings({"POSIXct", "POSIXt"})); +SEXP data::classes_metadata_r = precious(cpp11::writable::strings({"arrow_r_metadata"})); SEXP data::classes_vctrs_list_of = - precious(strings({"vctrs_list_of", "vctrs_vctr", "list"})); + precious(cpp11::writable::strings({"vctrs_list_of", "vctrs_vctr", "list"})); +SEXP data::classes_tbl_df = + precious(cpp11::writable::strings({"tbl_df", "tbl", "data.frame"})); SEXP data::classes_arrow_binary = - precious(strings({"arrow_binary", "vctrs_vctr", "list"})); + precious(cpp11::writable::strings({"arrow_binary", "vctrs_vctr", "list"})); SEXP data::classes_arrow_large_binary = - precious(strings({"arrow_large_binary", "vctrs_vctr", "list"})); + precious(cpp11::writable::strings({"arrow_large_binary", "vctrs_vctr", "list"})); SEXP data::classes_arrow_fixed_size_binary = - precious(strings({"arrow_fixed_size_binary", "vctrs_vctr", "list"})); -SEXP data::classes_factor = precious(strings({"factor"})); -SEXP data::classes_ordered = precious(strings({"ordered", "factor"})); + precious(cpp11::writable::strings({"arrow_fixed_size_binary", "vctrs_vctr", "list"})); +SEXP data::classes_factor = precious(cpp11::writable::strings({"factor"})); +SEXP data::classes_ordered = precious(cpp11::writable::strings({"ordered", "factor"})); -SEXP data::classes_arrow_list = - precious(strings({"arrow_list", "vctrs_list_of", "vctrs_vctr", "list"})); -SEXP data::classes_arrow_large_list = - precious(strings({"arrow_large_list", "vctrs_list_of", "vctrs_vctr", "list"})); -SEXP data::classes_arrow_fixed_size_list = - precious(strings({"arrow_fixed_size_list", "vctrs_list_of", "vctrs_vctr", "list"})); +SEXP data::classes_arrow_list = precious( + cpp11::writable::strings({"arrow_list", "vctrs_list_of", "vctrs_vctr", "list"})); +SEXP data::classes_arrow_large_list = precious(cpp11::writable::strings( + {"arrow_large_list", "vctrs_list_of", "vctrs_vctr", "list"})); +SEXP data::classes_arrow_fixed_size_list = precious(cpp11::writable::strings( + {"arrow_fixed_size_list", "vctrs_list_of", "vctrs_vctr", "list"})); -SEXP data::names_metadata = precious(strings({"attributes", "columns"})); +SEXP data::names_metadata = precious(cpp11::writable::strings({"attributes", "columns"})); SEXP data::empty_raw = precious(Rf_allocVector(RAWSXP, 0)); SEXP ns::arrow = precious(r_namespace("arrow")); void inspect(SEXP obj) { - Rcpp::Shield call_inspect(Rf_lang2(symbols::inspect, obj)); - Rcpp::Shield call_internal(Rf_lang2(symbols::dot_Internal, call_inspect)); + SEXP call_inspect = PROTECT(Rf_lang2(symbols::inspect, obj)); + SEXP call_internal = PROTECT(Rf_lang2(symbols::dot_Internal, call_inspect)); Rf_eval(call_internal, R_GlobalEnv); + UNPROTECT(2); } } // namespace r diff --git a/r/src/table.cpp b/r/src/table.cpp index d9d1efcaa96..6a56e8e8f2d 100644 --- a/r/src/table.cpp +++ b/r/src/table.cpp @@ -22,15 +22,6 @@ #include #include -using Rcpp::DataFrame; - -// [[arrow::export]] -std::shared_ptr Table__from_dataframe(DataFrame tbl) { - auto rb = RecordBatch__from_dataframe(tbl); - - return ValueOrStop(arrow::Table::FromRecordBatches({std::move(rb)})); -} - // [[arrow::export]] int Table__num_columns(const std::shared_ptr& x) { return x->num_columns(); @@ -46,22 +37,24 @@ std::shared_ptr Table__schema(const std::shared_ptr // [[arrow::export]] std::shared_ptr Table__ReplaceSchemaMetadata( - const std::shared_ptr& x, Rcpp::CharacterVector metadata) { - auto kv = std::shared_ptr(new arrow::KeyValueMetadata( - metadata.names(), Rcpp::as>(metadata))); + const std::shared_ptr& x, cpp11::strings metadata) { + auto vec_metadata = cpp11::as_cpp>(metadata); + auto names_metadata = cpp11::as_cpp>(metadata.names()); + auto kv = std::shared_ptr( + new arrow::KeyValueMetadata(names_metadata, vec_metadata)); return x->ReplaceSchemaMetadata(kv); } // [[arrow::export]] std::shared_ptr Table__column( - const std::shared_ptr& table, int i) { + const std::shared_ptr& table, R_xlen_t i) { arrow::r::validate_index(i, table->num_columns()); return table->column(i); } // [[arrow::export]] std::shared_ptr Table__field(const std::shared_ptr& table, - int i) { + R_xlen_t i) { arrow::r::validate_index(i, table->num_columns()); return table->field(i); } @@ -84,14 +77,14 @@ std::vector Table__ColumnNames(const std::shared_ptr& // [[arrow::export]] std::shared_ptr Table__Slice1(const std::shared_ptr& table, - int offset) { + R_xlen_t offset) { arrow::r::validate_slice_offset(offset, table->num_rows()); return table->Slice(offset); } // [[arrow::export]] std::shared_ptr Table__Slice2(const std::shared_ptr& table, - int offset, int length) { + R_xlen_t offset, R_xlen_t length) { arrow::r::validate_slice_offset(offset, table->num_rows()); arrow::r::validate_slice_length(length, table->num_rows() - offset); return table->Slice(offset, length); @@ -123,7 +116,7 @@ std::shared_ptr Table__GetColumnByName( // [[arrow::export]] std::shared_ptr Table__select(const std::shared_ptr& table, - const Rcpp::IntegerVector& indices) { + cpp11::integers indices) { R_xlen_t n = indices.size(); std::vector> fields(n); @@ -139,14 +132,6 @@ std::shared_ptr Table__select(const std::shared_ptr& return arrow::Table::Make(schema, columns); } -bool all_record_batches(SEXP lst) { - R_xlen_t n = XLENGTH(lst); - for (R_xlen_t i = 0; i < n; i++) { - if (!Rf_inherits(VECTOR_ELT(lst, i), "RecordBatch")) return false; - } - return true; -} - namespace arrow { namespace r { @@ -154,7 +139,7 @@ arrow::Status InferSchemaFromDots(SEXP lst, SEXP schema_sxp, int num_fields, std::shared_ptr& schema) { // maybe a schema was given if (Rf_inherits(schema_sxp, "Schema")) { - schema = arrow::r::extract(schema_sxp); + schema = cpp11::as_cpp>(schema_sxp); return arrow::Status::OK(); } @@ -165,17 +150,16 @@ arrow::Status InferSchemaFromDots(SEXP lst, SEXP schema_sxp, int num_fields, // infer the schema from the `...` std::vector> fields(num_fields); - auto extract_one_field = [&fields](int j, SEXP x, SEXP name) { - // Make sure we're ingesting UTF-8 - name = Rf_mkCharCE(Rf_translateCharUTF8(name), CE_UTF8); + auto extract_one_field = [&fields](int j, SEXP x, std::string name) { if (Rf_inherits(x, "ChunkedArray")) { - fields[j] = - arrow::field(CHAR(name), arrow::r::extract(x)->type()); + fields[j] = arrow::field( + name, cpp11::as_cpp>(x)->type()); } else if (Rf_inherits(x, "Array")) { - fields[j] = arrow::field(CHAR(name), arrow::r::extract(x)->type()); + fields[j] = + arrow::field(name, cpp11::as_cpp>(x)->type()); } else { // TODO: we just need the type at this point - fields[j] = arrow::field(CHAR(name), arrow::r::InferArrowType(x)); + fields[j] = arrow::field(name, arrow::r::InferArrowType(x)); } }; arrow::r::TraverseDots(lst, num_fields, extract_one_field); @@ -187,15 +171,14 @@ arrow::Status InferSchemaFromDots(SEXP lst, SEXP schema_sxp, int num_fields, SEXP CollectColumnMetadata(SEXP lst, int num_fields, bool& has_metadata) { // Preallocate for the lambda to fill in - SEXP metadata_columns = PROTECT(Rf_allocVector(VECSXP, num_fields)); - SEXP metadata_columns_names = PROTECT(Rf_allocVector(STRSXP, num_fields)); + cpp11::writable::list metadata_columns(num_fields); + cpp11::writable::strings metadata_columns_names(num_fields); Rf_setAttrib(metadata_columns, R_NamesSymbol, metadata_columns_names); auto extract_one_metadata = [&metadata_columns, &metadata_columns_names, &has_metadata]( - int j, SEXP x, SEXP name) { - // Make sure we're ingesting UTF-8 - name = Rf_mkCharCE(Rf_translateCharUTF8(name), CE_UTF8); - SET_STRING_ELT(metadata_columns_names, j, name); + int j, SEXP x, std::string name) { + metadata_columns_names[j] = name; + // no metadata for arrow R6 objects if (Rf_inherits(x, "ArrowObject")) { return; @@ -270,7 +253,6 @@ SEXP CollectColumnMetadata(SEXP lst, int num_fields, bool& has_metadata) { StopIfNotOk(arrow::r::count_fields(x, &inner_num_fields)); SET_VECTOR_ELT(r_meta, 1, CollectColumnMetadata(x, inner_num_fields, has_metadata)); - UNPROTECT(2); // CollectColumnMetadata adds 2 PROTECTS this_has_metadata = true; } if (this_has_metadata) { @@ -304,7 +286,6 @@ arrow::Status AddMetadataFromDots(SEXP lst, int num_fields, // has_metadata = true; // } SET_VECTOR_ELT(metadata, 1, CollectColumnMetadata(lst, num_fields, has_metadata)); - UNPROTECT(2); // CollectColumnMetadata adds 2 PROTECTS if (has_metadata) { SEXP serialise_call = @@ -324,12 +305,13 @@ arrow::Status AddMetadataFromDots(SEXP lst, int num_fields, arrow::Status CollectTableColumns( SEXP lst, const std::shared_ptr& schema, int num_fields, bool inferred, std::vector>& columns) { - auto extract_one_column = [&columns, &schema, inferred](int j, SEXP x, SEXP name) { + auto extract_one_column = [&columns, &schema, inferred](int j, SEXP x, + cpp11::r_string) { if (Rf_inherits(x, "ChunkedArray")) { - columns[j] = arrow::r::extract(x); + columns[j] = cpp11::as_cpp>(x); } else if (Rf_inherits(x, "Array")) { - columns[j] = - std::make_shared(arrow::r::extract(x)); + columns[j] = std::make_shared( + cpp11::as_cpp>(x)); } else { auto array = arrow::r::Array__from_vector(x, schema->field(j)->type(), inferred); columns[j] = std::make_shared(array); @@ -343,23 +325,34 @@ arrow::Status CollectTableColumns( } // namespace arrow // [[arrow::export]] -std::shared_ptr Table__from_dots(SEXP lst, SEXP schema_sxp) { - bool infer_schema = !Rf_inherits(schema_sxp, "Schema"); +bool all_record_batches(SEXP lst) { + R_xlen_t n = XLENGTH(lst); + for (R_xlen_t i = 0; i < n; i++) { + if (!Rf_inherits(VECTOR_ELT(lst, i), "RecordBatch")) return false; + } + return true; +} - if (all_record_batches(lst)) { - auto batches = arrow::r::List_to_shared_ptr_vector(lst); - std::shared_ptr tab; +// [[arrow::export]] +std::shared_ptr Table__from_record_batches( + const std::vector>& batches, SEXP schema_sxp) { + bool infer_schema = !Rf_inherits(schema_sxp, "Schema"); - if (infer_schema) { - tab = ValueOrStop(arrow::Table::FromRecordBatches(std::move(batches))); - } else { - auto schema = arrow::r::extract(schema_sxp); - tab = ValueOrStop(arrow::Table::FromRecordBatches(schema, std::move(batches))); - } + std::shared_ptr tab; - return tab; + if (infer_schema) { + tab = ValueOrStop(arrow::Table::FromRecordBatches(std::move(batches))); + } else { + auto schema = cpp11::as_cpp>(schema_sxp); + tab = ValueOrStop(arrow::Table::FromRecordBatches(schema, std::move(batches))); } + return tab; +} +// [[arrow::export]] +std::shared_ptr Table__from_dots(SEXP lst, SEXP schema_sxp) { + bool infer_schema = !Rf_inherits(schema_sxp, "Schema"); + int num_fields; StopIfNotOk(arrow::r::count_fields(lst, &num_fields)); diff --git a/r/tests/testthat/helper-roundtrip.R b/r/tests/testthat/helper-roundtrip.R new file mode 100644 index 00000000000..16d002c9f2a --- /dev/null +++ b/r/tests/testthat/helper-roundtrip.R @@ -0,0 +1,43 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +expect_array_roundtrip <- function(x, type, as = NULL) { + a <- Array$create(x, type = as) + expect_type_equal(a$type, type) + expect_identical(length(a), length(x)) + if (!inherits(type, c("ListType", "LargeListType"))) { + # TODO: revisit how missingness works with ListArrays + # R list objects don't handle missingness the same way as other vectors. + # Is there some vctrs thing we should do on the roundtrip back to R? + expect_equal(as.vector(is.na(a)), is.na(x)) + } + expect_equivalent(as.vector(a), x) + # Make sure the storage mode is the same on roundtrip (esp. integer vs. numeric) + expect_identical(typeof(as.vector(a)), typeof(x)) + + if (length(x)) { + a_sliced <- a$Slice(1) + x_sliced <- x[-1] + expect_type_equal(a_sliced$type, type) + expect_identical(length(a_sliced), length(x_sliced)) + if (!inherits(type, c("ListType", "LargeListType"))) { + expect_equal(as.vector(is.na(a_sliced)), is.na(x_sliced)) + } + expect_equivalent(as.vector(a_sliced), x_sliced) + } + invisible(a) +} diff --git a/r/tests/testthat/test-Array-errors.txt b/r/tests/testthat/test-Array-errors.txt deleted file mode 100644 index 94a79703de5..00000000000 --- a/r/tests/testthat/test-Array-errors.txt +++ /dev/null @@ -1,25 +0,0 @@ -> Array$create(list(numeric(0)), list_of(bool())) -Error in Array__from_vector(x, type): Unknown: Cannot convert list element 1 to an Array of type `bool` : Expecting a logical vector - -> Array$create(list(numeric(0)), list_of(int32())) -Error in Array__from_vector(x, type): Unknown: Cannot convert list element 1 to an Array of type `int32` : Expecting an integer vector - -> Array$create(list(integer(0)), list_of(float64())) -Error in Array__from_vector(x, type): Unknown: Cannot convert list element 1 to an Array of type `double` : Expecting a numeric vector - -> lgl <- logical(0) -> int <- integer(0) -> num <- numeric(0) -> char <- character(0) -> Array$create(list()) -Error in Array__from_vector(x, type): Requires at least one element to infer the values' type of a list vector - -> Array$create(list(lgl, lgl, int)) -Error in Array__from_vector(x, type): Unknown: Cannot convert list element 3 to an Array of type `bool` : Expecting a logical vector - -> Array$create(list(char, num, char)) -Error in Array__from_vector(x, type): Unknown: Cannot convert list element 2 to an Array of type `string` : Expecting a character vector - -> Array$create(list(int, int, num)) -Error in Array__from_vector(x, type): Unknown: Cannot convert list element 3 to an Array of type `int32` : Expecting an integer vector - diff --git a/r/tests/testthat/test-Array.R b/r/tests/testthat/test-Array.R index ce1b5bef176..d708cb9676f 100644 --- a/r/tests/testthat/test-Array.R +++ b/r/tests/testthat/test-Array.R @@ -17,33 +17,6 @@ context("Array") -expect_array_roundtrip <- function(x, type, as = NULL) { - a <- Array$create(x, type = as) - expect_type_equal(a$type, type) - expect_identical(length(a), length(x)) - if (!inherits(type, c("ListType", "LargeListType"))) { - # TODO: revisit how missingness works with ListArrays - # R list objects don't handle missingness the same way as other vectors. - # Is there some vctrs thing we should do on the roundtrip back to R? - expect_equal(as.vector(is.na(a)), is.na(x)) - } - expect_equivalent(as.vector(a), x) - # Make sure the storage mode is the same on roundtrip (esp. integer vs. numeric) - expect_identical(typeof(as.vector(a)), typeof(x)) - - if (length(x)) { - a_sliced <- a$Slice(1) - x_sliced <- x[-1] - expect_type_equal(a_sliced$type, type) - expect_identical(length(a_sliced), length(x_sliced)) - if (!inherits(type, c("ListType", "LargeListType"))) { - expect_equal(as.vector(is.na(a_sliced)), is.na(x_sliced)) - } - expect_equivalent(as.vector(a_sliced), x_sliced) - } - invisible(a) -} - test_that("Integer Array", { ints <- c(1:10, 1:10, 1:5) x <- expect_array_roundtrip(ints, int32()) @@ -131,14 +104,14 @@ test_that("Slice() and RangeEquals()", { expect_true(x$RangeEquals(z, 10, 15, 0)) # Input validation - expect_error(x$Slice("ten"), class = "Rcpp::not_compatible") + expect_error(x$Slice("ten")) expect_error(x$Slice(NA_integer_), "Slice 'offset' cannot be NA") expect_error(x$Slice(NA), "Slice 'offset' cannot be NA") - expect_error(x$Slice(10, "ten"), class = "Rcpp::not_compatible") + expect_error(x$Slice(10, "ten")) expect_error(x$Slice(10, NA_integer_), "Slice 'length' cannot be NA") expect_error(x$Slice(NA_integer_, NA_integer_), "Slice 'offset' cannot be NA") - expect_error(x$Slice(c(10, 10)), class = "Rcpp::not_compatible") - expect_error(x$Slice(10, c(10, 10)), class = "Rcpp::not_compatible") + expect_error(x$Slice(c(10, 10))) + expect_error(x$Slice(10, c(10, 10))) expect_error(x$Slice(1000), "Slice 'offset' greater than array length") expect_error(x$Slice(-1), "Slice 'offset' cannot be negative") expect_error(z$Slice(10, 10), "Slice 'offset' greater than array length") @@ -157,7 +130,7 @@ test_that("Slice() and RangeEquals()", { expect_error(x$RangeEquals(y, NA, 24), "'start_idx' cannot be NA") expect_error(x$RangeEquals(y, 10, NA), "'end_idx' cannot be NA") expect_error(x$RangeEquals(y, 10, 24, NA), "'other_start_idx' cannot be NA") - expect_error(x$RangeEquals(y, "ten", 24), class = "Rcpp::not_compatible") + expect_error(x$RangeEquals(y, "ten", 24)) # TODO (if anyone uses RangeEquals) # expect_error(x$RangeEquals(y, 10, 2400, 0)) # does not error # expect_error(x$RangeEquals(y, 1000, 24, 0)) # does not error @@ -186,10 +159,10 @@ test_that("Array supports NA", { expect_equal(as.vector(is.na(x_dbl)), c(rep(FALSE, 10), TRUE)) # Input validation - expect_error(x_int$IsValid("ten"), class = "Rcpp::not_compatible") - expect_error(x_int$IsNull("ten"), class = "Rcpp::not_compatible") - expect_error(x_int$IsValid(c(10, 10)), class = "Rcpp::not_compatible") - expect_error(x_int$IsNull(c(10, 10)), class = "Rcpp::not_compatible") + expect_error(x_int$IsValid("ten")) + expect_error(x_int$IsNull("ten")) + expect_error(x_int$IsValid(c(10, 10))) + expect_error(x_int$IsNull(c(10, 10))) expect_error(x_int$IsValid(NA), "'i' cannot be NA") expect_error(x_int$IsNull(NA), "'i' cannot be NA") expect_error(x_int$IsValid(1000), "subscript out of bounds") @@ -644,20 +617,18 @@ test_that("Array$create() handles vector -> fixed size list arrays", { }) test_that("Array$create() should have helpful error", { - verify_output(test_path("test-Array-errors.txt"), { - Array$create(list(numeric(0)), list_of(bool())) - Array$create(list(numeric(0)), list_of(int32())) - Array$create(list(integer(0)), list_of(float64())) - - lgl <- logical(0) - int <- integer(0) - num <- numeric(0) - char <- character(0) - Array$create(list()) - Array$create(list(lgl, lgl, int)) - Array$create(list(char, num, char)) - Array$create(list(int, int, num)) - }) + expect_error(Array$create(list(numeric(0)), list_of(bool())), "Expecting a logical vector") + expect_error(Array$create(list(numeric(0)), list_of(int32())), "Expecting an integer vector") + expect_error(Array$create(list(integer(0)), list_of(float64())), "Expecting a numeric vector") + + lgl <- logical(0) + int <- integer(0) + num <- numeric(0) + char <- character(0) + expect_error(Array$create(list()), "Requires at least one element to infer") + expect_error(Array$create(list(lgl, lgl, int)), "Expecting a logical vector") + expect_error(Array$create(list(char, num, char)), "Expecting a character vector") + expect_error(Array$create(list(int, int, num)), "Expecting an integer vector") }) test_that("Array$View() (ARROW-6542)", { @@ -755,8 +726,7 @@ test_that("Dictionary array: translate to R when dict isn't string", { expect_identical( as.vector(a), factor(c(3, 2, 2, 3, 1), labels = c("4.5", "3.2", "1.1")) - ), - "Coercing dictionary values from type double to R character factor levels" + ) ) }) diff --git a/r/tests/testthat/test-RecordBatch.R b/r/tests/testthat/test-RecordBatch.R index 3fceb4c5451..1a7f7eecc87 100644 --- a/r/tests/testthat/test-RecordBatch.R +++ b/r/tests/testthat/test-RecordBatch.R @@ -50,8 +50,8 @@ test_that("RecordBatch", { expect_error(batch$column_name(NA), "'i' cannot be NA") expect_error(batch$column_name(-1), "subscript out of bounds") expect_error(batch$column_name(1000), "subscript out of bounds") - expect_error(batch$column_name(1:2), class = "Rcpp::not_compatible") - expect_error(batch$column_name("one"), class = "Rcpp::not_compatible") + expect_error(batch$column_name(1:2)) + expect_error(batch$column_name("one")) col_int <- batch$column(0) expect_true(inherits(col_int, 'Array')) @@ -82,8 +82,8 @@ test_that("RecordBatch", { expect_error(batch$column(NA), "'i' cannot be NA") expect_error(batch$column(-1), "subscript out of bounds") expect_error(batch$column(1000), "subscript out of bounds") - expect_error(batch$column(1:2), class = "Rcpp::not_compatible") - expect_error(batch$column("one"), class = "Rcpp::not_compatible") + expect_error(batch$column(1:2)) + expect_error(batch$column("one")) batch2 <- batch$RemoveColumn(0) expect_equal( @@ -97,8 +97,8 @@ test_that("RecordBatch", { expect_error(batch$RemoveColumn(NA), "'i' cannot be NA") expect_error(batch$RemoveColumn(-1), "subscript out of bounds") expect_error(batch$RemoveColumn(1000), "subscript out of bounds") - expect_error(batch$RemoveColumn(1:2), class = "Rcpp::not_compatible") - expect_error(batch$RemoveColumn("one"), class = "Rcpp::not_compatible") + expect_error(batch$RemoveColumn(1:2)) + expect_error(batch$RemoveColumn("one")) }) test_that("RecordBatch S3 methods", { @@ -117,14 +117,14 @@ test_that("RecordBatch$Slice", { expect_data_frame(batch4, tbl[6:7,]) # Input validation - expect_error(batch$Slice("ten"), class = "Rcpp::not_compatible") + expect_error(batch$Slice("ten")) expect_error(batch$Slice(NA_integer_), "Slice 'offset' cannot be NA") expect_error(batch$Slice(NA), "Slice 'offset' cannot be NA") - expect_error(batch$Slice(10, "ten"), class = "Rcpp::not_compatible") + expect_error(batch$Slice(10, "ten")) expect_error(batch$Slice(10, NA_integer_), "Slice 'length' cannot be NA") expect_error(batch$Slice(NA_integer_, NA_integer_), "Slice 'offset' cannot be NA") - expect_error(batch$Slice(c(10, 10)), class = "Rcpp::not_compatible") - expect_error(batch$Slice(10, c(10, 10)), class = "Rcpp::not_compatible") + expect_error(batch$Slice(c(10, 10))) + expect_error(batch$Slice(10, c(10, 10))) expect_error(batch$Slice(1000), "Slice 'offset' greater than array length") expect_error(batch$Slice(-1), "Slice 'offset' cannot be negative") expect_error(batch4$Slice(10, 10), "Slice 'offset' greater than array length") @@ -155,7 +155,7 @@ test_that("[[ and $ on RecordBatch", { expect_vector(batch[[4]], tbl$chr) expect_null(batch$qwerty) expect_null(batch[["asdf"]]) - expect_error(batch[[c(4, 3)]], class = "Rcpp::not_compatible") + expect_error(batch[[c(4, 3)]]) expect_error(batch[[NA]], "'i' must be character or numeric, not logical") expect_error(batch[[NULL]], "'i' must be character or numeric, not NULL") expect_error(batch[[c("asdf", "jkl;")]], 'name is not a string', fixed = TRUE) diff --git a/r/tests/testthat/test-Table.R b/r/tests/testthat/test-Table.R index b26fd8ca356..bd6206ab197 100644 --- a/r/tests/testthat/test-Table.R +++ b/r/tests/testthat/test-Table.R @@ -80,14 +80,14 @@ test_that("Table $column and $field", { expect_error(tab$column(NA), "'i' cannot be NA") expect_error(tab$column(-1), "subscript out of bounds") expect_error(tab$column(1000), "subscript out of bounds") - expect_error(tab$column(1:2), class = "Rcpp::not_compatible") - expect_error(tab$column("one"), class = "Rcpp::not_compatible") + expect_error(tab$column(1:2)) + expect_error(tab$column("one")) expect_error(tab$field(NA), "'i' cannot be NA") expect_error(tab$field(-1), "subscript out of bounds") expect_error(tab$field(1000), "subscript out of bounds") - expect_error(tab$field(1:2), class = "Rcpp::not_compatible") - expect_error(tab$field("one"), class = "Rcpp::not_compatible") + expect_error(tab$field(1:2)) + expect_error(tab$field("one")) }) test_that("[, [[, $ for Table", { @@ -132,7 +132,7 @@ test_that("[, [[, $ for Table", { expect_data_frame(tab[2:4], tbl[2:4]) expect_data_frame(tab[c(1, 0)], tbl[c(1, 0)]) - expect_error(tab[[c(4, 3)]], class = "Rcpp::not_compatible") + expect_error(tab[[c(4, 3)]]) expect_error(tab[[NA]], "'i' must be character or numeric, not logical") expect_error(tab[[NULL]], "'i' must be character or numeric, not NULL") expect_error(tab[[c("asdf", "jkl;")]], 'length(name) not equal to 1', fixed = TRUE) @@ -153,14 +153,14 @@ test_that("Table$Slice", { expect_data_frame(tab3, tbl[6:7,]) # Input validation - expect_error(tab$Slice("ten"), class = "Rcpp::not_compatible") + expect_error(tab$Slice("ten")) expect_error(tab$Slice(NA_integer_), "Slice 'offset' cannot be NA") expect_error(tab$Slice(NA), "Slice 'offset' cannot be NA") - expect_error(tab$Slice(10, "ten"), class = "Rcpp::not_compatible") + expect_error(tab$Slice(10, "ten")) expect_error(tab$Slice(10, NA_integer_), "Slice 'length' cannot be NA") expect_error(tab$Slice(NA_integer_, NA_integer_), "Slice 'offset' cannot be NA") - expect_error(tab$Slice(c(10, 10)), class = "Rcpp::not_compatible") - expect_error(tab$Slice(10, c(10, 10)), class = "Rcpp::not_compatible") + expect_error(tab$Slice(c(10, 10))) + expect_error(tab$Slice(10, c(10, 10))) expect_error(tab$Slice(1000), "Slice 'offset' greater than array length") expect_error(tab$Slice(-1), "Slice 'offset' cannot be negative") expect_error(tab3$Slice(10, 10), "Slice 'offset' greater than array length") diff --git a/r/tests/testthat/test-chunked-array.R b/r/tests/testthat/test-chunked-array.R index b4695e28eed..e5d3a68e035 100644 --- a/r/tests/testthat/test-chunked-array.R +++ b/r/tests/testthat/test-chunked-array.R @@ -65,18 +65,18 @@ test_that("ChunkedArray", { # input validation expect_error(x$chunk(14), "subscript out of bounds") - expect_error(x$chunk("one"), class = "Rcpp::not_compatible") + expect_error(x$chunk("one")) expect_error(x$chunk(NA_integer_), "'i' cannot be NA") expect_error(x$chunk(-1), "subscript out of bounds") - expect_error(x$Slice("ten"), class = "Rcpp::not_compatible") + expect_error(x$Slice("ten")) expect_error(x$Slice(NA_integer_), "Slice 'offset' cannot be NA") expect_error(x$Slice(NA), "Slice 'offset' cannot be NA") - expect_error(x$Slice(10, "ten"), class = "Rcpp::not_compatible") + expect_error(x$Slice(10, "ten")) expect_error(x$Slice(10, NA_integer_), "Slice 'length' cannot be NA") expect_error(x$Slice(NA_integer_, NA_integer_), "Slice 'offset' cannot be NA") - expect_error(x$Slice(c(10, 10)), class = "Rcpp::not_compatible") - expect_error(x$Slice(10, c(10, 10)), class = "Rcpp::not_compatible") + expect_error(x$Slice(c(10, 10))) + expect_error(x$Slice(10, c(10, 10))) expect_error(x$Slice(1000), "Slice 'offset' greater than array length") expect_error(x$Slice(-1), "Slice 'offset' cannot be negative") expect_error(z$Slice(10, 10), "Slice 'offset' greater than array length") diff --git a/r/tests/testthat/test-data-type.R b/r/tests/testthat/test-data-type.R index b5b652cf289..8ff3fc36713 100644 --- a/r/tests/testthat/test-data-type.R +++ b/r/tests/testthat/test-data-type.R @@ -408,6 +408,6 @@ test_that("FixedSizeBinary", { # input validation expect_error(fixed_size_binary(NA), "'byte_width' cannot be NA") expect_error(fixed_size_binary(-1), "'byte_width' must be > 0") - expect_error(fixed_size_binary("four"), class = "Rcpp::not_compatible") - expect_error(fixed_size_binary(c(2, 4)), class = "Rcpp::not_compatible") + expect_error(fixed_size_binary("four")) + expect_error(fixed_size_binary(c(2, 4))) }) diff --git a/r/tests/testthat/test-python.R b/r/tests/testthat/test-python.R index df910169052..6184f69c923 100644 --- a/r/tests/testthat/test-python.R +++ b/r/tests/testthat/test-python.R @@ -25,6 +25,8 @@ test_that("install_pyarrow", { # Bail out if virtualenv isn't available skip_if(inherits(venv, "try-error")) expect_error(install_pyarrow("arrow-test", nightly = TRUE), NA) + # Set this up for the following tests + reticulate::use_virtualenv("arrow-test") }) test_that("Array from Python", { diff --git a/r/vignettes/install.Rmd b/r/vignettes/install.Rmd index 1415a2d3f10..77729388f21 100644 --- a/r/vignettes/install.Rmd +++ b/r/vignettes/install.Rmd @@ -303,8 +303,8 @@ By default, these are all unset. All boolean variables are case-insensitive. `NOT_CRAN=true` as part of their workflow, without requiring additional environment variables to be set. * `ARROW_R_DEV`: If set to `true`, more verbose messaging will be printed - in the build script. This variable also is needed if you're modifying `Rcpp` - code in the package: see "Editing Rcpp code" in the README. + in the build script. This variable also is needed if you're modifying C++ + code in the package: see "Editing C++ code" in the README. * `LIBARROW_DEBUG_DIR`: If the C++ library building from source fails (`cmake`), there may be messages telling you to check some log file in the build directory. However, when the library is built during R package installation,