1
0
forked from fsfw/fsfw

fifo updates

This commit is contained in:
2020-09-01 12:53:53 +02:00
parent e949637271
commit b522b3c29c
4 changed files with 11 additions and 9 deletions

View File

@ -1,5 +1,5 @@
#ifndef FRAMEWORK_CONTAINER_FIFO_H_
#define FRAMEWORK_CONTAINER_FIFO_H_
#ifndef FSFW_CONTAINER_FIFO_H_
#define FSFW_CONTAINER_FIFO_H_
#include "FIFOBase.h"
#include <array>
@ -16,18 +16,20 @@
template<typename T, size_t capacity>
class FIFO: public FIFOBase<T> {
public:
FIFO(): FIFOBase<T>(fifoArray.data(), capacity) {};
FIFO(): FIFOBase<T>(nullptr, capacity) {
this->setContainer(fifoArray.data());
};
/**
* @brief Custom copy constructor to set pointer correctly.
* @param other
*/
FIFO(const FIFO& other): FIFOBase<T>(other) {
this->setData(fifoArray.data());
this->setContainer(fifoArray.data());
}
private:
std::array<T, capacity> fifoArray;
};
#endif /* FRAMEWORK_CONTAINERS_STATICFIFO_H_ */
#endif /* FSFW_CONTAINER_FIFO_H_ */