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

Update createProxy to return a non-optional ObjectPrx #1817

Merged

Conversation

bernardnormier
Copy link
Member

This PR updates createProxy/createDirectoryProxy/createIndirectProxy to return a non-nullable proxy in C++.

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.

Looks good!

Ice::ConnectionI::createProxy(const Identity& ident) const
{
// TODO: merge my other PR code

// Create a reference and return a reverse proxy for this reference.
ReferencePtr ref =
_instance->referenceFactory()->create(ident, const_cast<ConnectionI*>(this)->shared_from_this());

Copy link
Member

Choose a reason for hiding this comment

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

Should we assert "ref" is not null? does the reference factory ever return null from create?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a good question. And no, ref can never but null, and I added a few asserts in ReferenceFactory to make sure the identity's name it gets is never empty.

@bernardnormier bernardnormier merged commit 3f3a350 into zeroc-ice:main Feb 20, 2024
20 checks passed
@bernardnormier bernardnormier deleted the create-proxy-with-identity branch May 10, 2024 23:43
InsertCreativityHere pushed a commit to InsertCreativityHere/compiler-comparison that referenced this pull request Jan 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants