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

Update Svc/PolyDb to use configurable FPP enumeration as index #2587

Merged
merged 6 commits into from
Mar 26, 2024

Conversation

timcanham
Copy link
Collaborator

Related Issue(s) none
Has Unit Tests (y/n) y
Documentation Included (y/n) y

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.

@timcanham timcanham requested a review from LeStarch March 12, 2024 01:54
@timcanham timcanham self-assigned this Mar 12, 2024
Svc/PolyDb/PolyDb.hpp Fixed Show resolved Hide resolved
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Fixed Show fixed Hide fixed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Fixed Show fixed Hide fixed
Svc/PolyDb/PolyDb.cpp Fixed Show resolved Hide resolved
Svc/PolyDb/PolyDb.cpp Fixed Show resolved Hide resolved
Svc/PolyDb/PolyDb.hpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Copy link
Collaborator

@LeStarch LeStarch left a 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!

enum {
POLYDB_NUM_DB_ENTRIES = 25
};
// enum {
Copy link
Collaborator

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.

config/PolyDbCfg.fpp Show resolved Hide resolved
@@ -1,9 +1,9 @@
This test can be run by executing the following:
Copy link
Collaborator

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.

Copy link
Collaborator Author

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 @@
// ======================================================================
Copy link
Collaborator

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.hpp Fixed Show resolved Hide resolved
Svc/PolyDb/PolyDb.cpp Fixed Show resolved Hide resolved
Svc/PolyDb/PolyDb.cpp Fixed Show resolved Hide resolved
}

void PolyDb::init(NATIVE_INT_TYPE instance) {
PolyDbComponentBase::init(instance);
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed.

Svc/PolyDb/PolyDb.cpp Show resolved Hide resolved
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Svc/PolyDb/PolyDb.cpp Dismissed Show dismissed Hide dismissed
Copy link
Collaborator

@LeStarch LeStarch left a 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.

@timcanham timcanham linked an issue Mar 12, 2024 that may be closed by this pull request
@timcanham timcanham marked this pull request as ready for review March 12, 2024 20:45
@LeStarch LeStarch merged commit 00eed9f into nasa:devel Mar 26, 2024
34 checks passed
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.

Update PolyDb to use an FPP enum for the index
2 participants