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

consider void_array #98

Closed
cyrush opened this issue Nov 30, 2016 · 2 comments
Closed

consider void_array #98

cyrush opened this issue Nov 30, 2016 · 2 comments
Labels

Comments

@cyrush
Copy link
Member

cyrush commented Nov 30, 2016

A void_array (a DataArray<void*> instance) would be useful for the case were you want to generically stride though and access the bytes for any array w/o type checking.

The void_array will still have access to the full data type spec, so the parts of the DataArray inteface related to set, to_json, etc helpers could still work fine, but we need to look if it has implications on plumbing of the template use.

@cyrush cyrush added the design label Nov 30, 2016
@cyrush
Copy link
Member Author

cyrush commented Nov 30, 2016

It seems the DataArray::set methods would need some special logic for the void * case

@cyrush cyrush modified the milestone: 0.3.0 Apr 26, 2017
@cyrush
Copy link
Member Author

cyrush commented Apr 27, 2017

We can effectively access and iterate over the data directly from a node via element_ptr().

The main benefit of this comes in the a case where you have a leaf Node that you don't want to access with a specific bw style type, but you have some data values you want to set:

void_array arr = n.value();
arr.set(...) // pass in ptrs to btw style types, any other data array, etc

That said, the bracket operator overloads don't really make sense in this context. We could try some sort of magic that would mirror Node::Value, but that seems extreme.

As such "void_array" doesn't really adhere to the DataArray interface -- so we should think of a different way to provide what is needed.

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

1 participant