-
Notifications
You must be signed in to change notification settings - Fork 215
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
C++ build fixes #207
C++ build fixes #207
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.
A few comments, I will finish reviewing in a bit.
cpp/Chat/client/Client.cpp
Outdated
const string message = "usage: "; | ||
throw runtime_error(message + appName()); | ||
} | ||
throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?"); |
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.
It seems you forgot to update the error message here.
cpp/Chat/client/Client.cpp
Outdated
auto callbackPrx = adapter->add(make_shared<ChatRoomCallbackI>(), id); | ||
|
||
// Set the callback proxy on the session | ||
session->setCallback(Chat::ChatRoomCallbackPrx{callbackPrx}); |
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.
Can we do this instead?
auto callbackPrx = adapter->add(make_shared<ChatRoomCallbackI>(), id); | |
// Set the callback proxy on the session | |
session->setCallback(Chat::ChatRoomCallbackPrx{callbackPrx}); | |
Chat::ChatRoomCallbackPrx callbackPrx = adapter->add(make_shared<ChatRoomCallbackI>(), id); | |
// Set the callback proxy on the session | |
session->setCallback(callbackPrx); |
@@ -30,7 +30,7 @@ void | |||
ChatRoom::join(const string& name, const shared_ptr<ChatRoomCallbackAdapter>& callback) | |||
{ | |||
const lock_guard<mutex> sync(_mutex); | |||
const long long timestamp = | |||
const auto timestamp = |
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.
We use const long long timestamp =
in a few other places, I would upgrade all for consistency.
cpp/Glacier2/callback/Client.cpp
Outdated
optional<Ice::RouterPrx> defaultRouter = communicator->getDefaultRouter(); | ||
if (!defaultRouter) | ||
{ | ||
throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?"); |
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.
We need to update the error message, this is not related to createSession.
Ice::uncheckedCast<ChatSessionPrx>(current.adapter->createProxy(current.id)), | ||
callback, | ||
current); | ||
chatRoom->enter(ChatSessionPrx(current.adapter->createProxy(current.id)), *callback, current); |
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.
Can we move callback?
chatRoom->enter(ChatSessionPrx(current.adapter->createProxy(current.id)), *callback, current); | |
chatRoom->enter(ChatSessionPrx(current.adapter->createProxy(current.id)), std::move(*callback), current); |
cpp/Glacier2/simpleChat/Client.cpp
Outdated
optional<Ice::RouterPrx> defaultRouter = communicator->getDefaultRouter(); | ||
if (!defaultRouter) | ||
{ | ||
throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?"); |
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.
ditto for the error message.
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.
Not clear what changed in this file besides the Ice version, the formatting?
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.
Yep that's it. I updated the IceStorm service plugin version and the formatting
cpp/Manual/lifecycle/Client.cpp
Outdated
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.
Why are we removing Manual/lifecycle demo?
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.
We removed this example from the docs a while back. This was supposed to have been removed then.
cpp/Chat/client/Client.cpp
Outdated
@@ -128,7 +128,7 @@ run(shared_ptr<Ice::Communicator> communicator) | |||
// provided by the router | |||
Ice::Identity id{Ice::generateUUID(), router->getCategoryForClient()}; | |||
|
|||
Chat::ChatRoomCallbackPrx callbackPrx = adapter->add(make_shared<ChatRoomCallbackI>(), id); | |||
auto callbackPrx = Chat::ChatRoomCallbackPrx{adapter->add(make_shared<ChatRoomCallbackI>(), id)}; |
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.
or
Chat::ChatRoomCallbackPrx callbackPrx{adapter->add(make_shared<ChatRoomCallbackI>(), id)};
This PR is the first step in getting the demos working again. Right now it just fixes the C++ builds. There's still optimizations to be made (using string_view, reducing optional usage, etc) in follow-up PRs.