[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] how to import a class in python
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] how to import a class in python |
Date: |
Wed, 3 May 2006 10:59:56 -0700 |
User-agent: |
Mutt/1.5.9i |
On Tue, May 02, 2006 at 03:21:05PM -0400, Achilleas Anastasopoulos wrote:
> I have developed a simple class "howto_object"
> (which does not do anything at this point...)
> and now I want to make it part of gnuradio/howto,
> so that I can "see" it in python when I am
> doing "from gnuradio import howto"
> This class is not derived from gr_block and the rest,
> so I am not sure what the right wrapping should be...
>
> I attach the code.
>
> Thanks
> Achilleas
>
> ----------------howto_object.h---------------
> #ifndef INCLUDED_HOWTO_OBJECT_H
> #define INCLUDED_HOWTO_OBJECT_H
>
> class howto_object {
> private:
> int d_I;
> public:
> int I () const { return d_I; }
> howto_object(const int I);
> howto_object();
> };
>
> #endif
A .i file with either of these will probably work:
class howto_object {
private:
int d_I;
public:
int I () const { return d_I; }
howto_object(const int I);
howto_object();
};
or
class howto_object {
public:
int I () const { return d_I; }
howto_object(const int I);
howto_object();
};
FYI, the SWIG docs are pretty good.
See www.swig.org
Eric