[Rcpp-commits] r4143 - in pkg/Rcpp: . inst/include inst/include/Rcpp inst/include/Rcpp/api inst/include/Rcpp/api/bones inst/include/Rcpp/internal inst/include/Rcpp/vector

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Dec 11 08:43:27 CET 2012


Author: romain
Date: 2012-12-11 08:43:27 +0100 (Tue, 11 Dec 2012)
New Revision: 4143

Added:
   pkg/Rcpp/inst/include/Rcpp/api/bones/
   pkg/Rcpp/inst/include/Rcpp/api/bones/Date.h
   pkg/Rcpp/inst/include/Rcpp/api/bones/Datetime.h
   pkg/Rcpp/inst/include/Rcpp/api/bones/bones.h
   pkg/Rcpp/inst/include/Rcpp/api/bones/wrap_extra_steps.h
Removed:
   pkg/Rcpp/inst/include/Rcpp/Date_forward.h
   pkg/Rcpp/inst/include/Rcpp/Datetime_forward.h
   pkg/Rcpp/inst/include/Rcpp/internal/wrap_forward.h
Modified:
   pkg/Rcpp/ChangeLog
   pkg/Rcpp/inst/include/Rcpp/String.h
   pkg/Rcpp/inst/include/Rcpp/vector/MatrixRow.h
   pkg/Rcpp/inst/include/RcppCommon.h
Log:
String += ( StringProxy )

Modified: pkg/Rcpp/ChangeLog
===================================================================
--- pkg/Rcpp/ChangeLog	2012-12-10 21:47:39 UTC (rev 4142)
+++ pkg/Rcpp/ChangeLog	2012-12-11 07:43:27 UTC (rev 4143)
@@ -1,3 +1,7 @@
+2012-12-11 Romain Francois <romain at r-enthusiasts.com>
+
+        * include/String.h: missing operator +=( const StringProxy& )
+
 2012-12-10  JJ Allaire <jj at rstudio.org>
 
         * R/Attributes.R: warn when depends attribute is not matched with

Deleted: pkg/Rcpp/inst/include/Rcpp/Date_forward.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Date_forward.h	2012-12-10 21:47:39 UTC (rev 4142)
+++ pkg/Rcpp/inst/include/Rcpp/Date_forward.h	2012-12-11 07:43:27 UTC (rev 4143)
@@ -1,49 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
-//
-// Date_forward.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__Date_forward_h
-#define Rcpp__Date_forward_h
-
-namespace Rcpp {
-	class Date ;
-	namespace traits{
-		template <> struct wrap_type_traits<Rcpp::Date>{
-			typedef wrap_type_primitive_tag wrap_category;
-		} ;
-		template<> struct r_type_traits<Rcpp::Date>{ 
-			typedef r_type_primitive_tag r_category ;
-		} ;
-		template<> struct r_type_traits< std::pair<const std::string,Rcpp::Date> >{ 
-			typedef r_type_primitive_tag r_category ;
-		} ;
-		template<> struct r_sexptype_traits<Rcpp::Date>{ 
-			enum{ rtype = REALSXP } ;
-		} ;
-	}
-	
-	template<> SEXP wrap_extra_steps<Rcpp::Date>( SEXP ) ;
-	namespace internal{
-		template<> double caster<Rcpp::Date,double>( Rcpp::Date from) ;
-		template<> Rcpp::Date caster<double,Rcpp::Date>( double from) ;
-	}
-}
-
-#endif

Deleted: pkg/Rcpp/inst/include/Rcpp/Datetime_forward.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/Datetime_forward.h	2012-12-10 21:47:39 UTC (rev 4142)
+++ pkg/Rcpp/inst/include/Rcpp/Datetime_forward.h	2012-12-11 07:43:27 UTC (rev 4143)
@@ -1,49 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
-//
-// Datetime_forward.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__Datetime_forward_h
-#define Rcpp__Datetime_forward_h
-
-namespace Rcpp {
-	class Datetime ;
-	namespace traits{
-		template <> struct wrap_type_traits<Rcpp::Datetime>{
-			typedef wrap_type_primitive_tag wrap_category;
-		} ;
-		template<> struct r_type_traits<Rcpp::Datetime>{ 
-			typedef r_type_primitive_tag r_category ;
-		} ;
-		template<> struct r_type_traits< std::pair<const std::string,Rcpp::Datetime> >{ 
-			typedef r_type_primitive_tag r_category ;
-		} ;
-		template<> struct r_sexptype_traits<Rcpp::Datetime>{ 
-			enum{ rtype = REALSXP } ;
-		} ;
-	}
-	
-	template<> SEXP wrap_extra_steps<Rcpp::Datetime>( SEXP ) ;
-	namespace internal{
-		template<> double caster<Rcpp::Datetime,double>( Rcpp::Datetime from) ;
-		template<> Rcpp::Datetime caster<double,Rcpp::Datetime>( double from) ;
-	}
-}
-
-#endif

Modified: pkg/Rcpp/inst/include/Rcpp/String.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/String.h	2012-12-10 21:47:39 UTC (rev 4142)
+++ pkg/Rcpp/inst/include/Rcpp/String.h	2012-12-11 07:43:27 UTC (rev 4143)
@@ -119,6 +119,15 @@
             setBuffer() ; buffer += other ; valid = false ;
             return *this ;
         }       
+        inline String& operator+=( const StringProxy& proxy){ 
+            RCPP_STRING_DEBUG( "String::operator+=( const StringProxy& )" ) ;
+            if( is_na() ) return *this ;
+            SEXP proxy_sexp = proxy ;
+            if( proxy_sexp == NA_STRING ) { data = NA_STRING ; valid = true; buffer_ready = false ; return *this ;}
+            setBuffer() ; buffer += CHAR(proxy_sexp) ; valid = false ;
+            RCPP_STRING_DEBUG_1( "String::operator+=( const StringProxy& ), buffer = %s", buffer.c_str() ) ;
+            return *this ;
+        }  
         
         // inline String& operator+=( int x     ){ data += char_nocheck(internal::r_coerce<INTSXP ,STRSXP>( x ) ) ; return *this ; }
         // inline String& operator+=( double x  ){ data += char_nocheck(internal::r_coerce<REALSXP,STRSXP>( x ) ) ; return *this ; }
@@ -126,7 +135,6 @@
         // inline String& operator+=( bool x    ){ data += char_nocheck(internal::r_coerce<LGLSXP ,STRSXP>( x ) ) ; return *this ; }
         // inline String& operator+=( Rcomplex x){ data += char_nocheck(internal::r_coerce<CPLXSXP,STRSXP>( x ) ) ; return *this ; }
         // inline String& operator+=( SEXP x){ data += CHAR(x) ; return *this ; }                              
-        // inline String& operator+=( const StringProxy& proxy){ data += CHAR(proxy.get()) ; return *this ; }  
         
         
         inline String& replace_first( const char* s, const char* news ){

Copied: pkg/Rcpp/inst/include/Rcpp/api/bones/Date.h (from rev 4138, pkg/Rcpp/inst/include/Rcpp/Date_forward.h)
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/api/bones/Date.h	                        (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/api/bones/Date.h	2012-12-11 07:43:27 UTC (rev 4143)
@@ -0,0 +1,49 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
+//
+// Date_forward.h: Rcpp R/C++ interface class library -- 
+//
+// Copyright (C) 2010 - 2012 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__api__bones__Date_h
+#define Rcpp__api__bones__Date_h
+
+namespace Rcpp {
+	class Date ;
+	namespace traits{
+		template <> struct wrap_type_traits<Rcpp::Date>{
+			typedef wrap_type_primitive_tag wrap_category;
+		} ;
+		template<> struct r_type_traits<Rcpp::Date>{ 
+			typedef r_type_primitive_tag r_category ;
+		} ;
+		template<> struct r_type_traits< std::pair<const std::string,Rcpp::Date> >{ 
+			typedef r_type_primitive_tag r_category ;
+		} ;
+		template<> struct r_sexptype_traits<Rcpp::Date>{ 
+			enum{ rtype = REALSXP } ;
+		} ;
+	}
+	
+	template<> SEXP wrap_extra_steps<Rcpp::Date>( SEXP ) ;
+	namespace internal{
+		template<> double caster<Rcpp::Date,double>( Rcpp::Date from) ;
+		template<> Rcpp::Date caster<double,Rcpp::Date>( double from) ;
+	}
+}
+
+#endif

Copied: pkg/Rcpp/inst/include/Rcpp/api/bones/Datetime.h (from rev 4138, pkg/Rcpp/inst/include/Rcpp/Datetime_forward.h)
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/api/bones/Datetime.h	                        (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/api/bones/Datetime.h	2012-12-11 07:43:27 UTC (rev 4143)
@@ -0,0 +1,49 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
+//
+// Datetime_forward.h: Rcpp R/C++ interface class library -- 
+//
+// Copyright (C) 2010 - 2012 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__api__bones__Datetime_h
+#define Rcpp__api__bones__Datetime_h
+
+namespace Rcpp {
+	class Datetime ;
+	namespace traits{
+		template <> struct wrap_type_traits<Rcpp::Datetime>{
+			typedef wrap_type_primitive_tag wrap_category;
+		} ;
+		template<> struct r_type_traits<Rcpp::Datetime>{ 
+			typedef r_type_primitive_tag r_category ;
+		} ;
+		template<> struct r_type_traits< std::pair<const std::string,Rcpp::Datetime> >{ 
+			typedef r_type_primitive_tag r_category ;
+		} ;
+		template<> struct r_sexptype_traits<Rcpp::Datetime>{ 
+			enum{ rtype = REALSXP } ;
+		} ;
+	}
+	
+	template<> SEXP wrap_extra_steps<Rcpp::Datetime>( SEXP ) ;
+	namespace internal{
+		template<> double caster<Rcpp::Datetime,double>( Rcpp::Datetime from) ;
+		template<> Rcpp::Datetime caster<double,Rcpp::Datetime>( double from) ;
+	}
+}
+
+#endif

Added: pkg/Rcpp/inst/include/Rcpp/api/bones/bones.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/api/bones/bones.h	                        (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/api/bones/bones.h	2012-12-11 07:43:27 UTC (rev 4143)
@@ -0,0 +1,29 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 4 -*-
+//
+// bones.h: Rcpp R/C++ interface class library -- 
+//
+// Copyright (C) 2010 - 2012 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__api__bones__bones_h
+#define Rcpp__api__bones__bones_h
+
+#include <Rcpp/api/bones/wrap_extra_steps.h>
+#include <Rcpp/api/bones/Date.h>
+#include <Rcpp/api/bones/Datetime.h>
+
+#endif

Copied: pkg/Rcpp/inst/include/Rcpp/api/bones/wrap_extra_steps.h (from rev 4138, pkg/Rcpp/inst/include/Rcpp/internal/wrap_forward.h)
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/api/bones/wrap_extra_steps.h	                        (rev 0)
+++ pkg/Rcpp/inst/include/Rcpp/api/bones/wrap_extra_steps.h	2012-12-11 07:43:27 UTC (rev 4143)
@@ -0,0 +1,34 @@
+// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
+/* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */
+//
+// wrap_extra_steps.h: Rcpp R/C++ interface class library -- wrap forward decl
+//
+// Copyright (C) 2010 - 2012 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__api__bones__wrap_extra_steps_h
+#define Rcpp__api__bones__wrap_extra_steps_h
+
+namespace Rcpp{
+	
+template<typename T> SEXP wrap_extra_steps( SEXP x ){
+	return x ;
+}
+
+} // Rcpp
+
+#endif

Deleted: pkg/Rcpp/inst/include/Rcpp/internal/wrap_forward.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/internal/wrap_forward.h	2012-12-10 21:47:39 UTC (rev 4142)
+++ pkg/Rcpp/inst/include/Rcpp/internal/wrap_forward.h	2012-12-11 07:43:27 UTC (rev 4143)
@@ -1,36 +0,0 @@
-// -*- mode: C++; c-indent-level: 4; c-basic-offset: 4; tab-width: 8 -*-
-/* :tabSize=4:indentSize=4:noTabs=false:folding=explicit:collapseFolds=1: */
-//
-// wrap.h: Rcpp R/C++ interface class library -- wrap implementations
-//
-// 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_internal_wrap_forward_h
-#define Rcpp_internal_wrap_forward_h
-
-#include <iterator>
-
-namespace Rcpp{
-	
-template<typename T> SEXP wrap_extra_steps( SEXP x ){
-	return x ;
-}
-
-} // Rcpp
-
-#endif

Modified: pkg/Rcpp/inst/include/Rcpp/vector/MatrixRow.h
===================================================================
--- pkg/Rcpp/inst/include/Rcpp/vector/MatrixRow.h	2012-12-10 21:47:39 UTC (rev 4142)
+++ pkg/Rcpp/inst/include/Rcpp/vector/MatrixRow.h	2012-12-11 07:43:27 UTC (rev 4143)
@@ -156,7 +156,10 @@
     typename MATRIX::iterator start ;
     int parent_nrow ;
         
-    inline int get_parent_index(int i) const { return i * parent_nrow ; } 
+    inline int get_parent_index(int i) const { 
+        RCPP_DEBUG_4( "MatrixRow<%d>[%p]::get_parent_index(%d) = %d", RTYPE, this, i, i*parent_nrow)
+        return i * parent_nrow ;
+    } 
 } ;
 
 #endif

Modified: pkg/Rcpp/inst/include/RcppCommon.h
===================================================================
--- pkg/Rcpp/inst/include/RcppCommon.h	2012-12-10 21:47:39 UTC (rev 4142)
+++ pkg/Rcpp/inst/include/RcppCommon.h	2012-12-11 07:43:27 UTC (rev 4143)
@@ -75,9 +75,7 @@
 
 
 #include <Rcpp/lang.h>
-
 #include <Rcpp/complex.h>
-
 #include <Rcpp/barrier.h>
 
 #define RcppExport extern "C"
@@ -99,11 +97,8 @@
 #include <Rcpp/internal/r_vector.h>
 #include <Rcpp/r_cast.h>
 
-#include <Rcpp/internal/wrap_forward.h>
+#include <Rcpp/api/bones/bones.h>
 
-#include <Rcpp/Date_forward.h>
-#include <Rcpp/Datetime_forward.h>
-
 #include <Rcpp/internal/export.h>
 #include <Rcpp/internal/r_coerce.h>
 #include <Rcpp/as.h>



More information about the Rcpp-commits mailing list