[Rcpp-commits] r1602 - pkg/Rcpp/inst/include/Rcpp/sugar

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jun 18 15:51:48 CEST 2010


Author: romain
Date: 2010-06-18 15:51:48 +0200 (Fri, 18 Jun 2010)
New Revision: 1602

Removed:
   pkg/Rcpp/inst/include/Rcpp/sugar/LogicalResult.h
Modified:
   pkg/Rcpp/inst/include/Rcpp/sugar/Comparator.h
   pkg/Rcpp/inst/include/Rcpp/sugar/Comparator_With_One_Value.h
   pkg/Rcpp/inst/include/Rcpp/sugar/is_na.h
   pkg/Rcpp/inst/include/Rcpp/sugar/sugar_forward.h
Log:
removing the LogicalResult template (we can use the more generic VectorBase now)

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/Comparator.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/Comparator.h	2010-06-18 13:22:40 UTC (rev 1601)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/Comparator.h	2010-06-18 13:51:48 UTC (rev 1602)
@@ -26,7 +26,7 @@
 namespace sugar{
 
 template <int RTYPE, typename Operator, typename LHS_TYPE, typename RHS_TYPE>
-class Comparator : public LogicalResult< Comparator<RTYPE,Operator,LHS_TYPE,RHS_TYPE>, true > {
+class Comparator : public ::Rcpp::VectorBase< LGLSXP, true, Comparator<RTYPE,Operator,LHS_TYPE,RHS_TYPE> > {
 public:
 	typedef typename traits::storage_type<RTYPE>::type STORAGE ;
 	typedef r_binary_op<RTYPE,Operator> R_OPERATOR ;

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/Comparator_With_One_Value.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/Comparator_With_One_Value.h	2010-06-18 13:22:40 UTC (rev 1601)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/Comparator_With_One_Value.h	2010-06-18 13:51:48 UTC (rev 1602)
@@ -26,8 +26,7 @@
 namespace sugar{
 
 template <int RTYPE, typename Operator, bool na, typename VEC_TYPE>
-class Comparator_With_One_Value : 
-	public LogicalResult< Comparator_With_One_Value<RTYPE,Operator,na,VEC_TYPE>, true > {
+class Comparator_With_One_Value : public ::Rcpp::VectorBase< RTYPE, true, Comparator_With_One_Value<RTYPE,Operator,na,VEC_TYPE> > {
 public:
 	typedef typename traits::storage_type<RTYPE>::type STORAGE ;
 	typedef r_binary_op<RTYPE,Operator> R_OPERATOR ;

Deleted: pkg/Rcpp/inst/include/Rcpp/sugar/LogicalResult.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/LogicalResult.h	2010-06-18 13:22:40 UTC (rev 1601)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/LogicalResult.h	2010-06-18 13:51:48 UTC (rev 1602)
@@ -1,48 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-//
-// LogicalResult.h: Rcpp R/C++ interface class library -- 
-//
-// Copyright (C) 2010 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__sugar__LogicalResult_h
-#define Rcpp__sugar__LogicalResult_h
-
-namespace Rcpp{
-namespace sugar{  
-
-template <typename T, bool na>
-class LogicalResult : public Rcpp::VectorBase<LGLSXP,na,LogicalResult<T,na> > {
-public:
-	
-	LogicalResult() {} ;
-		
-	inline int operator[]( int i) const {
-		return static_cast<const T*>(this)->operator[]( i ) ;
-	}
-	
-	inline int size() const {
-		return static_cast<const T&>(*this).size() ;
-	}
-	
-} ;
-
-} // namespace sugar
-
-}
-
-#endif

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/is_na.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/is_na.h	2010-06-18 13:22:40 UTC (rev 1601)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/is_na.h	2010-06-18 13:51:48 UTC (rev 1602)
@@ -26,7 +26,7 @@
 namespace sugar{
 
 template <int RTYPE, bool _NA_, typename VEC_TYPE>
-class IsNa : public LogicalResult< IsNa<RTYPE,_NA_,VEC_TYPE>, false > {
+class IsNa : public ::Rcpp::VectorBase< LGLSXP, false, IsNa<RTYPE,_NA_,VEC_TYPE> > {
 public:
 	typedef typename traits::storage_type<RTYPE>::type STORAGE ;
 	typedef Rcpp::VectorBase<RTYPE,_NA_,VEC_TYPE> BASE ;
@@ -48,7 +48,7 @@
 // the result (FALSE) because it is embedded in the type
 // (the second template parameter of VectorBase)
 template <int RTYPE, typename VEC_TYPE>
-class IsNa<RTYPE,false,VEC_TYPE> : public LogicalResult< IsNa<RTYPE,false,VEC_TYPE>, false > {
+class IsNa<RTYPE,false,VEC_TYPE> : public ::Rcpp::VectorBase< LGLSXP, false, IsNa<RTYPE,false,VEC_TYPE> > {
 public:
 	typedef typename traits::storage_type<RTYPE>::type STORAGE ;
 	typedef Rcpp::VectorBase<RTYPE,false,VEC_TYPE> BASE ;

Modified: pkg/Rcpp/inst/include/Rcpp/sugar/sugar_forward.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/sugar/sugar_forward.h	2010-06-18 13:22:40 UTC (rev 1601)
+++ pkg/Rcpp/inst/include/Rcpp/sugar/sugar_forward.h	2010-06-18 13:51:48 UTC (rev 1602)
@@ -28,6 +28,5 @@
 
 // abstractions
 #include <Rcpp/sugar/SingleLogicalResult.h>
-#include <Rcpp/sugar/LogicalResult.h>
 
 #endif



More information about the Rcpp-commits mailing list