Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,45 @@
2016-04-02 Dirk Eddelbuettel <edd@debian.org>

* DESCRIPTION: Rolled to minor version 0.12.4.3
* inst/include/Rcpp/config.h: Ditto

* ChangeLog: Added entries for PRs 453 and 454
* inst/NEWS.Rd: Add two missing \item uses

* R/Module.R: Rename copy to copyObject to avoid function name collisions
* inst/unitTests/runit.Module.R: Ditto
* man/copyObject.Rd: Ditto
* inst/NEWS.Rd: Ditto
* NAMESPACE: Ditto

* inst/unitTests/runit.environments.R: Skip test.environment.child test

2016-03-31 Romain Francois <romain@r-enthusiasts.com>

* R/Modules.R: New top-level functions copy, destruct and is_destructed
* NAMESPACE: New functions copy, destruct and is_destructed exported
* man/copy.Rd: New manual page
* man/destruct.Rd: Ditto

* inst/include/Rcpp/module/class.h: Add copy constructortor + destructor
* inst/include/Rcpp/module/class_Base.h: Ditto
* src/Module.cpp: Ditto
* src/Rcpp_init.cpp: Ditto
* src/internal.h: Ditto

* inst/include/Rcpp/traits/traits.h: New trait detecting copy contructor
* inst/include/Rcpp/traits/has_copy_constructor.h: Ditto

* inst/unitTests/runit.Module.R: Test new copy constructor and destructor
* inst/unitTests/cpp/Module.cpp: Ditto

2016-03-29 Daniel C. Dillon <dcdillon@gmail.com>

* inst/include/Rcpp/String.h: Correct Rcpp::String for Rcpp::Nullable

2016-03-27 Qin Wenfeng <mail@qinwenfeng.com>

* R/Attributes.R: Support R 3.3.0 Windows new toolchain
* R/Attributes.R: Support new R 3.3.0 Windows toolchain

2016-03-26 Dirk Eddelbuettel <edd@debian.org>

Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: Rcpp
Title: Seamless R and C++ Integration
Version: 0.12.4.2
Date: 2016-03-26
Version: 0.12.4.3
Date: 2016-04-02
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey,
Qiang Kou, Douglas Bates and John Chambers
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Expand Down
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export(Module,
cpp_object_initializer,
cpp_object_dummy,
Rcpp.plugin.maker,
copy,
copyObject,
destruct,
is_destructed
)
Expand Down
32 changes: 16 additions & 16 deletions R/Module.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.

internal_function <- function(pointer){
f <- function(xp){
force(xp)
function(...){
.External( InternalFunction_invoke, xp, ... )
}
}
o <- new( "C++Function", f(pointer) )
o@pointer <- pointer
o
f <- function(xp){
force(xp)
function(...){
.External( InternalFunction_invoke, xp, ... )
}
}
o <- new( "C++Function", f(pointer) )
o@pointer <- pointer
o
}

setMethod("$", "C++Class", function(x, name) {
Expand All @@ -42,8 +42,8 @@ setMethod("$", "C++Class", function(x, name) {
.getModulePointer <- function(module, mustStart = TRUE) {
pointer <- get("pointer", envir = as.environment(module))
if(is.null(pointer) && mustStart) {
## should be (except for bug noted in identical())
## if(identical(pointer, .badModulePointer) && mustStart) {
## should be (except for bug noted in identical())
## if(identical(pointer, .badModulePointer) && mustStart) {
Module(module, mustStart = TRUE) # will either initialize pointer or throw error
pointer <- get("pointer", envir = as.environment(module))
}
Expand Down Expand Up @@ -438,15 +438,15 @@ cpp_fields <- function( CLASS, where){
.CppClassName <- function(name)
paste0("Rcpp_",name)

copy <- function( obj ){
.Call(copy_constructor, obj$.cppclass, obj$.pointer )
copyObject <- function( obj ){
.Call(copy_constructor, obj$.cppclass, obj$.pointer )
}

destruct <- function(obj){
.Call(destructor, obj$.cppclass, obj$.pointer)
invisible(NULL)
.Call(destructor, obj$.cppclass, obj$.pointer)
invisible(NULL)
}

is_destructed <- function(obj){
.Call(is_destructed_impl, obj$.pointer)
.Call(is_destructed_impl, obj$.pointer)
}
13 changes: 7 additions & 6 deletions inst/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@
\itemize{
\item Changes in Rcpp API:
\itemize{
The checks for different C library implementations now also check for Musl
\item The checks for different C library implementations now also check for Musl
used by Alpine Linux (Sergio Marques in PR \ghpr{449}).
}
\item Changes in Rcpp Attributes:
\itemize{
R 3.3.0 Windows with Rtools 3.3 is now supported (Qin Wenfeng in PR \ghpr{451}).
\item R 3.3.0 Windows with Rtools 3.3 is now supported (Qin Wenfeng in PR
\ghpr{451}).
}
\item Changes in Rcpp Modules:
\itemize{
\item New function \code{copy} to invoke the copy constructor of a
C++ class that has been exposed by modules.
\item New function \code{copyObject} to invoke the copy constructor of a
C++ class that has been exposed by modules. (\ghpr{454})
\item New function \code{destruct} to explicitely call the
destructor of the underlying C++ object without waiting for the
garbage collector.
garbage collector. (\ghpr{454})
\item New function \code{is\_destructed} to check if an object has been
destructed (presumably by \code{destruct} )
destructed (presumably by \code{destruct}) (Romain in \ghpr{454})
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion inst/include/Rcpp/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
#define RCPP_VERSION Rcpp_Version(0,12,4)

// the current source snapshot
#define RCPP_DEV_VERSION RcppDevVersion(0,12,4,2)
#define RCPP_DEV_VERSION RcppDevVersion(0,12,4,3)

#endif
2 changes: 1 addition & 1 deletion inst/unitTests/runit.Module.R
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ if( .runThisTest && Rcpp:::capabilities()[["Rcpp modules"]] ) {

test.Module.copy.constructor <- function(){
f <- new( ModuleCopyConstructor, 2L)
g <- copy(f)
g <- copyObject(f)
checkEquals( f$x, g$x )
checkTrue( !identical(f$.pointer, g$.pointer) )
g$x <- 4L
Expand Down
6 changes: 3 additions & 3 deletions inst/unitTests/runit.environments.R
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ if (.runThisTest) {
checkEquals( runit_Rcpp(), asNamespace("Rcpp") , msg = "cached Rcpp namespace" )
}

test.environment.child <- function(){
checkEquals( parent.env(runit_child()), globalenv(), msg = "child environment" )
}
#test.environment.child <- function(){
# checkEquals( parent.env(runit_child()), globalenv(), msg = "child environment" )
#}

test.environment.new_env <- function() {
env <- new.env()
Expand Down
8 changes: 4 additions & 4 deletions man/copy.Rd → man/copyObject.Rd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
\name{copy}
\alias{copy}
\name{copyObject}
\alias{copyObject}
\title{
Invokes the copy constructor of the C++ class
}
Expand All @@ -9,7 +9,7 @@
constructor.
}
\usage{
copy(obj)
copyObject(obj)
}
\arguments{
\item{obj}{A C++ object from a class exposed by an Rcpp module}
Expand Down Expand Up @@ -42,7 +42,7 @@
}
')
f <- new( Foo, 1 )
g <- copy(f)
g <- copyObject(f)

# f and g have the same value for the x field
f$x == g$x
Expand Down