Re: [Rcpp-devel] Exposing constructors with same number of arguments with different types using Rcpp Modules

2011-05-16 Thread Jelmer Ypma
Thanks, this works for me. Jelmer On Mon, May 16, 2011 at 10:33, Romain Francois wrote: > There is a mechanism for dispatching to the appropriate constructor, but > this needs extra work from you on the C++ side. I'm currently not entirely > happy about it, and this might change in the future fo

Re: [Rcpp-devel] Exposing constructors with same number of arguments with different types using Rcpp Modules

2011-05-16 Thread Romain Francois
There is a mechanism for dispatching to the appropriate constructor, but this needs extra work from you on the C++ side. I'm currently not entirely happy about it, and this might change in the future for something nicer. Some information about it was posted on this thread: http://article.gmane

Re: [Rcpp-devel] Exposing constructors with same number of arguments with different types using Rcpp Modules

2011-05-14 Thread Jelmer Ypma
Excellent, thanks for the update. Jelmer On Sat, May 14, 2011 at 17:20, Dirk Eddelbuettel wrote: > > On 13 May 2011 at 11:58, Dirk Eddelbuettel wrote: > | On 13 May 2011 at 16:35, Jelmer Ypma wrote: > | | Dear Rcpp-list, > | | > | | I'm trying to expose multiple constructors of a C++ class to R

Re: [Rcpp-devel] Exposing constructors with same number of arguments with different types using Rcpp Modules

2011-05-14 Thread Dirk Eddelbuettel
On 13 May 2011 at 11:58, Dirk Eddelbuettel wrote: | On 13 May 2011 at 16:35, Jelmer Ypma wrote: | | Dear Rcpp-list, | | | | I'm trying to expose multiple constructors of a C++ class to R using | | modules. Here is an example of what I want to do based on the Uniform | | example [...] | | Compil

Re: [Rcpp-devel] Exposing constructors with same number of arguments with different types using Rcpp Modules

2011-05-13 Thread Jelmer Ypma
Hi Dirk, many thanks for your quick reply. Maybe something like the below could work? The different constructor specifications are defined in the list ClassName@constructors, but I coudln't find where R decides which of these functions to call. Thanks again, Jelmer overloaded.func <- function( x

Re: [Rcpp-devel] Exposing constructors with same number of arguments with different types using Rcpp Modules

2011-05-13 Thread Dirk Eddelbuettel
Hi Jelmer, On 13 May 2011 at 16:35, Jelmer Ypma wrote: | Dear Rcpp-list, | | I'm trying to expose multiple constructors of a C++ class to R using | modules. Here is an example of what I want to do based on the Uniform | example | | ===Begin: example | library('inline') | library('Rcpp') | | te

[Rcpp-devel] Exposing constructors with same number of arguments with different types using Rcpp Modules

2011-05-13 Thread Jelmer Ypma
Dear Rcpp-list, I'm trying to expose multiple constructors of a C++ class to R using modules. Here is an example of what I want to do based on the Uniform example ===Begin: example library('inline') library('Rcpp') test_code <-' using namespace Rcpp; class Uniform { public: Uniform(

Re: [Rcpp-devel] Exposing constructors

2010-11-05 Thread Romain Francois
Hi, As a follow up on yesterday's email. I've added some more code that allows multiple constructors to e registered with a simple mechanism for deciding which one is to be used. The interface has changed, the second template parameter has disapeared and constructors are now registered throu

[Rcpp-devel] Exposing constructors

2010-11-04 Thread Romain Francois
Hello, This question has come up a few times now. How can I use another constructor than the default constructor in a class exposed by Rcpp modules. I've made a few changes to Rcpp to allow that. The new restriction is that : - we can only expose one constructor (we need to think about vario