fsfw/datapoollocal/SharedLocalDataSet.h

32 lines
1.1 KiB
C
Raw Normal View History

2020-07-14 15:45:03 +02:00
#ifndef FRAMEWORK_DATAPOOLLOCAL_SHAREDLOCALDATASET_H_
#define FRAMEWORK_DATAPOOLLOCAL_SHAREDLOCALDATASET_H_
#include "../datapool/SharedDataSetIF.h"
#include "../datapoollocal/LocalPoolDataSetBase.h"
#include "../objectmanager/SystemObject.h"
2020-07-14 15:45:03 +02:00
#include <vector>
2020-07-16 11:45:23 +02:00
/**
* Baseline question: If this dataset is shared, is there once instance
* shared among many objects or multiple instances? Maybe be flexible
* and provide both ways? Sharing one instance requires a mutex lock.
* If there are multiple instances, it is not shared anymore, to be fair..
* Then a regular local data set is sufficient.
*/
2020-07-14 15:45:03 +02:00
class SharedLocalDataSet: public SystemObject,
2020-08-08 12:51:31 +02:00
public LocalPoolDataSetBase,
2020-07-14 15:45:03 +02:00
public SharedDataSetIF {
public:
SharedLocalDataSet(object_id_t objectId, object_id_t owner,
const size_t maxSize);
ReturnValue_t lockDataset(dur_millis_t mutexTimeout) override;
ReturnValue_t unlockDataset() override;
private:
MutexIF* datasetLock = nullptr;
std::vector<PoolVariableIF*> poolVarVector;
};
#endif /* FRAMEWORK_DATAPOOLLOCAL_SHAREDLOCALDATASET_H_ */