From: <cp...@ze...> - 2010-09-22 07:17:29
|
Hi, I am using swig to wrap some c++ code into Python and reached a dead end. I have, among others, two very simple classes that only contain a few public variables: class EXPORT_API MetaInfoData { public: std::string name; std::string location; std::string description; }; and a similar one called ArchiveAccessData. In another class there is a static function that returns a vector and this works fine in the Python code, i.e. I get proxy objects like: py> f = datatk.ArchivesRepository_getArchives() py> f 2010-09-22 08:46:39 Info: (<datatk.datatk.ArchiveAccessData; proxy of <Swig Object of type 'datatk::ArchiveAccessData *' at 0x0BE31A70> >, <datatk.datatk.ArchiveAccessData; proxy of <Swig Object of type 'datatk::ArchiveAccessData *' at 0x0BE31AB8> >, <datatk.datatk.ArchiveAccessData; proxy of <Swig Object of type 'datatk::ArchiveAccessData *' at 0x0BE31AE8> >) However when using the method that resturn a vector<MetaInfoData> I get: py> g = this.archive.getMetaInfo() py> g 2010-09-22 08:46:21 Info: <Swig Object of type 'std::vector< MetaInfoData,std::allocator< datatk::MetaInfoData > > *' at 0x0BE31B30> As you can see, no proxy objects and I have no idea how to access this SwigObject pointer thing. Any thoughts on why these similar classes give different behaviour? Regards, Christian Mol |