[C++-sig] Py++: Derived class and class templates
Luca Sbardella
luca.sbardella at gmail.com
Thu Aug 23 19:58:02 CEST 2007
Thanks Roman,
essentially I need to instantiate a template and Py++ will do the rest..
sweet.
On 22/08/07, Roman Yakovenko <roman.yakovenko at gmail.com> wrote:
>
> On 8/22/07, Luca Sbardella <luca.sbardella at gmail.com> wrote:
> > Hi,
> > I just started testing Py++ and excuse me if questions are trivial.
> >
> >
> > i) First question. I have the following class
> >
> > class timegrid: public dataserie<double> {
> > public:
> > timegrid() {}
> > timegrid(double T1, double T2, long partitions)
> > {init(T1,T2,partitions);}
> > private:
> > void init(double T1, double T2, long partitions);
> > };
> >
> > which derives from the class template "dataserie".
> > When I run Py++ (from the gui) I obtain a wrapper class which only
> include
> > the timegrid methods (in this case the constructors) and no sign of
> methods
> > derived from the template (and there are quite a lot)!!!!
> >
> >
> > ii) Second question. Running Py++ on a template produce nothing (I
> guess it
> > make sense). Is there something I'm missing?
>
> The problem is that you cannot expose template functions/classes. Take
> a look on next FAQ:
>
> http://language-binding.net/pyplusplus/documentation/how_to.html#how-to-automatically-export-template-functions-class
>
> You can also to take a look on Py++ Boost.Random example. This library
> is "one big template", still it was very easy to expose it with Py++:
>
> Usage example:
>
> http://language-binding.net/pyplusplus/documentation/how_to.html#how-to-automatically-export-template-functions-class
> Source code:
> http://tinyurl.com/2p8nfd
> http://tinyurl.com/3cr3ds
>
> HTH.
>
> --
> Roman Yakovenko
> C++ Python language binding
> http://www.language-binding.net/
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20070823/c2a4dbd3/attachment.htm>
More information about the Cplusplus-sig
mailing list