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

C++ build fixes #207

Merged
merged 18 commits into from
May 29, 2024
Merged

C++ build fixes #207

merged 18 commits into from
May 29, 2024

Conversation

externl
Copy link
Member

@externl externl commented May 28, 2024

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.

@externl externl requested a review from pepone May 28, 2024 15:44
.github/workflows/ci.yml Outdated Show resolved Hide resolved
cpp/Chat/client/Client.cpp Outdated Show resolved Hide resolved
cpp/Chat/client/Client.cpp Outdated Show resolved Hide resolved
cpp/Chat/client/Client.cpp Outdated Show resolved Hide resolved
cpp/Glacier2/callback/Client.cpp Outdated Show resolved Hide resolved
cpp/Glacier2/simpleChat/ChatSessionI.cpp Outdated Show resolved Hide resolved
cpp/Glacier2/simpleChat/ChatSessionI.cpp Outdated Show resolved Hide resolved
cpp/Glacier2/simpleChat/ChatSessionI.cpp Outdated Show resolved Hide resolved
cpp/Glacier2/simpleChat/Client.cpp Outdated Show resolved Hide resolved
@externl externl requested a review from pepone May 29, 2024 14:59
@externl externl marked this pull request as ready for review May 29, 2024 14:59
Copy link
Member

@pepone pepone left a 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.

const string message = "usage: ";
throw runtime_error(message + appName());
}
throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?");
Copy link
Member

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.

Comment on lines 131 to 134
auto callbackPrx = adapter->add(make_shared<ChatRoomCallbackI>(), id);

// Set the callback proxy on the session
session->setCallback(Chat::ChatRoomCallbackPrx{callbackPrx});
Copy link
Member

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?

Suggested change
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 =
Copy link
Member

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.

optional<Ice::RouterPrx> defaultRouter = communicator->getDefaultRouter();
if (!defaultRouter)
{
throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?");
Copy link
Member

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move callback?

Suggested change
chatRoom->enter(ChatSessionPrx(current.adapter->createProxy(current.id)), *callback, current);
chatRoom->enter(ChatSessionPrx(current.adapter->createProxy(current.id)), std::move(*callback), current);

optional<Ice::RouterPrx> defaultRouter = communicator->getDefaultRouter();
if (!defaultRouter)
{
throw runtime_error("Glaicer2::createSession return null. Is the SessionManager configured?");
Copy link
Member

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.

@pepone pepone self-requested a review May 29, 2024 16:40
cpp/IceGrid/icebox/HelloI.cpp Outdated Show resolved Hide resolved
cpp/IceStorm/clock/Publisher.cpp Show resolved Hide resolved
Copy link
Member

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?

Copy link
Member Author

@externl externl May 29, 2024

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

Copy link
Member

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?

Copy link
Member Author

@externl externl May 29, 2024

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.

@externl externl requested a review from pepone May 29, 2024 17:26
@@ -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)};
Copy link
Member

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)};

@externl externl merged commit 54f480d into zeroc-ice:main May 29, 2024
4 checks passed
@externl externl deleted the cpp-fixes branch May 29, 2024 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants