Hi,
Is it possible to pickle an object loaded from a c++ library which contains
py++ auto-generated code?
For example a c++ struct:
struct Coordinate
{
int x;
int y;
};
And its wrapper:
BOOST_PYTHON_MODULE(pyplusplus_test){
bp::class_< Coordinate >( "Coordinate" )
.def_readwrite( "x", &Coordinate::x )
.def_readwrite( "y", &Coordinate::y );
}
I built pyplusplus_test.so libray. Then I wrote a script such as:
import sys
import pickle
sys.path.append('.')
import pyplusplus_test
cord = pyplusplus_test.Coordinate()
cord.x = 23
cord.y = -11
pickle.dumps(cord)
But it failed. The message is "RuntimeError: Pickling of
"pyplusplus_test.Coordinate" instances is not enabled
(http://www.boost.org/libs/python/doc/v2/pickle.html)"
I know that I can arrange generated code adding def_pickle() calls. But I want
to generate wrappers automatically.
Any suggestion?
Thanks.
Bu e-posta mesajı ve ekleri gönderildiği kişi ya da kuruma özeldir ve gizlidir.
Ayrıca hukuken de gizli olabilir. Hiçbir şekilde üçüncü kişilere açıklanamaz ve
yayınlanamaz. Mesajın yetkili alıcısı değilseniz hiçbir kısmını kopyalayamaz,
başkasına gönderemez veya hiçbir şekilde kullanamazsınız. Eğer mesajın yetkili
alıcısı veya yetkili alıcısına iletmekten sorumlu kişi siz değilseniz, lütfen
mesajı sisteminizden siliniz ve göndereni uyarınız. Gönderen ve ROKETSAN ROKET
SANAYİİ VE TİCARET A.Ş. bu mesajın içerdiği bilgilerin doğruluğu, bütünlüğü ve
güncelliği konusunda bir garanti vermemektedir. Mesajın içeriğinden,
iletilmesinden, alınmasından, saklanmasından, gizliliğinin korunamamasından,
virüs içermesinden ve sisteminizde yaratabileceği zararlardan ROKETSAN ROKET
SANAYİİ VE TİCARET A.Ş. sorumlu tutulamaz.
Şirketimiz hakkında bilgi almak için lütfen web sitemizi ziyaret ediniz.
www.roketsan.com.tr<http://www.roketsan.com.tr>
This e-mail and its attachments are private and confidential to the exclusive
use of the individual or entity to whom it is addressed. It may also be legally
confidential. Any disclosure, distribution or other dissemination of this
message to any third party is strictly prohibited. If you are not the intended
recipient, you may not copy, forward, send or use any part of it. If you are
not the intended recipient or the person who is responsible to transmit to the
intended recipient, please contact the sender by reply e-mail and destroy all
copies of the original message and its attachments. The sender and ROKETSAN
ROKET SANAYİİ VE TİCARET A.S. do not warrant for the accuracy, currency,
integrity or correctness of the information in the message and its attachments.
ROKETSAN ROKET SANAYİİ VE TİCARET A.S. shall have no liability with regard to
the information contained in the message, its transmission, reception, storage,
preservation of confidentiality, viruses or any damages caused in anyway to
your computer system.
To get information about our company please visit our web site.
www.roketsan.com.tr<http://www.roketsan.com.tr>
_______________________________________________
Cplusplus-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/cplusplus-sig