[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyKDE] Using libsip for extending & embedding
From:       ian reinhart geiser <geiseri () yahoo ! com>
Date:       2001-10-24 15:51:01
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Greetings
	I am trying to use SIP here to create bindings for a C++ project of mine.  
The issue I have now is the need for an "object twin"  or an object that is 
created in C++ and then can be accessed from python.  This is clearly shown 
for simple types (int, string, etc) but there is no real discussion on more 
complex types.  In my case I am creating a class foo, and would like foo to 
be manipulated from python.  Python knows how to deal with type foo because I 
used SIP to create a module that python loads.  My question here is can I use 
libsip to convert those C++ objects to PyObjects using the following code:

foo *daFoo = new foo();
PyObject *sipClass_foo;
PyObject  pyFoo = sipMapCppToSelf 
	(
	reinterpret_cast<void *>(daFoo),
	sipClass_foo)
	);
// Pass pyFoo to a embedded python script here.

This looks really easy, but I am not sure if I am abusing SIP to do something 
wrong here.

Thanks
- -ian reinhart geiser
- -- 
========================================
FORTH IF HONK THEN
========================================
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE71sdoPy62TRm8dvgRAjuFAKDLnhnfXBbgQQRdmGPUprHKMuMUxgCggkho
l3cS4N1ojCPGtja12yIlD/o=
=pqHt
-----END PGP SIGNATURE-----


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic