2020-07-05 23:53:13 +02:00
|
|
|
#ifndef FRAMEWORK_CONTAINER_STATICFIFO_H_
|
|
|
|
#define FRAMEWORK_CONTAINER_STATICFIFO_H_
|
|
|
|
|
|
|
|
#include <framework/returnvalues/HasReturnvaluesIF.h>
|
|
|
|
#include <framework/container/FIFOBase.h>
|
2020-07-06 13:41:07 +02:00
|
|
|
#include <array>
|
|
|
|
|
|
|
|
namespace fsfw {
|
2020-07-05 23:53:13 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Simple First-In-First-Out data structure with size fixed at
|
2020-07-06 13:41:07 +02:00
|
|
|
* compile time
|
|
|
|
* @details
|
|
|
|
* Performs no dynamic memory allocation.
|
|
|
|
* The public interface of FIFOBase exposes the user interface for the FIFO.
|
2020-07-05 23:53:13 +02:00
|
|
|
* @tparam T Entry Type
|
|
|
|
* @tparam capacity Maximum capacity
|
|
|
|
*/
|
|
|
|
template<typename T, size_t capacity>
|
|
|
|
class StaticFIFO: public FIFOBase<T> {
|
|
|
|
public:
|
|
|
|
StaticFIFO(): FIFOBase<T>(values.data(), capacity) {};
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::array<T, capacity> values;
|
|
|
|
};
|
|
|
|
|
2020-07-06 13:41:07 +02:00
|
|
|
}
|
|
|
|
|
2020-07-05 23:53:13 +02:00
|
|
|
#endif /* FRAMEWORK_CONTAINERS_STATICFIFO_H_ */
|