docs(examples): native (same-process) C++ example#61
Draft
Ivansete-status wants to merge 1 commit into
Draft
Conversation
Complements the CBOR C++ bindings (../cpp_bindings) with the native path: a C++
program that links the library and calls the native `<name>` ABI directly,
passing {.ffi.} structs by value and reading typed struct returns
(EchoResponse) from the callback — no CBOR, no tinycbor. An RAII TimerNode
wrapper bridges the async FFI-thread callback to a synchronous API via
std::future. README spells out native (same-process) vs CBOR (IPC). Verified
end-to-end with `make run`.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Ivansete-status
force-pushed
the
ffi-native-typed-returns
branch
from
May 31, 2026 16:38
1060340 to
c000a84
Compare
Ivansete-status
force-pushed
the
cpp-native-example
branch
from
May 31, 2026 16:38
0eed91c to
03c9cbe
Compare
Ivansete-status
marked this pull request as draft
June 1, 2026 07:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the native C++ example to sit alongside the existing CBOR C++ bindings,
so C++ has both ABIs covered (as requested). Based on the native-FFI stack (#58)
for typed struct returns.
What
examples/timer/cpp_native/— a C++ program that links the library and callsthe native
<name>ABI directly:{.ffi.}structs by value in, typedEchoResponsestruct out (read in the callback). No CBOR, no tinycbor. An RAIITimerNodewrapper bridges the async FFI-thread callback to a synchronous APIwith
std::future.Native vs CBOR C++ (now both present)
cpp_native/(new)<name>cpp_bindings/<name>_cborValidation
Builds and runs end-to-end (
make run): version + typed echo round-trip.🤖 Generated with Claude Code