billyquith / ponder

C++ reflection library with Lua binding, and JSON and XML serialisation.
http://billyquith.github.io/ponder/
Other
640 stars 93 forks source link

Enhanced support for arrays? #31

Closed Weeena closed 8 years ago

Weeena commented 8 years ago

Would it be possible to extend ponder::Value to fully support arrays?

Currently, arrays (T[], std::vector, std::list) are supported as properties of classes. Alas, ponder::Value does not support arrays, i.e. it cannot hold an array. In my opinion, this has the following drawbacks:

I don't know what the best way would be for ponder::Value to support arrays. I could imagine that, once ponder::Value supports arrays, ponder::Property::get(object) and ponder::Property::set(object, value) work with the array rather with the first element. The value per value approach would still be possible through ponder::ArrayProperty.

In one of my earlier comments I wrote that maybe we try to use ponder for something it was not designed for. Therefore, I am curious about your opinion and plans regarding my recent issues. Thank you in advance.

billyquith commented 8 years ago

maybe we try to use ponder for something it was not designed for.

Perhaps just using it in an inefficient way. Marshalling all of the data backwards and forwards through an API like this will be less efficient in any form. E.g. similar problems occur if you are using a managed code wrapper in Dot Net.

Perhaps the way to go is just to write a load and save function an expose these?

billyquith commented 8 years ago

Closing as answered and no response.