feat(cppclient): provide entry points for C API #5695
Merged
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.
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. Thenclient_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 ofSortPair
. 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_
, andabs_
. 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 templatedCompareTables
method to compare actual tables to expected tables. In a future PR I will modify all this code to useTableMaker
instead. At that time it will probably be more obvious howTableMaker
is used.