Re: [pygccxml-development] Iteration over py++ generated maps and vectors
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2008-06-24 08:16:24
|
On Tue, Jun 24, 2008 at 11:06 AM, Vincent Ferries <vin...@gm...> wrote: > Yes, the function getNodes is a member function. > > Here is a little portion of the source code : > > namespace postLib { > namespace nastran { > class dataBase : public generic::dataBase { > > private : > std::map<int,node> nodes ; > > public : > dataBase(void) ; > ~dataBase(void) ; > > // Accessing "model" member data : > std::map<int,node> & getNodes(void) ; > > } ; // class dataBase > } // namespace nastran > } // namespace postLib > > I cleaned all that wasn't necessary. > After getting the node objects from the getNodes function, I need to > recover them one by one in the map and use them in other functions, be > able to call their methods too. > According to me, these items are supposed to live as long as the > dataBase is exploited. In this case you use the right call policy - return_internal_reference I suggest you to read this document http://www.boost.org/doc/libs/1_35_0/libs/python/doc/v2/indexing.html , which explains how to use "built-in" indexing suite HTH -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |