-
Notifications
You must be signed in to change notification settings - Fork 93
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
Add a new method whether base was correctly initialized #315
Conversation
include/libdnf/base/base.hpp
Outdated
@@ -87,6 +87,9 @@ class Base { | |||
/// or Advisory query created. | |||
void setup(); | |||
|
|||
/// Returns true when setup() was not yet called. | |||
bool require_setup(); |
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 name sounds like you are telling the Base instance to require setup. Isn't setup_required()
or even is_setup_required()
better?
Personally I'd prefer function that returns true
in case the base object is correctly initialized - is_set_up()
, is_setup_complete()
, is_ready()
...
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.
Yes I definitely also vote for some "sentence-like" name, f.e. is_setup_completed()
or is_setup_required()
based on the logic underneath.
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.
Thank you for suggestions
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 about is_base_initialized
?
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 about
is_base_initialized
?
Sounds good, but as it is a method on the base
object I would use just is_initialized
.
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.
I'm fine with is_initialized
. The base
part in name is redundant here.
The methods is required in some applications with not exactly transparent work-flows. Resolves: rpm-software-management#310
Thanks, looks good. |
The methods is required in some applications with not exactly transparent work-flows.
Resolves: #310