-
Notifications
You must be signed in to change notification settings - Fork 135
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
feat: support serialization of array, span and unordered_map #342
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't wait to make use of these additions!
9b72520
to
da21b47
Compare
/cc @hellow554 |
At at first glance, this looks very good to me :) Thanks for that! (Better than I would have done, so I'm glad you did it :D ) Just the Also I would like to see the documentation (https://github.com/Kistler-Group/sdbus-cpp/blob/master/docs/using-sdbus-c%2B%2B.md) updated, but I can do that if you like |
@hellow554 Thanks for your support here. Documentation is a good point, I forgot about it ;-) It's probably not much to update there? Would you contribute here? Will we create a new follow PR? How much time do you need? |
https://gist.github.com/hellow554/2a23cb29b87e4c6cac7f58d7aa96ed55 Please see this gist and apply them after you downloaded them with You can of course rebase/squash them afterwards if you like ;) Thanks a lot :) |
Done, thanks! |
What about your open comments? Still something to discuss, or can we resolve? And there is still one point open -- shall we also extend the code generator to be able to generate these additional containers depending on the client's choice in the D-Bus XML? I guess it will make the change consistent across all levels of API and make code generator more flexible and usable in those cases. |
Everthing is fine :)
TBH: I never used the XML generator, although I probably should have :D
But I'm not sure if this is a feasible thing, because how does the code generator know the size of the array? Do you have to tell them, e.g. TBH: I'm not sure how to do that in the XML and it needs some dicussion, but I don't think that it should be disucess in this PR. I would open a new issue where one/we/other can discuss the layout of the XML. |
We could probably use another optional XML attribute named e.g. <arg type="ai" name="numbers" direction="in">
<annotation name="org.freedesktop.SdBusCpp.ContainerType" value="std::array" />
<annotation name="org.freedesktop.SdBusCpp.ContainerSize" value="5" />
</arg> Either way, how to address complex types? E.g. This needs further thinking, and I agree with you we shall do that into a separate issue/PR. We still may decide not to do that at all, if it would make things very complex. Anyway, thanks for your contributions! |
Add support for
std::array
,std::span
andstd::unordered_map
in D-Bus message serialization/deserialization API.TBD: Extending codegen XML to allow clients to choose from STL containers to use in C++ bindings?