-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 Svc/PolyDb
to use configurable FPP enumeration as index
#2587
Conversation
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.
A lot of comments but all little nit-picks.
This is a great PR and a huge improvement!
config/PolyDbImplCfg.hpp
Outdated
enum { | ||
POLYDB_NUM_DB_ENTRIES = 25 | ||
}; | ||
// enum { |
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.
If the entry count is inferred from the number of entries in the enum, then delete this whole file.
Svc/PolyDb/test/ut/Readme.txt
Outdated
@@ -1,9 +1,9 @@ | |||
This test can be run by executing the following: |
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.
Just delete this file? We no longer maintain per-component readmes.
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.
Removed.
@@ -0,0 +1,38 @@ | |||
// ====================================================================== |
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.
You could take this opportunity to switch to the auto-helpers setup which autocodes this file.
Svc/PolyDb/PolyDb.cpp
Outdated
} | ||
|
||
void PolyDb::init(NATIVE_INT_TYPE instance) { | ||
PolyDbComponentBase::init(instance); |
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.
Delete the whole init
function. We have been removing them and using the parent init
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.
Removed.
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.
Looks good to me.
Change Description
Update
Svc/PolyDb
to use an FPP enum for the database index. PolyDb implementation files were also updated to the new file naming convention.Rationale
Using an FPP enum allows projects to assign names to the index as opposed to using just a bare integer. This will make the code clearer and less error-prone. Moving the index enum to the config directory separates it from the implementation so projects can customize it.
Testing/Review Recommendations
Unit testing was update to the new file organization and helper classes. The nominal unit test code was essentially unchanged except for updating to use the enumeration class.
Future Work
This enables the future sequencing proposals to have conditional logic based on
PolyDb
entries. The sequences can have entries by name using the FPP enum to make it clearer.