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

refactor: enable compile-time D-Bus signature generation #425

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

sangelovic
Copy link
Collaborator

@sangelovic sangelovic commented Mar 28, 2024

Since sdbus-c++ knows types of D-Bus call/signal/property input/output parameters at compile time, why not assemble the D-Bus signature strings at compile time, too, instead of assembling them at run time as std::string with likely cost of (unnecessary) heap allocations...

std::array is well supported constexpr type in C++20, so we harness it to build the D-Bus signature string and store it into the binary at compile time.

@sangelovic sangelovic force-pushed the refactor/constexpr-signature-type-traits branch from 1c5399f to 682e2ff Compare March 28, 2024 19:37
@sangelovic sangelovic marked this pull request as ready for review March 28, 2024 20:41
@sangelovic sangelovic marked this pull request as draft March 28, 2024 20:44
@sangelovic sangelovic force-pushed the refactor/constexpr-signature-type-traits branch from 682e2ff to a4d2c85 Compare March 29, 2024 11:24
@sangelovic sangelovic force-pushed the refactor/strong-types branch 2 times, most recently from 02a8376 to 21b250e Compare March 29, 2024 12:00
Base automatically changed from refactor/strong-types to release/v2.0 March 29, 2024 12:23
@sangelovic sangelovic force-pushed the refactor/constexpr-signature-type-traits branch 4 times, most recently from a2a82a2 to 7867526 Compare April 2, 2024 13:01
@sangelovic sangelovic force-pushed the refactor/constexpr-signature-type-traits branch from 7867526 to dc6283e Compare April 15, 2024 17:33
@sangelovic sangelovic changed the title wip refactor: enable compile-time D-Bus signature generation Apr 15, 2024
@sangelovic sangelovic force-pushed the refactor/constexpr-signature-type-traits branch from dc6283e to 598eb23 Compare April 16, 2024 08:34
@sangelovic sangelovic requested a review from Oxymoron79 April 16, 2024 08:34
@sangelovic sangelovic marked this pull request as ready for review April 16, 2024 08:34
@sangelovic sangelovic force-pushed the refactor/constexpr-signature-type-traits branch from 598eb23 to f44e113 Compare April 16, 2024 08:42
@sangelovic sangelovic merged commit 945a5af into release/v2.0 Apr 16, 2024
6 checks passed
@sangelovic sangelovic deleted the refactor/constexpr-signature-type-traits branch April 16, 2024 13:40
sangelovic added a commit that referenced this pull request Apr 16, 2024
Since sdbus-c++ knows types of D-Bus call/signal/property input/output parameters at compile time, why not assemble the D-Bus signature strings at compile time, too, instead of assembling them at run time as std::string with likely cost of (unnecessary) heap allocations...

std::array is well supported constexpr type in C++20, so we harness it to build the D-Bus signature string and store it into the binary at compile time.
sangelovic added a commit that referenced this pull request Apr 16, 2024
Since sdbus-c++ knows types of D-Bus call/signal/property input/output parameters at compile time, why not assemble the D-Bus signature strings at compile time, too, instead of assembling them at run time as std::string with likely cost of (unnecessary) heap allocations...

std::array is well supported constexpr type in C++20, so we harness it to build the D-Bus signature string and store it into the binary at compile time.
sangelovic added a commit that referenced this pull request Apr 24, 2024
Since sdbus-c++ knows types of D-Bus call/signal/property input/output parameters at compile time, why not assemble the D-Bus signature strings at compile time, too, instead of assembling them at run time as std::string with likely cost of (unnecessary) heap allocations...

std::array is well supported constexpr type in C++20, so we harness it to build the D-Bus signature string and store it into the binary at compile time.
sangelovic added a commit that referenced this pull request Apr 24, 2024
Since sdbus-c++ knows types of D-Bus call/signal/property input/output parameters at compile time, why not assemble the D-Bus signature strings at compile time, too, instead of assembling them at run time as std::string with likely cost of (unnecessary) heap allocations...

std::array is well supported constexpr type in C++20, so we harness it to build the D-Bus signature string and store it into the binary at compile time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant