-
Notifications
You must be signed in to change notification settings - Fork 593
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
More string API updates #3006
Conversation
@@ -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 |
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 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<>>"] |
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 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; |
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.
Unrelated to the PR, can we replace the raw-pointers, and custom deleter by an unique_ptr?
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.
That's not what this code is about. It's about static/lazy initialization and cleanup during static destruction.
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 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)); |
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 use emplace_back here?
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.
PluginInfo is a plain struct with no user-defined constructor. So no, it doesn't work.
This PR updates Communicator.h, Initialize.h, ImplicitContext.h and Plugin.h.