Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced support for arrays? #31

Closed
Weeena opened this issue Jun 2, 2016 · 2 comments
Closed

Enhanced support for arrays? #31

Weeena opened this issue Jun 2, 2016 · 2 comments
Assignees
Labels

Comments

@Weeena
Copy link

Weeena commented Jun 2, 2016

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 cannot declare a function to ponder that expects an array as parameter.
  • When I want to serialize an array, I have to do it value per value (through functionality of ponder::ArrayProperty). (Our domain is image processing where one has large arrays, making value per value serialization too expensive.)
  • If I have a class with an array property, calling ponder::Property::get(object) or ponder::Property::set(object, value), respectively, gets or sets the first element of the array (which is counterintuitive in my opinion).

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
Copy link
Owner

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 billyquith self-assigned this Jun 22, 2016
@billyquith
Copy link
Owner

Closing as answered and no response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants