Re: [pygccxml-development] Re : Iteration over py++ generated maps and vectors
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2008-06-19 07:40:31
|
On Thu, Jun 19, 2008 at 10:16 AM, Vincent Ferries <vin...@gm...> wrote: > 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. A little bit. Iterating over std::map class is same as iterating over dictionary: you get tuple of <key, value> if you are interested in values only, you can use "values" function. Take a look on Py++ unittests. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |