Skip to content
Prev 5396 / 10988 Next

[Rcpp-devel] reference classes in C++ :is it possible?

Hi Dirk,

yes it would,

1) my_class::my_method delegates to ReferenceClass::my_method  [c++ method
exported]
2) ReferenceClass(R)::my_method callSuper() --> [ infinite recursion!!! ]
3) smoke + possible explosion + ... random events from HR department

or some benefits:
1) my_class::my_method delegates to ReferenceClass::my_method
2) ReferenceClass(R)::my_method ( works hard to solve some problem )
3) abstract class with R reference class impl

This is still based on the assumption that one can call a ReferenceClass
method... if so this may open up a door to design interfaces in c++ and
implementing them in R. With some limitations: my_class::my_method()=0;
would need some stub generated and linked to call R reference class. (if
that possible at all)

I don't not have the necessary experience to oversee all the implications
of a feature/bug outlined; but find it an appealing thought to able to
extend a c++ class in R where c++ runtime has the ability to call the R
implementation.

[c++ Interface_a]  ---> [c++ Abstract_ab  ] ---> Rcpp_export  -> | R
c_runtime | -> [ RrefClass  impl_ab]
[c++ Interface_b]  --|

[ some infrastructure to process/direct data flow ]
-------------------------------->      [ set of implementations to choose
from ]

steve
On Fri, Mar 1, 2013 at 6:35 PM, Dirk Eddelbuettel <edd at debian.org> wrote:

            
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20130301/57aee8c4/attachment.html>