Skip to content

Commit 5cf50bc

Browse files
committed
fixed loadRcppClass to search in module for Class instead of CppClass
1 parent 12f3c03 commit 5cf50bc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

R/RcppClass.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ loadRcppClass <- function(Class, CppClass = Class,
5353
}
5454
mod <- loadModule(module, NULL, env = where, loadNow = TRUE)
5555
storage <- get("storage", envir = as.environment(mod))
56-
if(exists(CppClass, envir = storage, inherits = FALSE)) {
57-
cppclassinfo <- get(CppClass, envir = storage)
56+
if(exists(Class, envir = storage, inherits = FALSE)) {
57+
cppclassinfo <- get(Class, envir = storage)
5858
if(!is(cppclassinfo, "C++Class"))
59-
stop(gettextf("Object \"%s\" in module \"%s\" is not a C++ class description", CppClass, module))
59+
stop(gettextf("Object \"%s\" in module \"%s\" is not a C++ class description", Class, module))
6060
}
6161
else
62-
stop(gettextf("No object \"%s\" in module \"%s\"", CppClass, module))
62+
stop(gettextf("No object \"%s\" in module \"%s\"", Class, module))
6363
allmethods <- .makeCppMethods(methods, cppclassinfo, where)
6464
allfields <- .makeCppFields(fields, cppclassinfo, where)
6565
value <- setRefClass(Class, fields = allfields,

inst/unitTests/testRcppClass/src/stdVector.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ RCPP_MODULE(stdVector){
3636
using namespace Rcpp ;
3737

3838
// we expose the class std::vector<double> as "vec" on the R side
39-
class_<vec>( "vec")
39+
class_<vec>( "stdNumeric")
4040

4141
// exposing the default constructor
4242
.constructor()

0 commit comments

Comments
 (0)