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

Document gatekeeper pattern in internal/local resource ID inline functions #1355

Closed
skliper opened this issue Apr 14, 2021 · 0 comments · Fixed by #1382 or #1431
Closed

Document gatekeeper pattern in internal/local resource ID inline functions #1355

skliper opened this issue Apr 14, 2021 · 0 comments · Fixed by #1382 or #1431
Assignees
Labels
CFS-40 docs This change only affects documentation.
Milestone

Comments

@skliper
Copy link
Contributor

skliper commented Apr 14, 2021

Is your feature request related to a problem? Please describe.
IsMatch functions check for NULL pointer, others don't:

static inline bool CFE_ES_AppRecordIsMatch(const CFE_ES_AppRecord_t *AppRecPtr, CFE_ES_AppId_t AppID)
{
return (AppRecPtr != NULL && CFE_RESOURCEID_TEST_EQUAL(AppRecPtr->AppId, AppID));
}

static inline const char *CFE_ES_AppRecordGetName(const CFE_ES_AppRecord_t *AppRecPtr)
{
return AppRecPtr->AppName;
}

Describe the solution you'd like
Document justification behind pattern (IsMatch is used first, then all other's are "safe")

Describe alternatives you've considered
None

Additional context
Code review

Requester Info
Jacob Hageman - NASA/GSFC

@skliper skliper added docs This change only affects documentation. CFS-40 labels Apr 14, 2021
@skliper skliper added this to the 7.0.0 milestone Apr 14, 2021
@jphickey jphickey self-assigned this Apr 19, 2021
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2021
Improve the doxygen documentation on the various helper functions
and common patterns dealing with Resource IDs.  Specifially, document
that the "IsMatch()" functions specifically accept NULL pointers to
allow use with initial validation (gatekeeper), but all other helper
functions assume a non-NULL pointer.
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2021
Improve the doxygen documentation on the various helper functions
and common patterns dealing with Resource IDs.  Specifically, document
that the "IsMatch()" functions specifically accept NULL pointers to
allow use with initial validation (gatekeeper), but all other helper
functions assume a non-NULL pointer.
jphickey added a commit to jphickey/cFE that referenced this issue Apr 19, 2021
Improve the doxygen documentation on the various helper functions
and common patterns dealing with Resource IDs.  Specifically, document
that the "IsMatch()" functions specifically accept NULL pointers to
allow use with initial validation (gatekeeper), but all other helper
functions assume a non-NULL pointer.
astrogeco added a commit that referenced this issue Apr 28, 2021
Fix #1355, improve documentation for resourceID patterns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CFS-40 docs This change only affects documentation.
Projects
None yet
2 participants