2020-09-06 15:23:38 +02:00
|
|
|
#ifndef FSFW_DATAPOOL_POOLDATASETIF_H_
|
|
|
|
#define FSFW_DATAPOOL_POOLDATASETIF_H_
|
|
|
|
|
2020-12-27 01:52:48 +01:00
|
|
|
#include "ReadCommitIF.h"
|
2020-09-06 15:23:38 +02:00
|
|
|
#include "DataSetIF.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Extendes the DataSetIF by adding abstract functions to lock
|
|
|
|
* and unlock a data pool and read/commit semantics.
|
|
|
|
*/
|
2020-12-27 01:52:48 +01:00
|
|
|
class PoolDataSetIF: public DataSetIF, public ReadCommitIF {
|
2020-09-06 15:23:38 +02:00
|
|
|
public:
|
|
|
|
virtual~ PoolDataSetIF() {};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Most underlying data structures will have a pool like structure
|
|
|
|
* and will require a lock and unlock mechanism to ensure
|
|
|
|
* thread-safety
|
|
|
|
* @return Lock operation result
|
|
|
|
*/
|
2021-01-06 21:14:23 +01:00
|
|
|
virtual ReturnValue_t lockDataPool(
|
|
|
|
MutexIF::TimeoutType timeoutType = MutexIF::TimeoutType::WAITING,
|
|
|
|
uint32_t timeoutMs = 20) = 0;
|
|
|
|
|
2020-09-06 15:23:38 +02:00
|
|
|
/**
|
|
|
|
* @brief Unlock call corresponding to the lock call.
|
|
|
|
* @return Unlock operation result
|
|
|
|
*/
|
|
|
|
virtual ReturnValue_t unlockDataPool() = 0;
|
|
|
|
|
|
|
|
virtual bool isValid() const = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* FSFW_DATAPOOL_POOLDATASETIF_H_ */
|