plasmodic / ecto

ecto is a dynamically configurable Directed Acyclic processing Graph (DAG) framework.
http://ecto.willowgarage.com/
BSD 3-Clause "New" or "Revised" License
98 stars 37 forks source link

pybinding - vector<int> returned by value, how to return by reference? #241

Open eacousineau opened 11 years ago

eacousineau commented 11 years ago

Hello,

I've written a basic ecto cell: https://github.com/eacousineau/ecto_simple I have it update the cell's input 'vector', which is a vector. However, whenever I call the 'inputs.vector', it always returns a new instance of ecto.VectorInt (in the repr(), you can see the address changing):

In [4]: test.inputs.vector
Out[4]: <ecto.ecto_main.VectorInt at 0x2338d50>

In [5]: test.inputs.vector
Out[5]: <ecto.ecto_main.VectorInt at 0x2338e50>

In [6]: test.inputs.vector
Out[6]: <ecto.ecto_main.VectorInt at 0x2338dd0>

In [7]: test.inputs.vector
Out[7]: <ecto.ecto_main.VectorInt at 0x2409950>

I can solve this by creating an instance of VectorInt (seen here), but is there a more elegant solution for this? Is there a way to have the tendril pass the vector by reference instead?