[Rcpp-commits] r4100 - in pkg/Rcpp: . inst/include inst/include/Rcpp inst/include/Rcpp/vector src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Dec 6 12:04:12 CET 2012
Author: romain
Date: 2012-12-06 12:04:11 +0100 (Thu, 06 Dec 2012)
New Revision: 4100
Removed:
pkg/Rcpp/inst/include/Rcpp/vector/eval_methods.h
Modified:
pkg/Rcpp/ChangeLog
pkg/Rcpp/inst/include/Rcpp/Environment.h
pkg/Rcpp/inst/include/Rcpp/Evaluator.h
pkg/Rcpp/inst/include/Rcpp/Vector.h
pkg/Rcpp/inst/include/Rcpp/vector/00_forward_eval_methods.h
pkg/Rcpp/inst/include/RcppCommon.h
pkg/Rcpp/src/Environment.cpp
pkg/Rcpp/src/Evaluator.cpp
Log:
more work on headers
Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog 2012-12-06 09:49:18 UTC (rev 4099)
+++ pkg/Rcpp/ChangeLog 2012-12-06 11:04:11 UTC (rev 4100)
@@ -4,6 +4,8 @@
* src/exceptions.cpp: include config so that it knows that Rcpp can
demangle
* unitTests/runit.environments.R: using sourceCpp
+ * src/Environment.cpp: less includes
+ * src/Evaluator.cpp: less includes
2012-12-05 Romain Francois <romain at r-enthusiasts.com>
Modified: pkg/Rcpp/inst/include/Rcpp/Environment.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Environment.h 2012-12-06 09:49:18 UTC (rev 4099)
+++ pkg/Rcpp/inst/include/Rcpp/Environment.h 2012-12-06 11:04:11 UTC (rev 4100)
@@ -22,12 +22,6 @@
#ifndef Rcpp_Environment_h
#define Rcpp_Environment_h
-#include <RcppCommon.h>
-#include <Rcpp/exceptions.h>
-#include <Rcpp/Evaluator.h>
-#include <Rcpp/Symbol.h>
-#include <Rcpp/Language.h>
-
#include <Rcpp/RObject.h>
namespace Rcpp{
Modified: pkg/Rcpp/inst/include/Rcpp/Evaluator.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Evaluator.h 2012-12-06 09:49:18 UTC (rev 4099)
+++ pkg/Rcpp/inst/include/Rcpp/Evaluator.h 2012-12-06 11:04:11 UTC (rev 4100)
@@ -2,7 +2,7 @@
//
// Evaluator.h: Rcpp R/C++ interface class library -- protected evaluation
//
-// Copyright (C) 2009 - 2011 Dirk Eddelbuettel and Romain Francois
+// Copyright (C) 2009 - 2012 Dirk Eddelbuettel and Romain Francois
//
// This file is part of Rcpp.
//
@@ -22,8 +22,8 @@
#ifndef Rcpp_Evaluator_h
#define Rcpp_Evaluator_h
-#include <RcppCommon.h>
-#include <Rcpp/Environment.h>
+#define R_NO_REMAP
+#include <Rinternals.h>
namespace Rcpp{
Modified: pkg/Rcpp/inst/include/Rcpp/Vector.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Vector.h 2012-12-06 09:49:18 UTC (rev 4099)
+++ pkg/Rcpp/inst/include/Rcpp/Vector.h 2012-12-06 11:04:11 UTC (rev 4100)
@@ -52,7 +52,6 @@
#include <Rcpp/vector/Vector.h>
#include <Rcpp/vector/proxy.h>
-#include <Rcpp/vector/eval_methods.h>
#include <Rcpp/vector/traits.h>
#include <Rcpp/vector/Matrix.h>
Modified: pkg/Rcpp/inst/include/Rcpp/vector/00_forward_eval_methods.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/00_forward_eval_methods.h 2012-12-06 09:49:18 UTC (rev 4099)
+++ pkg/Rcpp/inst/include/Rcpp/vector/00_forward_eval_methods.h 2012-12-06 11:04:11 UTC (rev 4100)
@@ -51,7 +51,11 @@
}
template <int RTYPE> class eval_methods {} ;
- template <> class eval_methods<EXPRSXP> ;
-
+ template <> class eval_methods<EXPRSXP> {
+ public:
+ SEXP eval() ;
+ SEXP eval(SEXP) ;
+ } ;
+
}
#endif
Deleted: pkg/Rcpp/inst/include/Rcpp/vector/eval_methods.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/eval_methods.h 2012-12-06 09:49:18 UTC (rev 4099)
+++ pkg/Rcpp/inst/include/Rcpp/vector/eval_methods.h 2012-12-06 11:04:11 UTC (rev 4100)
@@ -1,46 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
-//
-// eval_methods.h: Rcpp R/C++ interface class library --
-//
-// Copyright (C) 2010 - 2011 Dirk Eddelbuettel and Romain Francois
-//
-// This file is part of Rcpp.
-//
-// Rcpp is free software: you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 2 of the License, or
-// (at your option) any later version.
-//
-// Rcpp is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
-
-#ifndef Rcpp__vector__eval_methods_h
-#define Rcpp__vector__eval_methods_h
-
-namespace internal{
-
- template <int RTYPE> class expr_eval_methods {
- public:
- typedef Rcpp::Vector<RTYPE> VECTOR ;
-
- SEXP eval(){
- SEXP xp = ( static_cast<VECTOR&>(*this) ).asSexp() ;
- SEXP evalSym = Rf_install( "eval" );
- return try_catch( Rf_lang2( evalSym, xp ) ) ;
- } ;
- SEXP eval( const ::Rcpp::Environment& env ){
- SEXP xp = ( static_cast<VECTOR&>(*this) ).asSexp() ;
- SEXP evalSym = Rf_install( "eval" );
- return try_catch( Rf_lang3( evalSym, xp, env.asSexp() ) ) ;
- } ;
- } ;
-
- template<> class eval_methods<EXPRSXP> : public expr_eval_methods<EXPRSXP> {} ;
-
-}
-#endif
Modified: pkg/Rcpp/inst/include/RcppCommon.h
===================================================================
--- pkg/Rcpp/inst/include/RcppCommon.h 2012-12-06 09:49:18 UTC (rev 4099)
+++ pkg/Rcpp/inst/include/RcppCommon.h 2012-12-06 11:04:11 UTC (rev 4100)
@@ -219,7 +219,7 @@
#define R_NO_REMAP
#include <R.h>
#include <Rinternals.h>
-#include <R_ext/Callbacks.h>
+// #include <R_ext/Callbacks.h>
#include <R_ext/Complex.h>
#include <R_ext/Parse.h>
#include <R_ext/Rdynload.h>
Modified: pkg/Rcpp/src/Environment.cpp
===================================================================
--- pkg/Rcpp/src/Environment.cpp 2012-12-06 09:49:18 UTC (rev 4099)
+++ pkg/Rcpp/src/Environment.cpp 2012-12-06 11:04:11 UTC (rev 4100)
@@ -19,8 +19,14 @@
// You should have received a copy of the GNU General Public License
// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
+#include <Rcpp/RObject.h>
#include <Rcpp/Environment.h>
+#include <Rcpp/Evaluator.h>
+#include <Rcpp/exceptions.h>
+#include <R_ext/Callbacks.h>
+#include <Rcpp/cache.h>
+
namespace Rcpp {
Environment::Environment() : RObject(R_GlobalEnv){}
Modified: pkg/Rcpp/src/Evaluator.cpp
===================================================================
--- pkg/Rcpp/src/Evaluator.cpp 2012-12-06 09:49:18 UTC (rev 4099)
+++ pkg/Rcpp/src/Evaluator.cpp 2012-12-06 11:04:11 UTC (rev 4100)
@@ -19,7 +19,11 @@
// You should have received a copy of the GNU General Public License
// along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
+#include <Rcpp/Vector.h>
#include <Rcpp/Evaluator.h>
+#include <Rcpp/Environment.h>
+#include <Rcpp/routines.h>
+#include <Rcpp/exceptions.h>
namespace Rcpp {
@@ -85,6 +89,20 @@
return Evaluator::run(expr) ;
}
+ SEXP eval_methods<EXPRSXP>::eval(){
+ SEXP xp = ( static_cast<ExpressionVector&>(*this) ).asSexp() ;
+ SEXP evalSym = Rf_install( "eval" );
+ return try_catch( Rf_lang2( evalSym, xp ) ) ;
+ }
+
+ SEXP eval_methods<EXPRSXP>::eval( SEXP env ){
+ SEXP xp = ( static_cast<ExpressionVector&>(*this) ).asSexp() ;
+ SEXP evalSym = Rf_install( "eval" );
+ return try_catch( Rf_lang3( evalSym, xp, env ) ) ;
+ }
+
+
} // namespace internal
+
} // namespace Rcpp
More information about the Rcpp-commits
mailing list