Skip to content

Commit a4a4627

Browse files
committed
Merge pull request #456 from RcppCore/feature/pr454-follow-up
Feature/pr454 follow up
2 parents 43831ae + e0cbf68 commit a4a4627

File tree

9 files changed

+75
-35
lines changed

9 files changed

+75
-35
lines changed

ChangeLog

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,45 @@
1+
2016-04-02 Dirk Eddelbuettel <[email protected]>
2+
3+
* DESCRIPTION: Rolled to minor version 0.12.4.3
4+
* inst/include/Rcpp/config.h: Ditto
5+
6+
* ChangeLog: Added entries for PRs 453 and 454
7+
* inst/NEWS.Rd: Add two missing \item uses
8+
9+
* R/Module.R: Rename copy to copyObject to avoid function name collisions
10+
* inst/unitTests/runit.Module.R: Ditto
11+
* man/copyObject.Rd: Ditto
12+
* inst/NEWS.Rd: Ditto
13+
* NAMESPACE: Ditto
14+
15+
* inst/unitTests/runit.environments.R: Skip test.environment.child test
16+
17+
2016-03-31 Romain Francois <[email protected]>
18+
19+
* R/Modules.R: New top-level functions copy, destruct and is_destructed
20+
* NAMESPACE: New functions copy, destruct and is_destructed exported
21+
* man/copy.Rd: New manual page
22+
* man/destruct.Rd: Ditto
23+
24+
* inst/include/Rcpp/module/class.h: Add copy constructortor + destructor
25+
* inst/include/Rcpp/module/class_Base.h: Ditto
26+
* src/Module.cpp: Ditto
27+
* src/Rcpp_init.cpp: Ditto
28+
* src/internal.h: Ditto
29+
30+
* inst/include/Rcpp/traits/traits.h: New trait detecting copy contructor
31+
* inst/include/Rcpp/traits/has_copy_constructor.h: Ditto
32+
33+
* inst/unitTests/runit.Module.R: Test new copy constructor and destructor
34+
* inst/unitTests/cpp/Module.cpp: Ditto
35+
36+
2016-03-29 Daniel C. Dillon <[email protected]>
37+
38+
* inst/include/Rcpp/String.h: Correct Rcpp::String for Rcpp::Nullable
39+
140
2016-03-27 Qin Wenfeng <[email protected]>
241

3-
* R/Attributes.R: Support R 3.3.0 Windows new toolchain
42+
* R/Attributes.R: Support new R 3.3.0 Windows toolchain
443

544
2016-03-26 Dirk Eddelbuettel <[email protected]>
645

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: Rcpp
22
Title: Seamless R and C++ Integration
3-
Version: 0.12.4.2
4-
Date: 2016-03-26
3+
Version: 0.12.4.3
4+
Date: 2016-04-02
55
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey,
66
Qiang Kou, Douglas Bates and John Chambers
77
Maintainer: Dirk Eddelbuettel <[email protected]>

NAMESPACE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export(Module,
3232
cpp_object_initializer,
3333
cpp_object_dummy,
3434
Rcpp.plugin.maker,
35-
copy,
35+
copyObject,
3636
destruct,
3737
is_destructed
3838
)

R/Module.R

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
1717

1818
internal_function <- function(pointer){
19-
f <- function(xp){
20-
force(xp)
21-
function(...){
22-
.External( InternalFunction_invoke, xp, ... )
23-
}
24-
}
25-
o <- new( "C++Function", f(pointer) )
26-
o@pointer <- pointer
27-
o
19+
f <- function(xp){
20+
force(xp)
21+
function(...){
22+
.External( InternalFunction_invoke, xp, ... )
23+
}
24+
}
25+
o <- new( "C++Function", f(pointer) )
26+
o@pointer <- pointer
27+
o
2828
}
2929

3030
setMethod("$", "C++Class", function(x, name) {
@@ -42,8 +42,8 @@ setMethod("$", "C++Class", function(x, name) {
4242
.getModulePointer <- function(module, mustStart = TRUE) {
4343
pointer <- get("pointer", envir = as.environment(module))
4444
if(is.null(pointer) && mustStart) {
45-
## should be (except for bug noted in identical())
46-
## if(identical(pointer, .badModulePointer) && mustStart) {
45+
## should be (except for bug noted in identical())
46+
## if(identical(pointer, .badModulePointer) && mustStart) {
4747
Module(module, mustStart = TRUE) # will either initialize pointer or throw error
4848
pointer <- get("pointer", envir = as.environment(module))
4949
}
@@ -438,15 +438,15 @@ cpp_fields <- function( CLASS, where){
438438
.CppClassName <- function(name)
439439
paste0("Rcpp_",name)
440440

441-
copy <- function( obj ){
442-
.Call(copy_constructor, obj$.cppclass, obj$.pointer )
441+
copyObject <- function( obj ){
442+
.Call(copy_constructor, obj$.cppclass, obj$.pointer )
443443
}
444444

445445
destruct <- function(obj){
446-
.Call(destructor, obj$.cppclass, obj$.pointer)
447-
invisible(NULL)
446+
.Call(destructor, obj$.cppclass, obj$.pointer)
447+
invisible(NULL)
448448
}
449449

450450
is_destructed <- function(obj){
451-
.Call(is_destructed_impl, obj$.pointer)
451+
.Call(is_destructed_impl, obj$.pointer)
452452
}

inst/NEWS.Rd

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,23 @@
77
\itemize{
88
\item Changes in Rcpp API:
99
\itemize{
10-
The checks for different C library implementations now also check for Musl
10+
\item The checks for different C library implementations now also check for Musl
1111
used by Alpine Linux (Sergio Marques in PR \ghpr{449}).
1212
}
1313
\item Changes in Rcpp Attributes:
1414
\itemize{
15-
R 3.3.0 Windows with Rtools 3.3 is now supported (Qin Wenfeng in PR \ghpr{451}).
15+
\item R 3.3.0 Windows with Rtools 3.3 is now supported (Qin Wenfeng in PR
16+
\ghpr{451}).
1617
}
1718
\item Changes in Rcpp Modules:
1819
\itemize{
19-
\item New function \code{copy} to invoke the copy constructor of a
20-
C++ class that has been exposed by modules.
20+
\item New function \code{copyObject} to invoke the copy constructor of a
21+
C++ class that has been exposed by modules. (\ghpr{454})
2122
\item New function \code{destruct} to explicitely call the
2223
destructor of the underlying C++ object without waiting for the
23-
garbage collector.
24+
garbage collector. (\ghpr{454})
2425
\item New function \code{is\_destructed} to check if an object has been
25-
destructed (presumably by \code{destruct} )
26+
destructed (presumably by \code{destruct}) (Romain in \ghpr{454})
2627
}
2728
}
2829
}

inst/include/Rcpp/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
#define RCPP_VERSION Rcpp_Version(0,12,4)
3131

3232
// the current source snapshot
33-
#define RCPP_DEV_VERSION RcppDevVersion(0,12,4,2)
33+
#define RCPP_DEV_VERSION RcppDevVersion(0,12,4,3)
3434

3535
#endif

inst/unitTests/runit.Module.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ if( .runThisTest && Rcpp:::capabilities()[["Rcpp modules"]] ) {
9696

9797
test.Module.copy.constructor <- function(){
9898
f <- new( ModuleCopyConstructor, 2L)
99-
g <- copy(f)
99+
g <- copyObject(f)
100100
checkEquals( f$x, g$x )
101101
checkTrue( !identical(f$.pointer, g$.pointer) )
102102
g$x <- 4L

inst/unitTests/runit.environments.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,9 @@ if (.runThisTest) {
264264
checkEquals( runit_Rcpp(), asNamespace("Rcpp") , msg = "cached Rcpp namespace" )
265265
}
266266

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

271271
test.environment.new_env <- function() {
272272
env <- new.env()

man/copy.Rd renamed to man/copyObject.Rd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
\name{copy}
2-
\alias{copy}
1+
\name{copyObject}
2+
\alias{copyObject}
33
\title{
44
Invokes the copy constructor of the C++ class
55
}
@@ -9,7 +9,7 @@
99
constructor.
1010
}
1111
\usage{
12-
copy(obj)
12+
copyObject(obj)
1313
}
1414
\arguments{
1515
\item{obj}{A C++ object from a class exposed by an Rcpp module}
@@ -42,7 +42,7 @@
4242
}
4343
')
4444
f <- new( Foo, 1 )
45-
g <- copy(f)
45+
g <- copyObject(f)
4646

4747
# f and g have the same value for the x field
4848
f$x == g$x

0 commit comments

Comments
 (0)