2016-06-15 23:48:41 +02:00
|
|
|
#ifndef POOLVARIABLEIF_H_
|
|
|
|
#define POOLVARIABLEIF_H_
|
|
|
|
|
|
|
|
#include <framework/returnvalues/HasReturnvaluesIF.h>
|
|
|
|
#include <framework/serialize/SerializeIF.h>
|
|
|
|
|
2020-05-17 01:17:11 +02:00
|
|
|
|
2016-06-15 23:48:41 +02:00
|
|
|
/**
|
2020-05-17 01:17:11 +02:00
|
|
|
* @brief This interface is used to control data pool variable representations.
|
|
|
|
* @details
|
|
|
|
* To securely handle data pool variables, all pool entries are locally
|
|
|
|
* managed by data pool variable access classes, which are called pool
|
|
|
|
* variables. To ensure a common state of a set of variables needed in a
|
|
|
|
* function, these local pool variables again are managed by other classes,
|
|
|
|
* like the DataSet classes. This interface provides unified access to
|
|
|
|
* local pool variables for such manager classes.
|
|
|
|
* @author Bastian Baetz
|
|
|
|
* @ingroup data_pool
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
class PoolVariableIF : public SerializeIF {
|
2020-05-17 23:41:28 +02:00
|
|
|
friend class DataSetBase;
|
2020-05-17 01:17:11 +02:00
|
|
|
friend class GlobDataSet;
|
|
|
|
friend class LocalDataSet;
|
2016-06-15 23:48:41 +02:00
|
|
|
protected:
|
|
|
|
/**
|
2020-05-17 01:17:11 +02:00
|
|
|
* @brief The commit call shall write back a newly calculated local
|
|
|
|
* value to the data pool.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
virtual ReturnValue_t commit() = 0;
|
|
|
|
/**
|
2020-05-17 01:17:11 +02:00
|
|
|
* @brief The read call shall read the value of this parameter from
|
|
|
|
* the data pool and store the content locally.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
virtual ReturnValue_t read() = 0;
|
|
|
|
public:
|
2020-05-17 01:17:11 +02:00
|
|
|
static constexpr bool VALID = 1;
|
|
|
|
static constexpr bool INVALID = 0;
|
|
|
|
static constexpr uint32_t NO_PARAMETER = 0;
|
|
|
|
|
2016-06-15 23:48:41 +02:00
|
|
|
enum ReadWriteMode_t {
|
|
|
|
VAR_READ, VAR_WRITE, VAR_READ_WRITE
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
2020-05-17 01:17:11 +02:00
|
|
|
* @brief This is an empty virtual destructor,
|
|
|
|
* as it is proposed for C++ interfaces.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
2020-05-17 01:17:11 +02:00
|
|
|
virtual ~PoolVariableIF() {}
|
2016-06-15 23:48:41 +02:00
|
|
|
/**
|
2020-05-17 01:17:11 +02:00
|
|
|
* @brief This method returns if the variable is write-only, read-write or read-only.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
virtual ReadWriteMode_t getReadWriteMode() const = 0;
|
|
|
|
/**
|
2020-05-17 01:17:11 +02:00
|
|
|
* @brief This operation shall return the data pool id of the variable.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
virtual uint32_t getDataPoolId() const = 0;
|
|
|
|
/**
|
2020-05-17 01:17:11 +02:00
|
|
|
* @brief With this call, the valid information of the variable is returned.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
virtual bool isValid() const = 0;
|
|
|
|
/**
|
2020-05-17 01:17:11 +02:00
|
|
|
* @brief With this call, the valid information of the variable is set.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
2020-05-17 01:17:11 +02:00
|
|
|
// why not just use a boolean here?
|
2016-06-15 23:48:41 +02:00
|
|
|
virtual void setValid(uint8_t validity) = 0;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2020-05-17 01:17:11 +02:00
|
|
|
using pool_rwm_t = PoolVariableIF::ReadWriteMode_t;
|
|
|
|
|
2016-06-15 23:48:41 +02:00
|
|
|
#endif /* POOLVARIABLEIF_H_ */
|