[Rcpp-devel] Rcpp modules: Classes as arguments

2011-06-14 Thread Jonas Rauch
On a related note to the question on derived classes I sent yesterday, here is another interesting idea. Assume I have classes class Foo { ... }; class Bar { ... //pass Foo pointer as parameter void myMethod(Foo* X) { ... } //or Foo reference void myMethod2(Fo

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-06-14 Thread Jonas Rauch
Actually, having just the declaration like this compiled fine but and ended up in an unresolved symbol when loading the library. class Bar : public Foo { ... void doSomething(); void Action() { [some code here] } }; I actually had to implement doSomething and explicitly

Re: [Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-06-14 Thread Dirk Eddelbuettel
Hi Jonas, On 14 June 2011 at 19:06, Jonas Rauch wrote: | I am trying to write an R interface to a library that uses derived classes in | the following manner: | | class Foo { |     ... |     virtual void Action() = 0; |     void doSomething() { |     Action(); |     [do complicated stuff

[Rcpp-devel] Rcpp modules: Derived class - exposing method from base class?

2011-06-14 Thread Jonas Rauch
Hello everyone. I am trying to write an R interface to a library that uses derived classes in the following manner: class Foo { ... virtual void Action() = 0; void doSomething() { Action(); [do complicated stuff] } ... }; class Bar : public Foo { ... v