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

feat(cppclient): provide entry points for C API #5695

Merged
merged 1 commit into from
Jun 27, 2024

Conversation

kosak
Copy link
Contributor

@kosak kosak commented Jun 27, 2024

This PR provides the entry points for the "C API" to the Deephaven C++ library.

Notes for the reviewer: client_options_interop.[cc,h] is probably the easiest to understand so I would recommend starting there. Then client_interop.[cc,h]

In many cases this is just writing "glue code" mechanically just by looking at the signatures of the methods in the C++ classes.

In a few cases we have made exceptions for simplicity.

For example TableHandle::Sort takes a vector of SortPair. For the C API, we could take an array of SortPair objects. But I decided it was simpler to decompose the SortPair object into its three components: column_name_, direction_, and abs_. So, for the Sort() C API we just pass in three arrays: of column names, of directions, and of abs, plus their length. Then the C API doesn't need to define a "SortPair" object at all.

There is also a bunch of template-heavy code involving changes to TableMaker. The C# code relies on this heavily (to make temporary tables for use in tests). You may not need to drill into this code, because it is complicated.

Currently the C++ test code, such as in select_test.cc, uses a call to the templated CompareTables method to compare actual tables to expected tables. In a future PR I will modify all this code to use TableMaker instead. At that time it will probably be more obvious how TableMaker is used.

@kosak kosak added NoDocumentationNeeded NoReleaseNotesNeeded No release notes are needed. labels Jun 27, 2024
@kosak kosak requested a review from jcferretti June 27, 2024 22:49
@kosak kosak self-assigned this Jun 27, 2024
@kosak kosak changed the title C++ Client: provide entry points for C API feat(cppclient): provide entry points for C API Jun 27, 2024
@kosak kosak enabled auto-merge (squash) June 27, 2024 23:10
@kosak kosak merged commit b243c72 into deephaven:main Jun 27, 2024
15 of 19 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2024
@kosak kosak deleted the kosak_cpp-interop branch June 27, 2024 23:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants