2016-06-15 23:48:41 +02:00
|
|
|
#ifndef FIXEDARRAYLIST_H_
|
|
|
|
#define FIXEDARRAYLIST_H_
|
|
|
|
|
2020-08-13 20:53:35 +02:00
|
|
|
#include "ArrayList.h"
|
2019-08-28 14:50:24 +02:00
|
|
|
/**
|
|
|
|
* \ingroup container
|
|
|
|
*/
|
2016-06-15 23:48:41 +02:00
|
|
|
template<typename T, uint32_t MAX_SIZE, typename count_t = uint8_t>
|
|
|
|
class FixedArrayList: public ArrayList<T, count_t> {
|
|
|
|
private:
|
|
|
|
T data[MAX_SIZE];
|
|
|
|
public:
|
|
|
|
FixedArrayList() :
|
|
|
|
ArrayList<T, count_t>(data, MAX_SIZE) {
|
|
|
|
}
|
|
|
|
|
|
|
|
FixedArrayList(const FixedArrayList& other) :
|
|
|
|
ArrayList<T, count_t>(data, MAX_SIZE) {
|
|
|
|
memcpy(this->data, other.data, sizeof(this->data));
|
|
|
|
this->entries = data;
|
|
|
|
}
|
|
|
|
|
|
|
|
FixedArrayList& operator=(FixedArrayList other) {
|
|
|
|
memcpy(this->data, other.data, sizeof(this->data));
|
|
|
|
this->entries = data;
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~FixedArrayList() {
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* FIXEDARRAYLIST_H_ */
|