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

Rework IPC declaration syntax #5

Open
neobrain opened this issue Mar 7, 2024 · 0 comments
Open

Rework IPC declaration syntax #5

neobrain opened this issue Mar 7, 2024 · 0 comments

Comments

@neobrain
Copy link
Member

neobrain commented Mar 7, 2024

The IPC platform definitions in source/platform are super useful, but they were implemented at a time were C++ metaprogramming was highly limiting. With C++20, a much simpler and faster-to-compile syntax could be adopted. Furthermore, per-parameter description texts could be added (for integration in debug traces).

I'm thinking of something like this:

// Previously:
// using DeleteDirectory = IPC::IPCCommand<0x806>::add_uint32::add_uint64::add_uint32::add_uint32::add_static_buffer::response;

// New:
inline constexpr auto DeleteDirectory = IPCCommand(
    AddU32("Transaction", "Transaction parameter description"),
    AddSerialized<ArchiveHandle>("Archive handle", "Handle for the archive the directory belongs to"),
    AddSerialized<Path>("Path", "Directory path"),
    ...
    );
};
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

No branches or pull requests

1 participant