ba33c2a2 | 19-Nov-2021 |
Patrick Williams <patrick@stwcx.xyz> |
manager,interface: use shortened types
Use the shortened alias types whenever possible for `manager` and `interface`.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib0f10bd0912f366
manager,interface: use shortened types
Use the shortened alias types whenever possible for `manager` and `interface`.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ib0f10bd0912f3668dcb3fce660a95facdf02c23b
show more ...
|
0f282c48 | 19-Nov-2021 |
Patrick Williams <patrick@stwcx.xyz> |
bus: shorten bus type
Create an alias `sdbusplus::bus_t` to `sdbusplus::bus::bus` to reduce duplication.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9f17892eed5112d4946949861488
bus: shorten bus type
Create an alias `sdbusplus::bus_t` to `sdbusplus::bus::bus` to reduce duplication.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9f17892eed5112d49469498614884c02bba86011
show more ...
|
b5770e16 | 06-Oct-2021 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: catch exceptions as const
It is proper to `catch (const exception&)` and not the non-const variant. Update the sdbus++ templates to ensure we always catch as const.
Signed-off-by: Patrick
sdbus++: catch exceptions as const
It is proper to `catch (const exception&)` and not the non-const variant. Update the sdbus++ templates to ensure we always catch as const.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Ica0a6eda4e80bda868a4240a4a65584adabba22f
show more ...
|
dfb56422 | 10-Sep-2021 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: catch elements with non-string names
The Python YAML parser turns certain keywords into non-string types, such as 'On' -> True, 'Off' -> False. If these aren't identified, interfaces can b
sdbus++: catch elements with non-string names
The Python YAML parser turns certain keywords into non-string types, such as 'On' -> True, 'Off' -> False. If these aren't identified, interfaces can be defined for which names become the string-representation of these non-string names. This is especially problematic for 'On'/'Off' becoming 'True'/'False'.
Catch this condition and report an assertion.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I126056e3eac9f97ebd7b095962da2b765046b532
show more ...
|
ef26221b | 02-Sep-2021 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: add errno property to errors
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9de8211cd503503dd11a404cf3ffe0fd1c8399c6 |
15228663 | 03-Sep-2021 |
Patrick Williams <patrick@stwcx.xyz> |
exception: create subclass for generated errors
All errors generated by sdbus++ YAML we want to follow the systemd default errno value (EIO). All exceptions defined otherwise it is probably a good
exception: create subclass for generated errors
All errors generated by sdbus++ YAML we want to follow the systemd default errno value (EIO). All exceptions defined otherwise it is probably a good idea to ensure that the author picks an explicit errno.
Create a base class for generated exceptions to hold the default `get_errno() { return EIO; }` implementation, which can be used by various repositories and later turn the exception_t one into a pure virtual.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I2648825b677353970eed4724bd2d3710a103d814
show more ...
|
08dc23c1 | 22-Jul-2021 |
Willy Tu <wltu@google.com> |
sdbus++: add minint/maxint support for integer default values
Allow default values of minint and maxint for integer types using the `std::numeric_limits::{min,max}`.
Tested:
Generated cpp files wi
sdbus++: add minint/maxint support for integer default values
Allow default values of minint and maxint for integer types using the `std::numeric_limits::{min,max}`.
Tested:
Generated cpp files with ``` ./tools/sdbus++-gen-meson --command cpp --tool "./tools/sdbus++" \ --directory "." --output "." test ```
test.interface.yaml ``` properties: - name: test0 type: uint64 default: minint - name: test1 type: uint64 default: maxint - name: test2 type: uint64
```
Snippet of server.hpp ``` uint64_t _test0 = 0; uint64_t _test1 = std::numeric_limits<uint64_t>::max(); uint64_t _test2{}; ```
Change-Id: I38ae3be783211ca0c4e6af9c1e20816579276c9e Signed-off-by: Willy Tu <wltu@google.com> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
show more ...
|
72b60222 | 22-Jul-2021 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: property: add list of fundamental types
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I9b2e49464b6121cd880a3e081e8a7817a613434f |
05a35042 | 15-Jul-2021 |
Patrick Williams <patrick@stwcx.xyz> |
message: move enum-string conversion routines
Move enum conversion routines out of the 'details' namespace so they are available for library users and consolidate them in the 'native_types' header.
message: move enum-string conversion routines
Move enum conversion routines out of the 'details' namespace so they are available for library users and consolidate them in the 'native_types' header.
In order to support future work of template-specialization on `variant` types, this also added a level of indirection in the generated specializations for enums so that they are handled through a struct-with-op pattern. (Functions cannot be partially specialized and overloading the template with std::variant support requires that).
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I1db7cface90abe7296b9043ca9caa247368821de
show more ...
|
145892c9 | 14-Jul-2021 |
Patrick Williams <patrick@stwcx.xyz> |
message: read: move enum exception higher
In order to better handle trying the next enumeration when parsing variants with multiple enum types, switch the usage of string-to-enum to the one returnin
message: read: move enum exception higher
In order to better handle trying the next enumeration when parsing variants with multiple enum types, switch the usage of string-to-enum to the one returning a std::optional. This requires adding the exception (for bad enum parsing) into the higher level 'read_single' implementation for enums.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: If90e9b8a9fbbfd6988a7c18116cd014571bed973
show more ...
|
071b83fc | 13-Jul-2021 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: property: fix up enum type ambiguity
Adding a variant[enum[...]] to the test/server/Test.interface.yaml yields a compile failure due to enumeration type ambiguity:
builddir/test/server
sdbus++: property: fix up enum type ambiguity
Adding a variant[enum[...]] to the test/server/Test.interface.yaml yields a compile failure due to enumeration type ambiguity:
builddir/test/server/Test/server.cpp:1022:47: error: ‘server’ is not a member of ‘sdbusplus::server::server’ std::variant<std::string, server::server::Test::EnumOne, server::server::Test::EnumTwo>>());
Fix this ambiguity by properly adding the fully-qualified type name in the type generation for enumerations. ie. add the 'sdbusplus::' prepending.
Tested: Compiled the test-change encountering the problem and the full phosphor-dbus-interface repository with this change as a subproject.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I186792c0a440711b1254489d8d066ef04c7732b8
show more ...
|
f82f7883 | 13-Jul-2021 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: interface: add non-throwing enum conversion
Add a variant of the enum conversion function that returns a std::optional instead of throwing. In the future this will be used in the tuple-par
sdbus++: interface: add non-throwing enum conversion
Add a variant of the enum conversion function that returns a std::optional instead of throwing. In the future this will be used in the tuple-parsing to handle tuples containing multiple enumerations.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I2325e1dd7299baedf24e78f6ca65ad16df9d1d32
show more ...
|
34cf6932 | 14-Jul-2021 |
Patrick Williams <patrick@stwcx.xyz> |
utility: dedup_variant: rename in C++14 '_t' style
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I10590aca0d68fe50caf0f36819fea2d73016370f |
1013c5ec | 13-Jul-2021 |
Patrick Williams <patrick@stwcx.xyz> |
server: remove bindings.hpp
binding.hpp had an unused template definition that was used as an overload for converting enums to strings. This function is no longer used within the library nor genera
server: remove bindings.hpp
binding.hpp had an unused template definition that was used as an overload for converting enums to strings. This function is no longer used within the library nor generated bindings. Remove it and clean up the documentation of the generated version of this function for enums to match the actual namespace where they are defined.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0e0db3daeca52169e2e4b95262b429836a7d1270
show more ...
|
a42e97a6 | 17-May-2021 |
William A. Kennington III <wak@google.com> |
sdbus++-gen-meson: Don't build markdown by default
Not all builds want the markdown (notably subproject builds) and we can trivially create a target to build and install it.
``` custom_target(
sdbus++-gen-meson: Don't build markdown by default
Not all builds want the markdown (notably subproject builds) and we can trivially create a target to build and install it.
``` custom_target( 'md', command: 'true', output: 'md', capture: true, depends: generated_others, build_by_default: true) ```
This increments the version counter to ensure users notice the behavior change.
Change-Id: I55fd995d8ab27b2f06d3c382b3379bd36ba10c6f Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
56eb1775 | 18-May-2021 |
William A. Kennington III <wak@google.com> |
sdbus++-gen-meson: Support non-source root yaml directories
Right now, this tool assumes that the input root directory is the source root. Some of our packages have their yaml files in non-root dire
sdbus++-gen-meson: Support non-source root yaml directories
Right now, this tool assumes that the input root directory is the source root. Some of our packages have their yaml files in non-root directories and we want to support them.
Change-Id: I7e20a0a0966786ae0cbbef64522dc2993a2d074a Signed-off-by: William A. Kennington III <wak@google.com>
show more ...
|
98019e74 | 30-Apr-2021 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: fix camelcase names
For the longest time we have used inflection.camelize to create property and function names from YAML entries. The way the function creates lowerCamelCase has an annoyi
sdbus++: fix camelcase names
For the longest time we have used inflection.camelize to create property and function names from YAML entries. The way the function creates lowerCamelCase has an annoying appearance when there is an acronym in the YAML name.
Example: inflection.camelize("BMCProperty", false) -> "bMCProperty".
This causes irritating function overrides from any user of the sdbus++ generated code that has an acronym. Fix this to be a reasonable lowerCamelCase like "bmcProperty".
Also, #define SDBUSPP_NEW_CAMELCASE in the generated headers for a short time, so that code has a method to create transitionary names.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I17a8d7479556596a3cf252b3f4eae9c8df547189
show more ...
|
fcff6763 | 30-Apr-2021 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: add C++20 reserved keywords
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I2cf1e53709d4d4f5572ab676bb9e246e6781d5c4 |
d9bb33e2 | 15-Apr-2021 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++-gen-meson: switch to project_source_root
The meson call 'source_root' is deprecated in 0.56 and is incorrect when the project using gen-meson is used as a subproject. Switch to 'project_sou
sdbus++-gen-meson: switch to project_source_root
The meson call 'source_root' is deprecated in 0.56 and is incorrect when the project using gen-meson is used as a subproject. Switch to 'project_source_root', which was introduced in 0.56, and is the correct replacement for the deprecated 'source_root' ('global_source_root' is incorrect for use in a sub-project).
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I6053f547ab48ee7c9f31acf966b94cda15a1d53b
show more ...
|
1d35f91a | 09-Oct-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: create server support functions
Reduce the complexity of the generated bindings by taking the common patterns and moving them to support template functions. This has the side-effect of a sm
sdbus++: create server support functions
Reduce the complexity of the generated bindings by taking the common patterns and moving them to support template functions. This has the side-effect of a small space savings a library of generated bindings.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I55d6de0aa8773a68f1a23b1301056ea3435dbbc9
show more ...
|
d64fb7da | 21-Jan-2021 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++-gendir: remove from install
The preferred method is to now use sdbus++-gen-meson and the "gendir" tool is deprecated. Remove it from install so it doesn't start getting used.
Signed-off-by
sdbus++-gendir: remove from install
The preferred method is to now use sdbus++-gen-meson and the "gendir" tool is deprecated. Remove it from install so it doesn't start getting used.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I0aeacb016028c7e5e55376698344a97e497fbd1d
show more ...
|
9ad6d75a | 22-Dec-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: fix method template generation
In the refactoring of the mako templates, a parameter was missed to the `Method::returns_as_list` function. This shows up as:
``` File "method_prototype_h
sdbus++: fix method template generation
In the refactoring of the mako templates, a parameter was missed to the `Method::returns_as_list` function. This shows up as:
``` File "method_prototype_hpp_mako", line 88, in render_body File "/usr/local/lib/python3.8/dist-packages/sdbusplus/method.py", line 36, in cpp_return_type self.returns_as_list() + \ TypeError: returns_as_list() missing 1 required positional argument: 'interface' ```
Add missing parameter.
Fixes d2fc8cc0b96b1861c647d00e1a9e5e98e9fc109e.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I35407ed1c4046d6eb232c883ec25938e4e4ab3d8
show more ...
|
d2fc8cc0 | 17-Nov-2020 |
Ramin Izadpanah <iramin@google.com> |
sdbus++: Refactor utilities shared by templates
These utilities are used by more than one template. Moved to python classes for reusability.
Tested by generating files using 2 yaml files with prope
sdbus++: Refactor utilities shared by templates
These utilities are used by more than one template. Moved to python classes for reusability.
Tested by generating files using 2 yaml files with properties and methods.
Signed-off-by: Ramin Izadpanah <iramin@google.com> Change-Id: Ifa08c068afa3ce46104cd44a79982cf04b745350
show more ...
|
a4c9edc1 | 17-Dec-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++-gen-meson: force locale for stable sort
Locale affects certain tools like `sort`. Force the locale to the POSIX ("C") locale for stability no matter what the user has set.
Signed-off-by: P
sdbus++-gen-meson: force locale for stable sort
Locale affects certain tools like `sort`. Force the locale to the POSIX ("C") locale for stability no matter what the user has set.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: Id8993f6efcbee1904d8b068ac4bf328a630c0116
show more ...
|
c67e1e87 | 04-Nov-2020 |
Patrick Williams <patrick@stwcx.xyz> |
sdbus++: support special double values
Enable properties to have default values of special IEEE floating points: 'NaN', 'infinity' and 'epsilon'.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
sdbus++: support special double values
Enable properties to have default values of special IEEE floating points: 'NaN', 'infinity' and 'epsilon'.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Change-Id: I7c2daa3c36cde69c2ee06afd75a8d2e77992c6e7
show more ...
|