[Rcpp-commits] r3775 - in pkg/RcppBDT: . R inst

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Sep 22 18:45:30 CEST 2012


Author: edd
Date: 2012-09-22 18:45:30 +0200 (Sat, 22 Sep 2012)
New Revision: 3775

Modified:
   pkg/RcppBDT/ChangeLog
   pkg/RcppBDT/DESCRIPTION
   pkg/RcppBDT/R/zzz.R
   pkg/RcppBDT/inst/NEWS.Rd
Log:
rewrote bdtMod modules as bdtDt in the style of the other classes 
as all access from R code was via the 'bdt' instance anyway, instantiating 'bdt' from the replacement class was all that was needed


Modified: pkg/RcppBDT/ChangeLog
===================================================================
--- pkg/RcppBDT/ChangeLog	2012-09-22 16:39:26 UTC (rev 3774)
+++ pkg/RcppBDT/ChangeLog	2012-09-22 16:45:30 UTC (rev 3775)
@@ -1,3 +1,9 @@
+2012-09-22  Dirk Eddelbuettel  <edd at debian.org>
+
+	* src/RcppBDTdt.cpp: Rewrite of the initial Date functionality in the
+	style of the three recently added classes which simplifies things
+	greatly; new class transparently replaces old class 
+
 2012-09-02  Dirk Eddelbuettel  <edd at debian.org>
 
 	* R/zzz.R: Added show() and format() methods for the ptime, du and tz

Modified: pkg/RcppBDT/DESCRIPTION
===================================================================
--- pkg/RcppBDT/DESCRIPTION	2012-09-22 16:39:26 UTC (rev 3774)
+++ pkg/RcppBDT/DESCRIPTION	2012-09-22 16:45:30 UTC (rev 3775)
@@ -16,7 +16,5 @@
 LazyLoad: yes
 Depends: Rcpp (>= 0.9.13), methods
 Imports: methods, Rcpp
-SystemRequirements: Boost 
-LinkingTo: Rcpp
-RcppModules: bdtMod
-
+LinkingTo: Rcpp, BoostHeaders
+SystemRequirements: Boost (or the BoostHeaders package)

Modified: pkg/RcppBDT/R/zzz.R
===================================================================
--- pkg/RcppBDT/R/zzz.R	2012-09-22 16:39:26 UTC (rev 3774)
+++ pkg/RcppBDT/R/zzz.R	2012-09-22 16:45:30 UTC (rev 3775)
@@ -1,7 +1,7 @@
 ##
 ## zzz.R: Loading Rcpp and Boost Date_Time glue
 ##
-## Copyright (C) 2010 - 2012 Dirk Eddelbuettel and Romain Francois
+## Copyright (C) 2010 - 2012  Dirk Eddelbuettel and Romain Francois
 ##
 ## This file is part of RcppBDT.
 ##
@@ -30,15 +30,16 @@
 ## }
 
 
-loadModule("bdtMod", TRUE)
+##loadModule("bdtMod", TRUE)
+loadModule("bdtDtMod", TRUE)
 loadModule("bdtTzMod", TRUE)
 loadModule("bdtDuMod", TRUE)
 loadModule("bdtPtMod", TRUE)
 
-## create a variable 'bdt' from out bdtMod Module
-## this variable is used as a package-global instance
+## create a variable 'bdt' from the bdtDt Module (formerly: bdtMod)
+## this variable is used as a package-global instance in some R access function
 delayedAssign( "bdt", local( {
-    x <- new( bdtDate )
+    x <- new( bdtDt )
     x$setFromUTC()
     x
 }) )
@@ -46,6 +47,9 @@
 .format_date <- function(x, ...) format(x$getDate(), ...)
 .show_date   <- function(object) print(object$getDate())
 
+.format_dt <- function(x, ...) format(x$getDate(), ...)
+.show_dt   <- function(object) print(object$getDate())
+
 .format_tz <- function(x, ...) format(x$getRegion(), ...)
 .show_tz   <- function(object) print(object$getRegion())
 
@@ -58,12 +62,12 @@
 
 ## define an onLoad expression to set some methods
 evalqOnLoad({
-    setMethod("show", "Rcpp_bdtDate", .show_date)
+    setMethod("show", "Rcpp_bdtDt", .show_dt)
     setMethod("show", "Rcpp_bdtTz", .show_tz)
     setMethod("show", "Rcpp_bdtPt", .show_pt)
     setMethod("show", "Rcpp_bdtDu", .show_du)
     setGeneric("format", function(x,...) standardGeneric("format"))
-    setMethod("format", "Rcpp_bdtDate", .format_date)
+    setMethod("format", "Rcpp_bdtDt", .format_dt)
     setMethod("format", "Rcpp_bdtTz", .format_tz)
     setMethod("format", "Rcpp_bdtPt", .format_pt)
     setMethod("format", "Rcpp_bdtDu", .format_du)

Modified: pkg/RcppBDT/inst/NEWS.Rd
===================================================================
--- pkg/RcppBDT/inst/NEWS.Rd	2012-09-22 16:39:26 UTC (rev 3774)
+++ pkg/RcppBDT/inst/NEWS.Rd	2012-09-22 16:45:30 UTC (rev 3775)
@@ -2,8 +2,11 @@
 \title{News for Package \pkg{RcppBDT}}
 \newcommand{\cpkg}{\href{http://CRAN.R-project.org/package=#1}{\pkg{#1}}}
 
-\section{Changes in version 0.2.2 (2012-09-01)}{
+\section{Changes in version 0.2.2 (2012-10-01)}{
   \itemize{
+    \item New module 'bdtDt' replacing the old 'bdtDate' module in a
+    more transparent stule using a local class which is wrapped, just like
+    the three other new classes do
     \item New module 'bdtTz' providing time zone information such as offset to
     UTC, amount of DST, abbreviated and full timezone names.
     \item New module 'bdtDu' using 'posix_time::duration' for time durations types



More information about the Rcpp-commits mailing list