#ifndef FIXEDARRAYLIST_H_ #define FIXEDARRAYLIST_H_ #include /** * @brief Array List with a fixed maximum size * @ingroup container */ template class FixedArrayList: public ArrayList { private: T data[MAX_SIZE]; public: FixedArrayList() : ArrayList(data, MAX_SIZE) { } //We could create a constructor to initialize the fixed array list with data and the known size field //so it can be used for serialization too (with SerialFixedArrrayListAdapter) //is this feasible? FixedArrayList(T * data_, count_t count, bool swapArrayListEndianess = false): ArrayList(data, MAX_SIZE) { memcpy(this->data, data_, count); this->size = count; if(swapArrayListEndianess) { ArrayList::swapArrayListEndianness(); } } FixedArrayList(const FixedArrayList& other) : ArrayList(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_ */