2020-09-06 15:23:38 +02:00
|
|
|
#ifndef FSFW_DATAPOOL_POOLENTRYIF_H_
|
|
|
|
#define FSFW_DATAPOOL_POOLENTRYIF_H_
|
2016-06-15 23:48:41 +02:00
|
|
|
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "../globalfunctions/Type.h"
|
2020-06-05 13:43:06 +02:00
|
|
|
#include <cstdint>
|
2018-07-12 16:29:32 +02:00
|
|
|
|
2016-06-15 23:48:41 +02:00
|
|
|
/**
|
2020-06-05 13:43:06 +02:00
|
|
|
* @brief This interface defines the access possibilities to a
|
|
|
|
* single data pool entry.
|
|
|
|
* @details
|
|
|
|
* The interface provides methods to determine the size and the validity
|
|
|
|
* information of a value. It also defines a method to receive a pointer to the
|
|
|
|
* raw data content. It is mainly used by DataPool itself, but also as a
|
|
|
|
* return pointer.
|
2016-06-15 23:48:41 +02:00
|
|
|
*
|
2020-06-05 13:43:06 +02:00
|
|
|
* @author Bastian Baetz
|
|
|
|
* @ingroup data_pool
|
2016-06-15 23:48:41 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
class PoolEntryIF {
|
|
|
|
public:
|
|
|
|
/**
|
2020-06-05 13:43:06 +02:00
|
|
|
* @brief This is an empty virtual destructor,
|
|
|
|
* as it is required for C++ interfaces.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
virtual ~PoolEntryIF() {
|
|
|
|
}
|
|
|
|
/**
|
2020-06-05 13:43:06 +02:00
|
|
|
* @brief getSize returns the array size of the entry.
|
|
|
|
* A single variable parameter has size 1.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
virtual uint8_t getSize() = 0;
|
|
|
|
/**
|
2020-06-05 13:43:06 +02:00
|
|
|
* @brief This operation returns the size in bytes, which is calculated by
|
2016-06-15 23:48:41 +02:00
|
|
|
* sizeof(type) * array_size.
|
|
|
|
*/
|
|
|
|
virtual uint16_t getByteSize() = 0;
|
|
|
|
/**
|
2020-06-05 13:43:06 +02:00
|
|
|
* @brief This operation returns a the address pointer casted to void*.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
virtual void* getRawData() = 0;
|
|
|
|
/**
|
2020-06-05 13:43:06 +02:00
|
|
|
* @brief This method allows to set the valid information of the pool entry.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
2020-06-05 13:43:06 +02:00
|
|
|
virtual void setValid(bool isValid) = 0;
|
2016-06-15 23:48:41 +02:00
|
|
|
/**
|
2020-06-05 13:43:06 +02:00
|
|
|
* @brief This method allows to set the valid information of the pool entry.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
2020-06-05 13:43:06 +02:00
|
|
|
virtual bool getValid() = 0;
|
2016-06-15 23:48:41 +02:00
|
|
|
/**
|
2020-06-05 13:43:06 +02:00
|
|
|
* @brief This is a debug method that prints all values and the valid
|
|
|
|
* information to the screen. It prints all array entries in a row.
|
|
|
|
* @details
|
|
|
|
* Also displays whether the pool entry is valid or invalid.
|
2016-06-15 23:48:41 +02:00
|
|
|
*/
|
|
|
|
virtual void print() = 0;
|
|
|
|
/**
|
|
|
|
* Returns the type of the entry.
|
|
|
|
*/
|
|
|
|
virtual Type getType() = 0;
|
|
|
|
};
|
|
|
|
|
2020-09-06 15:23:38 +02:00
|
|
|
#endif /* FSFW_DATAPOOL_POOLENTRYIF_H_ */
|