[pygccxml-development] Re : Iteration over py++ generated maps and vectors
Brought to you by:
mbaas,
roman_yakovenko
From: Vincent F. <vin...@gm...> - 2008-06-19 07:16:25
|
The method NastranDatabase.getNodes() has the following signature in the C++ code : std::map<int,node> & getNodes(void) ; In my python code, I'm able to call it and get the corresponding map_indexing_suite_map_less__int_comma__postLib_scope_nastran_scope_node__grate_ object. When I iterate over this instance, I get the example listed above. But don't know how to access corresponding int and NastranNode for every element in the list... Hope this is better explained. Thanks again. 2008/6/18, Roman Yakovenko <rom...@gm...>: > On Wed, Jun 18, 2008 at 6:50 PM, Vincent Ferries > <vin...@gm...> wrote: >> I've generated most of what I needed. >> I'm currently trying to recover all the informations stocked in my >> different objects. >> >> I'm initializing an object with childrens (nodes in this example). >> >> I've said myself the best way should be using iterators over such >> lists (vector, maps etc). >> I tried the following example : >> >> >> nodes = self.internalDb.getNodes() >> iterator = nodes.__iter__() >> for it in iterator: >> print it >> >> >> >> It prints me a list of lines like that : >> >> (52208839, <pyferespost.NastranNode object at 0xb7e01dec>) >> >> >> >> I'd like to access to the inner object (in this case a NastranNode) >> but don't really know how... > > Sorry, but I don't understand you. Small and complete example is needed. > > -- > Roman Yakovenko > C++ Python language binding > http://www.language-binding.net/ > |