-
Notifications
You must be signed in to change notification settings - Fork 603
SNMP: Replace mib_tree_entry struct with MEMPROXY class #2284
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
base: master
Are you sure you want to change the base?
Conversation
|
Steps 1 (use MEMPROXY for new/delete) and 2 (C++11 initialization and constructor) |
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.
Several other change requests also avoid in-class initialization of members that must be initialized via class constructor (assuming that they must be). In this and other PRs, let's give compiler a chance to warn us if we forget to initialize such members while refactoring object construction code.
Co-authored-by: Alex Rousskov <rousskov@measurement-factory.com>
| entry->len = len; | ||
| const auto entry = new mib_tree_entry(name, len, aggrType); | ||
| entry->parsefunction = parsefunction; | ||
| entry->instancefunction = instancefunction; |
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.
Is there any specific reasons for not including parsefunction and instancefunction in the constructor?
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.
Simplicity for now. Later refactor steps will change them.
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.
What does done look like with the later refactor steps?
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.
What does done look like with the later refactor steps?
I suspect there will be two mib_tree_entry constructors, one setting (constant) parse/instance functions and one prohibiting them. Or two C++ class types to differentiate the two use cases. Or perhaps a lot more classes, with those functions converted to class methods. Delaying that non-trivial refactoring may be the right decision, but I have not studied all the necessary details to be sure.
No description provided.