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
GEODE-4427: Moving CliCallbackMethod to DistributedSystemImpl #233
GEODE-4427: Moving CliCallbackMethod to DistributedSystemImpl #233
Conversation
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.
Lovely, c++11 constructs and removing dead code
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.
Windows won't build
C:\nativeclient\clicache\src\DistributedSystem.cpp(498): error C2440: 'type cast': cannot convert from 'void *' to 'apache::geode::client::CliCallbackMethod' [C:\build\clicache\src\Apache.Geode.vcxproj]
C:\nativeclient\clicache\src\DistributedSystem.cpp(498): note: No constructor could
Signed-off-by: Blake Bender <bbender@pivotal.io>
Fixed the build issue, needed some changes in the c++/cli. |
@@ -493,7 +493,7 @@ namespace Apache | |||
&CliCallbackDelegate::Callback); | |||
|
|||
native::DistributedSystemImpl::registerCliCallback(System::Threading::Thread::GetDomainID(), | |||
(native::CliCallbackMethod)System::Runtime::InteropServices:: | |||
(void (*)(apache::geode::client::Cache &cache))System::Runtime::InteropServices:: |
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.
Given that you remove a C-style function pointer on C++ side (which I think is appropriate), is there any reason to perpetuate the C-style function pointer here? If you must, then why not use a C++ style cast? Furthermore, is it possible to replace CliCallbackDelegate and cliCallback with some std::functional magic now that that's what will be used in the C++ side?
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.
The cast is required because the delegate function pointer given by this call is a void*
. It won’t convert to anything that matches std::function
will accept.
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.
Do we need to use delegates? Was that required because of appdomain fun? If so, is it still relevant in a world without globals?
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.
Sadly we still need this delegate to call back from the native side into the .NET side for cleanup when the cachenis closed. It could probably be refactored but its outside this scope.
…#233) Signed-off-by: Blake Bender <bbender@pivotal.io>
No description provided.