2020-09-05 21:59:17 +02:00
|
|
|
#ifndef FSFW_DATAPOOLLOCAL_SHAREDLOCALDATASET_H_
|
|
|
|
#define FSFW_DATAPOOLLOCAL_SHAREDLOCALDATASET_H_
|
|
|
|
|
|
|
|
#include "LocalPoolDataSetBase.h"
|
2020-08-23 20:27:00 +02:00
|
|
|
#include "../datapool/SharedDataSetIF.h"
|
|
|
|
#include "../objectmanager/SystemObject.h"
|
2020-07-14 15:45:03 +02:00
|
|
|
#include <vector>
|
|
|
|
|
2021-01-12 20:46:34 +01:00
|
|
|
/**
|
|
|
|
* This local dataset variation can be used if the dataset is used concurrently across
|
|
|
|
* multiple threads. It provides a lock in addition to all other functionalities provided
|
|
|
|
* by the LocalPoolDataSetBase class.
|
|
|
|
*
|
|
|
|
* TODO: override and protect read, commit and some other calls used by pool manager.
|
|
|
|
*/
|
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:
|
2020-08-23 22:33:22 +02:00
|
|
|
SharedLocalDataSet(object_id_t objectId, sid_t sid,
|
2020-07-14 15:45:03 +02:00
|
|
|
const size_t maxSize);
|
|
|
|
ReturnValue_t lockDataset(dur_millis_t mutexTimeout) override;
|
|
|
|
ReturnValue_t unlockDataset() override;
|
|
|
|
private:
|
|
|
|
|
|
|
|
MutexIF* datasetLock = nullptr;
|
|
|
|
std::vector<PoolVariableIF*> poolVarVector;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2020-09-05 21:59:17 +02:00
|
|
|
#endif /* FSFW_DATAPOOLLOCAL_SHAREDLOCALDATASET_H_ */
|