-
Notifications
You must be signed in to change notification settings - Fork 49
GEODE-9358: Initial revision of C bindings #821
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
Conversation
WIP: Add cache creation, destruction via wrapper WIP: Add wrapper class for Cache - implement getPdxReadSerialized, getPdxIgnoreUnreadFields WIP: Wrappers for PoolManager, PoolFactory, Pool, and RegionFactory - only bare-bones functionality implemented WIP: Implement RegionWrapper and RegionFactoryWrapper::createRegion WIP: String put/get works with Python tests now Add remove, containsValueForKey to region wrapper WIP: Add proper CacheFactory wrapper WIP: getCredentials is working(!) AuthInitialize wrapper implemented - getCredentials now working from Python Fix export function declarations on Linux Add CreateCacheFactory back to header - Accidentally removed Co-authored-by: Michael Oleske <moleske@pivotal.io> WIP: Implement a few more Cache APIs - added getName, close, isClosed - switched output to NC logger for debugging traces WIP: leak checking signs of life Fix crash in Client wrapper (check for null) GEODE-7928: C bindings are prefixed with geode_. Replaced void pointers with opaque pointers for increased type safety. Fixed broken signatures. Removed erroneous and unused implementations. Comment out throw in geode_ClientUninitialize - also some formatting changes [#172065949]: Moved C bindings to it's own top level directory aptly named c_bindings. Changed prefix from geode_ to apache_geode_. Reorganized implementation. Shuffled files. Unnecessary symbols stripped from library. Fix exports for C bindings on Windows Added OSX guard around symbol whitelist. Installing C headers. Make static lib code position-independent (-fPIC), so that it can be consumed when building a shared library. Hiding symbols on Linux. Add support for Put/GetByteArray Unit tests. Removed Client singleton. C++17 nested namespaces, because we deserve it. Remove extraneous files that got inadvertently checked in - most likely generated by an automated tool or IDE someone was using - These are causing RAT check to fail, because they don't have Apache License notices
- include objbase.h to get def for CoTaskMemAlloc, required for .net p/invokes - Insert parens around name of std::numeric_limits::max, to fix clash with insane Windows max macro - Copy apache-geode.dll to output dir of C bindings test - Revert to C++ 11 standard until we can fix templates in functional.hpp
- bad cast to CacheFactory, rather than CacheFactoryWrapper, was blowing up test - Added new test using C bindings
- Was crashing in leak detection code. Fixed cause of crash, and also added a catchall block, so we don't throw across the library boundary.
- VS2019 compiler flagged a new warning as an error
- Also reformat C Bindings code
35e4494 to
d8fa3dd
Compare
mmartell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome addition to geode-native. With C's stable ABI, seems like the right way to open the door for other languages.
c_bindings/src/region.cpp
Outdated
| #endif | ||
| if (bytes) { | ||
| memcpy(byteArray, bytes->value().data(), valSize); | ||
| *value = (char*)byteArray; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's your clang-tidy problem, use a reinterpret_cast.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thx.
echobravopapa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍
Co-authored-by: Blake Bender <bblake@vmware.com> Co-authored-by: Matthew Reddington <mreddington@pivotal.io> Co-authored-by: Michael Oleske <moleske@pivotal.io>
Co-authored-by: Blake Bender <bblake@vmware.com> Co-authored-by: Matthew Reddington <mreddington@pivotal.io> Co-authored-by: Michael Oleske <moleske@pivotal.io>
This is the initial work to create a C API for
geode-native. The goal of this work is not to enable access togeode-nativefrom the C language, though that will happen as a matter of course, but rather to enable access from all the other languages (.net core, Python, Go, etc.) from which access to a C API is simple and straightforward.RFC