RInside Version 0.2.16
bar_rcpp_wrapper_definitions.h
Go to the documentation of this file.
1
#pragma once
2
3
/*
4
* These wrappers only wrap into a trivial list. More complicated objects should either
5
* map to a similar
6
*/
7
8
namespace
Rcpp
{
9
10
// Bar
11
template
<> SEXP
wrap
(
const
Bar
&bar) {
12
Rcpp::List list;
13
14
list[
"name"
] = bar.
name
;
15
list[
"foo"
] = bar.
foo
;
16
17
return
Rcpp::wrap
(list);
18
}
19
template
<>
Bar
as
(SEXP sexp) {
20
Rcpp::List list = Rcpp::as<Rcpp::List>(sexp);
21
22
return
Bar
(
23
Rcpp::as<std::string>(list[
"name"
]),
24
Rcpp::as<Foo>(list[
"foo"
])
25
);
26
}
27
}
28
Rcpp::wrap
SEXP wrap(const Bar &bar)
Definition:
bar_rcpp_wrapper_definitions.h:11
Bar
Definition:
bar.h:19
Rcpp
Definition:
bar_rcpp_wrapper_declarations.h:4
Bar::name
std::string name
Definition:
bar.h:24
Bar::foo
Foo foo
Definition:
bar.h:25
Rcpp::as
Bar as(SEXP sexp)
Definition:
bar_rcpp_wrapper_definitions.h:19
inst
examples
sandboxed_server
datatypes
bar_rcpp_wrapper_definitions.h
Generated on Wed Mar 11 2020 22:27:24 for RInside Version 0.2.16 by
1.8.13