Use special FsfwFactoryObject instead of functions #451
Labels
No Label
API Change
Breaking API Change
bug
build
cosmetics
Documentation
duplicate
feature
help wanted
hotfix
invalid
question
Refactor
Tests
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: fsfw/fsfw#451
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The FSFW uses function pointers to assign the object producer function and declares
Factory::setStaticFrameworkObjects
as friend, which limits the possible functions to declare those objects to that function only. The second point is especially annoying, because I had to use preprocessor defines infsfw_tests
to allow an external project to specify their own object ID setter function. There is a better way to do both of them at once.This would require creating a
FsfwFactoryObject
with at least two virtual functions:virtual void createStaticFrameworkObjects
virtual void produceObjects
Now, a sensible default configuration can be provided in this function, which can also be overriden by the user. The user creates a custom factory object implementing the
FsfwFactoryObject
and then passes this object to the ObjectManager. The object manager can then use the object instance to initialize the framework.This approach could theoretically also be used to transfer more FSFW configuration to one hook class. Benefits:
For example, another virtual function
or a default value for the APID, which can be overriden via a
setApid
function.This is something for a future release..