logo       

RE: Glueing Java, Python, C++ together: msg#00173

programming.swig

Subject: RE: Glueing Java, Python, C++ together

I've have a lot of success with using SWIG to wrap C++ classes into Java
which are then accessible from Jython. With careful %renaming you can get
very effective usage. For example, const/non-const method pairs in C++ can
be wrapped to Java Bean style getters and setters in Java. These are then
accessible using Jython's Bean access as something very close to the
original C++ method names. I don't have the code to hand but something like:

C++ :

class Type {
int property() const;
void property(int);
};

Java :

class Type {
int getProperty();
setProperty(int);
};

Jython :

t = Type();
t.property = 5 # set
s = t.property # get



> -----Original Message-----
> From: swig-admin@xxxxxxxxxxxxxxx
> [mailto:swig-admin@xxxxxxxxxxxxxxx] On Behalf Of Mark Asbach
> Sent: 26 September 2004 18:36
> To: swig@xxxxxxxxxxxxxxx
> Subject: [Swig] Glueing Java, Python, C++ together
>
>
> Hi Swig-users,
>
> next month I'll be starting a new software project that makes me
> wonder, if and how I could combine Java, C++ and Python into a single
> application.
>
> The problem is, we already have C++ backend code and a lot Java GUI
> code. I could (and surely will) put both together with the help of
> Swig. On the other hand, the resulting application should have an
> embedded scripting language and I would prefer to have a
> Python command
> line for that purpose. While I have successfully worked with
> C++/Swig/Python, I'm unsure how to embed a Python interpreter
> into Java
> and at the same time have the possibility to import Swig wrapped C++
> classes into Python.
>
> Any suggestions or ideas?
>
> Thanks a lot,
>
> Mark
>
>
> _______________________________________________
> Swig maillist - Swig@xxxxxxxxxxxxxxx
> http://mailman.cs.uchicago.edu/mailman/listinfo/swig
>

_______________________________________________
Swig maillist - Swig@xxxxxxxxxxxxxxx
http://mailman.cs.uchicago.edu/mailman/listinfo/swig



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise