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

More string API updates #3006

Merged
merged 13 commits into from
Oct 30, 2024
Merged

Conversation

bernardnormier
Copy link
Member

This PR updates Communicator.h, Initialize.h, ImplicitContext.h and Plugin.h.

@@ -21,8 +19,8 @@

module Ice
{
/// A request context. <code>Context</code> is used to transmit metadata about a request from the server to the
Copy link
Member Author

Choose a reason for hiding this comment

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

The old description was bogus.

/// its implicit final parameter.
/// A string-string dictionary, used to transmit additional information with an Ice request. This context is only
/// transmitted with requests, from clients to servers; the Ice protocol does not provide response contexts.
["cpp:type:std::map<std::string, std::string, std::less<>>"]
Copy link
Member Author

Choose a reason for hiding this comment

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

The addition of std::less<> is the most disruptive part of this update.

map<string, PluginFactory>* factories = 0;
vector<string>* loadOnInitialization = 0;
map<string, PluginFactory>* factories = nullptr;
vector<string>* loadOnInitialization = nullptr;
Copy link
Member

Choose a reason for hiding this comment

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

Unrelated to the PR, can we replace the raw-pointers, and custom deleter by an unique_ptr?

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 not what this code is about. It's about static/lazy initialization and cleanup during static destruction.

Copy link
Member

Choose a reason for hiding this comment

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

We can still do lazy initialization using unique_ptr, which would be destroyed during static destruction.

_plugins.push_back(info);
info.name = std::move(name);
info.plugin = std::move(plugin);
_plugins.push_back(std::move(info));
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 use emplace_back here?

Copy link
Member Author

Choose a reason for hiding this comment

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

PluginInfo is a plain struct with no user-defined constructor. So no, it doesn't work.

cpp/src/Ice/PluginManagerI.cpp Outdated Show resolved Hide resolved
cpp/src/Ice/Reference.cpp Outdated Show resolved Hide resolved
cpp/src/Ice/PluginManagerI.cpp Show resolved Hide resolved
@bernardnormier bernardnormier merged commit 02927bf into zeroc-ice:main Oct 30, 2024
17 checks passed
@bernardnormier bernardnormier deleted the string-view2 branch December 9, 2024 17:10
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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants