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
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
Package: Rcpp
Title: Seamless R and C++ Integration
Version: 0.12.4.4
Date: 2016-04-13
Version: 0.12.4.5
Date: 2016-04-15
Author: Dirk Eddelbuettel, Romain Francois, JJ Allaire, Kevin Ushey,
Qiang Kou, Douglas Bates and John Chambers
Maintainer: Dirk Eddelbuettel <edd@debian.org>
Description: The 'Rcpp' package provides R functions as well as C++ classes which
offer a seamless integration of R and C++. Many R data types and objects can be
mapped back and forth to C++ equivalents which facilitates both writing of new
code as well as easier integration of third-party libraries. Documentation
about 'Rcpp' is provided by several vignettes included in this package, via the
'Rcpp Gallery' site at <http://gallery.rcpp.org>, the paper by Eddelbuettel and
Francois (2011, JSS), and the book by Eddelbuettel (2013, Springer); see
code as well as easier integration of third-party libraries. Documentation
about 'Rcpp' is provided by several vignettes included in this package, via the
'Rcpp Gallery' site at <http://gallery.rcpp.org>, the paper by Eddelbuettel and
Francois (2011, JSS), and the book by Eddelbuettel (2013, Springer); see
'citation("Rcpp")' for details on these last two.
Depends: R (>= 3.0.0)
Imports: methods, utils
Expand Down
9 changes: 4 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ export(Module,
demangle,
sizeof,
cpp_object_initializer,
cpp_object_dummy,
Rcpp.plugin.maker,
copyObject,
destruct,
is_destructed
cpp_object_dummy,
Rcpp.plugin.maker
)
S3method( print, bytes )
exportClass(RcppClass)


17 changes: 3 additions & 14 deletions R/Module.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2010 - 2016 John Chambers, Dirk Eddelbuettel and Romain Francois
# Copyright (C) 2010 - 2014 John Chambers, Dirk Eddelbuettel and Romain Francois
#
# This file is part of Rcpp.
#
Expand Down Expand Up @@ -128,6 +128,7 @@ new_CppObject_xp <- function(module, pointer, ...) {
new_dummyObject <- function(...)
.External( class__dummyInstance, ...)


# class method for $initialize
cpp_object_initializer <- function(.self, .refClassDef, ..., .object_pointer){
selfEnv <- as.environment(.self)
Expand Down Expand Up @@ -435,18 +436,6 @@ cpp_fields <- function( CLASS, where){
sapply( CLASS@fields, binding_maker, where = where )
}

.CppClassName <- function(name)
.CppClassName <- function(name) {
paste0("Rcpp_",name)

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

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

is_destructed <- function(obj){
.Call(is_destructed_impl, obj$.pointer)
}
41 changes: 17 additions & 24 deletions inst/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,12 @@
}
\item Changes in Rcpp Modules:
\itemize{
\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. (\ghpr{454})
\item New function \code{is\_destructed} to check if an object has been
destructed (presumably by \code{destruct}) (Romain in \ghpr{454})
\item An apparent race condition in Module loading seen with R 3.3.0 was
fixed (Ben Goodrich in \ghpr{461} fixing \ghit{458}).
}
}
}

\section{Changes in Rcpp version 0.12.4 (2016-03-22)}{
\itemize{
\item Changes in Rcpp API:
Expand Down Expand Up @@ -78,13 +71,13 @@
\ghpr{406} by Qiang fixing \ghit{365}).
\item A missing \code{std::hash} function interface for
\code{Rcpp::String} has been addded (PR \ghpr{408} by Qiang fixing
\ghit{84}).
\ghit{84}).
}
\item Changes in Rcpp Attributes:
\itemize{
\item Avoid invalid function names when generating C++ interfaces (PR
\ghpr{403} by JJ fixing \ghit{402}).
\item Insert additional space around \code{&} in function interface (PR
\item Insert additional space around \code{&} in function interface (PR
\ghpr{400} by Kazuki Fukui fixing \ghit{278}).
}
\item Changes in Rcpp Modules:
Expand All @@ -108,7 +101,7 @@
by Florian)
\item Before creating a single String object from a \code{SEXP}, ensure
that it is from a vector of length one (PR \ghpr{376} by Dirk, fixing
\ghit{375}).
\ghit{375}).
\item No longer use \code{STRING_ELT} as a left-hand side, thanks to a
heads-up by Luke Tierney (PR \ghpr{378} by Dirk, fixing \ghit{377}).
\item Rcpp Module objects are now checked more carefully (PR \ghpr{381}
Expand All @@ -120,7 +113,7 @@
\item \code{operator<<()} now always shows decimal points (PR \ghpr{396}
by Dan)
\item Matrix classes now have a \code{transpose()} function (PR \ghpr{397}
by Dirk fixing \ghit{383})
by Dirk fixing \ghit{383})
\item \code{operator<<()} for complex types was added (PRs \ghpr{398} by
Qiang and \ghpr{399} by Dirk, fixing \ghit{187})
}
Expand All @@ -138,20 +131,20 @@
\item Changes in Rcpp Documentation:
\itemize{
\item The \code{NEWS} file now links to GitHub issue tickets and pull
requests.
requests.
\item The \code{Rcpp.bib} file with bibliographic references was updated.
}
}
}

\section{Changes in Rcpp version 0.12.1 (2015-09-10)}{
\itemize{
\item Changes in Rcpp API:
\itemize{
\item Correct use of WIN32 instead of _WIN32 to please Windows 10
\item Correct use of WIN32 instead of _WIN32 to please Windows 10
\item Add an assignment operator to \code{DimNameProxy} (PR \ghpr{339} by Florian)
\item Add vector and matrix accessors \code{.at()} with bounds checking
(PR \ghpr{342} by Florian)
(PR \ghpr{342} by Florian)
\item Correct character vector conversion from single char (PR \ghpr{344} by
Florian fixing issue \ghit{343})
\item Correct on use of \code{R_xlen_t} back to \code{size_t} (PR \ghpr{348} by
Expand Down Expand Up @@ -199,13 +192,13 @@
R expressions; this should resolve errors where calling handlers (e.g.
through \code{suppressMessages()}) were not properly respected.
\item All internal length variables have been changed from \code{R_len_t}
to \code{R_xlen_t} to support vectors longer than 2^31-1 elements (via
to \code{R_xlen_t} to support vectors longer than 2^31-1 elements (via
PR \ghpr{303} by Qiang Kou).
\item The sugar function \code{sapply} now supports lambda functions
(addressing \ghit{213} thanks to Matt Dziubinski)
\item The \code{var} sugar function now uses a more robust two-pass
method, supports complex numbers, with new unit tests added (via PR
\ghpr{320} by Matt Dziubinski)
\ghpr{320} by Matt Dziubinski)
\item \code{String} constructors now allow encodings (via PR \ghpr{310}
by Qiang Kou)
\item \code{String} objects are preserving the underlying \code{SEXP}
Expand All @@ -214,7 +207,7 @@
\item DataFrame constructors are now a little more careful (via PR
\ghpr{301} by Romain Francois)
\item For R 3.2.0 or newer, \code{Rf_installChar()} is used instead of
\code{Rf_install(CHAR())} (via PR \ghpr{332}).
\code{Rf_install(CHAR())} (via PR \ghpr{332}).
}
\item Changes in Rcpp Attributes:
\itemize{
Expand Down Expand Up @@ -246,7 +239,7 @@
matrices (via a pull request by Dmitrii Meleshko).
\item A new \code{empty()} string constructor was added (via another pull
request).
\item Better support for Vectors with a storage policy different from the
\item Better support for Vectors with a storage policy different from the
default, i.e. \code{NoProtectStorage}, was added.
}
\item Changes in Rcpp Attributes:
Expand All @@ -271,16 +264,16 @@
\item The \code{Rcpp::Environment} constructor can now use a supplied
parent environment.
\item The \code{Rcpp::Function} constructor can now use a supplied
environment or namespace.
environment or namespace.
\item The \code{attributes_hidden} macro from R is used to shield internal
functions; the \code{R_ext/Visibility.h} header is now included as well.
\item A \code{Rcpp::print} function was added as a wrapper around \code{Rf_PrintValue}.
\item A \code{Rcpp::print} function was added as a wrapper around \code{Rf_PrintValue}.
}
\item Changes in Rcpp Attributes:
\itemize{
\item The \code{pkg_types.h} file is now included in \code{RcppExports.cpp}
if it is present in either the \code{inst/include} or \code{src}.
\item \code{sourceCpp} was modified to allow includes of local files
if it is present in either the \code{inst/include} or \code{src}.
\item \code{sourceCpp} was modified to allow includes of local files
(e.g. \code{#include "foo.hpp"}). Implementation files (*.cc; *.cpp) corresponding
to local includes are also automatically built if they exist.
\item The generated attributes code was simplified with respect to
Expand Down
3 changes: 2 additions & 1 deletion inst/include/Rcpp/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define RCPP_VERSION Rcpp_Version(0,12,4)

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

#endif

35 changes: 3 additions & 32 deletions inst/include/Rcpp/module/class.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// class.h: Rcpp R/C++ interface class library -- Rcpp modules
//
// Copyright (C) 2012 - 2016 Dirk Eddelbuettel and Romain Francois
// Copyright (C) 2012 - 2013 Dirk Eddelbuettel and Romain Francois
//
// This file is part of Rcpp.
//
Expand All @@ -22,21 +22,6 @@
#ifndef Rcpp_Module_CLASS_h
#define Rcpp_Module_CLASS_h

template <typename Class, bool ok>
struct CopyConstructor {
static Class* get( Class* obj ){
return new Class(*obj) ;
}
} ;

template <typename Class>
struct CopyConstructor<Class,false> {
static Class* get( Class* obj){
stop("no copy constructor available") ;
return obj ;
}
} ;

template <typename Class>
class class_ : public class_Base {
public:
Expand Down Expand Up @@ -161,22 +146,7 @@

throw std::range_error( "no valid constructor available for the argument list" ) ;
END_RCPP
}

SEXP invoke_copy_constructor( SEXP object ){
BEGIN_RCPP
XP xp(object) ;
return internal::make_new_object<Class>( CopyConstructor< Class, traits::has_copy_constructor<Class>::value >::get(xp) ) ;
END_RCPP
}

SEXP invoke_destructor(SEXP object) {
BEGIN_RCPP
run_finalizer(object);
XP(object).release() ;
return R_NilValue ;
END_RCPP
}
}

bool has_default_constructor(){
int n = constructors.size() ;
Expand Down Expand Up @@ -507,6 +477,7 @@
self* class_pointer ;
std::string typeinfo_name ;


class_( ) : class_Base(), vec_methods(), properties(), specials(0), constructors(), factories() {};


Expand Down
6 changes: 2 additions & 4 deletions inst/include/Rcpp/module/class_Base.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// class_Base.h: Rcpp R/C++ interface class library -- Rcpp modules
//
// Copyright (C) 2012 - 2016 Dirk Eddelbuettel and Romain Francois
// Copyright (C) 2012 - 2013 Dirk Eddelbuettel and Romain Francois
//
// This file is part of Rcpp.
//
Expand Down Expand Up @@ -37,8 +37,6 @@ class class_Base {

virtual void run_finalizer(SEXP){ }

virtual SEXP invoke_copy_constructor(SEXP) = 0 ;
virtual SEXP invoke_destructor(SEXP) = 0 ;
virtual bool has_default_constructor(){ return false ; }
virtual bool has_method( const std::string& ){
return false ;
Expand Down Expand Up @@ -82,7 +80,7 @@ class class_Base {
}
void add_enum( const std::string& enum_name, const std::map<std::string, int>& value ){
enums.insert( ENUM_MAP_PAIR( enum_name, value ) ) ;
}
}

std::string name ;
std::string docstring ;
Expand Down
41 changes: 0 additions & 41 deletions inst/include/Rcpp/traits/has_copy_constructor.h

This file was deleted.

4 changes: 2 additions & 2 deletions inst/include/Rcpp/traits/traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//
// traits.h: Rcpp R/C++ interface class library -- traits to help wrap
//
// Copyright (C) 2012 - 2016 Dirk Eddelbuettel and Romain Francois
// Copyright (C) 2012 - 2013 Dirk Eddelbuettel and Romain Francois
//
// This file is part of Rcpp.
//
Expand Down Expand Up @@ -44,7 +44,6 @@ struct int2type { enum { value = I }; };
#include <Rcpp/traits/named_object.h>
#include <Rcpp/traits/is_convertible.h>
#include <Rcpp/traits/has_iterator.h>
#include <Rcpp/traits/has_copy_constructor.h>
#include <Rcpp/traits/expands_to_logical.h>
#include <Rcpp/traits/matrix_interface.h>
#include <Rcpp/traits/is_sugar_expression.h>
Expand Down Expand Up @@ -78,3 +77,4 @@ struct int2type { enum { value = I }; };
#include <Rcpp/traits/is_primitive.h>

#endif

Loading