[C++-sig] Keyed properties? (original) (raw)
Jakob van Santen jvansanten at gmail.com
Tue Aug 4 15:23:06 CEST 2009
- Previous message: [C++-sig] Details of Boost.Python Py_Finalize issue?
- Next message: [C++-sig] Keyed properties?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
I'm in the process of hiding the unnecessarily verbose parts of a C++
interface behind Python properties, and I've run in to a slight
problem. We have a bunch of classes that expose private std::vectors
via Get(int index) and Set(int index, value_type& val) methods.
Ideally, I'd like to replace
thingy.GetATWDGain(1) thingy.SetATWDGain(1, 254.5)
with
thingy.atwd_gain[1] thingy.atwd_gain[1] = 254.5
I know how I would solve this in pure Python (something similar to
this: http://code.activestate.com/recipes/440514/), but I'm wondering
if there's a clever way to do this in Boost.Python without messing
around with the library itself. If anyone has done this already, I'd
be curious to know how.
Cheers, Jakob van Santen
- Previous message: [C++-sig] Details of Boost.Python Py_Finalize issue?
- Next message: [C++-sig] Keyed properties?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]