DataSetIF: Add read() and commit() to interface and move code to base class #97
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: fsfw/fsfw#97
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
Both dataset variants (global and local) have an almost identical code base. I moved common code into a base class. All datasets implemented so far had the
read()
andcommit()
calls so maybe these should be added to the interface.Code which is implementation specific is the lock of the underlying data structure.
I suggest adding
read(millis_t lockTimeout)
andcommit(millis_t lockTimeout)
to the interface as these functions are the core methods of the dataset class.This is not an API change, data set implemention can set the default block timeout as MutexIF::MAX_TIMEOUT which blocks the mutex (indefinitely) until it becomes available.,
UPDATE: Base class will not provide a static buffer of pool variables. Instead, it will store a pointer to the pool variables while a child class will supply the underlying data structure to store the pool variables.
For example, a StaticDataSet class might still use the static buffer with 63 pointers, while a different DataSet class will use a vector and reserve the maximum expected length in advance. This way, a dataset which is initialized at compile time on the heap will be a lot more memory efficient and could for example be used to access housekeeping data.
Example base class ctor:
LocalDataSet ctor, which uses a vector of PoolVariableIF pointers
UPDATE: DataSet will propably be split up into a StaticLocalDataSet and normal LocalDataSet which will both implement DataSetBase. StaticLocalDataSet will use a fixed size buffer of pointers while the normal implementation will use a vector (initialization on start-up) to reduce memory usage for data sets hwich are created once on the heap
Part of #280