<br><br><div class="gmail_quote">On Thu, Dec 2, 2010 at 2:47 PM, Romain Francois <span dir="ltr">&lt;<a href="mailto:romain@r-enthusiasts.com">romain@r-enthusiasts.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Le 02/12/10 20:34, Dominick Samperi a écrit :<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
On Thu, Dec 2, 2010 at 2:31 PM, Andrew Redd &lt;<a href="mailto:amredd@gmail.com" target="_blank">amredd@gmail.com</a><br></div><div class="im">
&lt;mailto:<a href="mailto:amredd@gmail.com" target="_blank">amredd@gmail.com</a>&gt;&gt; wrote:<br>
<br>
    That exposes the data3 class, but does not solve the pointer problem.<br>
<br>
<br>
Add a default contructor.<br>
</div></blockquote>
<br>
This would have been detected at compile time.<br></blockquote><div><br>What I meant is add a default contructor to the module:<br><br>.default_constructor()<br> <br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
Please read the vignette that describes the feature. here is the link:<br>
<a href="http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf" target="_blank">http://cran.r-project.org/web/packages/Rcpp/vignettes/Rcpp-modules.pdf</a><br><font color="#888888">
<br>
Romain<br>
<br>
</font><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
    On Thu, Dec 2, 2010 at 12:24 PM, Romain Francois<br></div><div><div></div><div class="h5">
    &lt;<a href="mailto:romain@r-enthusiasts.com" target="_blank">romain@r-enthusiasts.com</a> &lt;mailto:<a href="mailto:romain@r-enthusiasts.com" target="_blank">romain@r-enthusiasts.com</a>&gt;&gt; wrote:<br>
<br>
        Le 02/12/10 20:05, Andrew Redd a écrit :<br>
<br>
            I updated to the new Rcpp 0.8.9 then added a new function to<br>
            my class.<br>
              It compiles fine the Module is found and loads the class<br>
            definition<br>
            seems to be there, but when I try to create a instance of<br>
            the class I<br>
            get the error:<br>
<br>
            R&gt; new(Module(&quot;GPU_BAYES&quot;,&#39;gpuBayes&#39;)$data3)<br>
            Error in get(&quot;.pointer&quot;, envir = env) : object &#39;.pointer&#39;<br>
            not found<br>
<br>
            Any Ideas what might be wrong here?  That&#39;s a rather vague<br>
            error.  The<br>
            traceback gives<br>
<br>
             &gt; traceback()<br>
            3: get(&quot;.pointer&quot;, envir = env)<br>
            2: function (object)<br>
                standardGeneric(&quot;show&quot;)(&lt;S4 object of class &quot;Rcpp_data3&quot;&gt;)<br>
            1: function (object)<br>
                standardGeneric(&quot;show&quot;)(&lt;S4 object of class &quot;Rcpp_data3&quot;&gt;)<br>
<br>
<br>
            Thanks,<br>
            Andrew<br>
<br>
<br>
        In the Rcpp-modules vignette, that has been considerably updated<br>
        in the last version of Rcpp (part of the 8661 new lines of<br>
        code), we suggest to have this in your .onLoad:<br>
<br>
        # grab the namespace<br>
        NAMESPACE &lt;- environment()<br>
<br>
        .onLoad &lt;- function(libname, pkgname){<br>
                # load the module and store it in our namespace<br>
                yada &lt;- Module( &quot;GPU_BAYES&quot; )<br>
                populate( yada, NAMESPACE  )<br>
        }<br>
<br>
        and the &quot;data3&quot; class is directly exposed in the namespace of<br>
        your package, so that you can do:<br>
<br>
        new( data3 )<br>
<br>
        Does that work ?<br>
<br>
<br>
        Otherwise, maybe you can try adding mustStart = TRUE to the call<br>
        to Module.<br>
</div></div></blockquote><div><div></div><div class="h5">
<br>
<br>
-- <br>
Romain Francois<br>
Professional R Enthusiast<br>
+33(0) 6 28 91 30 30<br>
<a href="http://romainfrancois.blog.free.fr" target="_blank">http://romainfrancois.blog.free.fr</a><br>
|- <a href="http://bit.ly/hovakS" target="_blank">http://bit.ly/hovakS</a> : RcppGSL initial release<br>
|- <a href="http://bit.ly/iaxTdO" target="_blank">http://bit.ly/iaxTdO</a> : parser 0.0-12<br>
`- <a href="http://bit.ly/gnCl01" target="_blank">http://bit.ly/gnCl01</a> : Rcpp 0.8.9<br>
<br>
<br>
</div></div></blockquote></div><br>