Skip to content

Commit

Permalink
update design
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad1991 committed Jun 21, 2024
1 parent 88be739 commit 844224f
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 111 deletions.
1 change: 1 addition & 0 deletions R/node_classes.R
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ assign <- R6::R6Class("assign",

#' @import R6
retur <- R6::R6Class("retur",
# TODO: also wrap args in XPtr in e.g. convert. For example a subset should be copied before returned
inherit = PC,
public = list(
R_fct = NULL,
Expand Down
20 changes: 16 additions & 4 deletions development/Design.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,23 @@ auto f(bool boolScal, int intScal, double doubleScal,


```{r, eval = FALSE, echo = TRUE}
translate <- function(f,
output = "R",
# "XPtr"
types_of_args = "double",
# logical, int, double & for XPtr additionally: const logical, const int, const double
data_structures = "vector",
# scalar, vector & for XPtr additionally: borrow, ptr_vector, ptr_matrix
reference = FALSE,
# can be set to TRUE for XPtr
handle_input = "copy",
# for R can be borrow or copy & for XPtr it can be NULL and borrow
return_type = "SEXP",
# can be SEXP for R & for XPtr: maybe just use auto
verbose = FALSE,
getsource = FALSE) {
translate <- function(f, output = "R",
types_of_args = "SEXP", return_type = "SEXP",
reference = FALSE, verbose = FALSE, getsource = FALSE)
}
```


Expand Down
Loading

0 comments on commit 844224f

Please sign in to comment.