eclipse-iceoryx / iceoryx

Eclipse iceoryx™ - true zero-copy inter-process-communication
https://iceoryx.io
Apache License 2.0
1.58k stars 373 forks source link

Chunk header usage in C #585

Open MatthiasKillat opened 3 years ago

MatthiasKillat commented 3 years ago

Brief feature description

The current chunk header is a C++ class and cannot be accessed safely purely with C. We need an API (or C struct) to allow using the chunk header in C.

Detailed information

The detailed approach needs to be discussed and depends on the desired level of functionality and configuration options the header shall provide to the user.

neilisaac commented 2 years ago

For my own purposes it is sufficient to expose the size related functions: https://github.com/eclipse-iceoryx/iceoryx/compare/master...neilisaac:c-chunk-header-size

Would you like a pull request for this change?

elBoberido commented 2 years ago

@neilisaac of course. I had a brief look. You need to add some tests and I guess @MatthiasKillat knows more about the requirements for the C-API than me.

MatthiasKillat commented 2 years ago

@neilisaac @elBoberido The additions look fine (no full review) and do not break any existing API. We could even use them in CycloneDDS as well (where, due to iceoryx API freeze a while ago I partially created something similar for convenience).

I am fine with having a pull request (and reviewing it), but what about tests? We would need some tests of the C-API even if it is a thin wrapper. We can also add them in a separate PR (but all in one PR would be better I guess, as it is not too large).

elBoberido commented 2 years ago

@neilisaac you can look at test_request_header.cpp from this PR https://github.com/eclipse-iceoryx/iceoryx/pull/1161/files for the tests. They should more or less be like getChunkHeaderWorks

neilisaac commented 2 years ago

Sorry I missed the comments. I'd be happy to add tests and make a proper PR as time permits.

elBoberido commented 2 years ago

@neilisaac no problem. We are looking forward to your contribution and hopefully the next release is not that far away.