[pygccxml-development] [new feature]add_property add_static_property
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-09-26 11:00:34
|
Hi. I think that the first draft of "properties" functionality is ready. Usage example: struct data_t{ data_t() : m_count( 0 ) {} int count() const { return m_count; } void set_count( int x ) { m_count = x; } int m_count; }; mb = module_builder_t(...) data = mb.class_( 'data_t' ) count = data.member_function( 'count' ) set_count = data.member_function( 'set_count' ) data.add_property( "count", count, set_count ) #also exists but untested add_static_property 1. Py++ will not exclude count and set_count by default. ( Is this expected behaviour? ) 2. Call policies for property functions should be set on relevant functions 3. add_[static]_property as arguments takes references to member function declaration This is initial implementation and I will extend it to take other type of arguments. Feedback's and bugs are welcome. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |