sdbusplus: size/ssize types and 'object_path' type.
Hello,
For the sdbus++ interface YAML files we use in phosphor-dbus-interfaces, I recently added support for 'size' and 'ssize' types[1]. I did this because I've seen many cases where there was some discussion on appropriate integer sizes for countable items (ex. uint8 vs uint32 vs uint64). Generally, in C++ we recommend size_t/ssize_t as the most appropriate type for countable items (and anything else is likely a premature optimization). We should now take this same approach in PDI interfaces.
Another minor change[2] is I added 'object_path' as a type alias to what was previously just 'path'. The name 'object_path' is what the DBus specification calls this type, so I think that name is more obvious for sdbus++ to also use. Both 'path' and 'object_path' currently resolve to the same type, but I'll probably also start switching PDI interfaces over to the longer 'object_path' type name.
1. https://github.com/openbmc/sdbusplus/commit/4ac7e56e8e18202fad3b2734346c6d4c7a6957fc
2. https://github.com/openbmc/sdbusplus/commit/d5ce346c434705180d0cbe25686d51630681ba4b
Signature · 1 line
Patrick Williams
Quoted 10 lines · Patrick Williams
For the sdbus++ interface YAML files we use in phosphor-dbus-interfaces, I recently added support for 'size' and 'ssize' types[1]. I did this because I've seen many cases where there was some discussion on appropriate integer sizes for countable items (ex. uint8 vs uint32 vs uint64). Generally, in C++ we recommend size_t/ssize_t as the most appropriate type for countable items (and anything else is likely a premature optimization). We should now take this same approach in PDI interfaces.
1. https://github.com/openbmc/sdbusplus/commit/4ac7e56e8e18202fad3b2734346c6d4c7a6957fc
It was mentioned to me in a code review for PDI that there was some problem taking advantage of 'size_t/ssize_t' type properties when the interface already had a 'uint32_t/int32_t' type property. I've identified the underlying problem and fixed it with this commit:
https://gerrit.openbmc-project.xyz/c/openbmc/sdbusplus/+/37227
Signature · 1 line
Patrick Williams