nasa / cFE

The Core Flight System (cFS) Core Flight Executive (cFE)
Apache License 2.0
402 stars 198 forks source link

Fix #2546, add handle list operation routines #2548

Closed jphickey closed 2 months ago

jphickey commented 3 months ago

Checklist (Please check before submitting)

Describe the contribution Adds a "HandleLink" structure to encapsulate the linked list functionality and add generic routines to initialize and test/check this structure, along with list insert/remove functions for access descriptors that use this link struct interally.

This also cleans up documentation of the table resource ID functions defined in cfe_tbl_resource.h

Fixes #2546

Testing performed Build and run all tests

Expected behavior changes None (code clean up)

System(s) tested on Debian

Additional context Improves maintainability of code by moving linked list ops into common routines

Contributor Info - All information REQUIRED for consideration of pull request Joseph Hickey, Vantage Systems, Inc.

skliper commented 3 months ago

Any chance the linked list support could be an exposed API? I know CF has a linked list and nice if any other app wouldn't have to roll their own.

jphickey commented 3 months ago

Any chance the linked list support could be an exposed API? I know CF has a linked list and nice if any other app wouldn't have to roll their own.

Good suggestion. Although this does isolate the prev/next references into a linkage struct, the linkage here is still via Table Handle. So in other words - not a totally generic list function.

I think CFE should have a module for general purpose data structs, like trees and lists....