libnative-utilities/include/array/GrowableFloatArray.hpp

52 lines
1.0 KiB
C++
Raw Permalink Normal View History

2024-08-15 18:40:30 +08:00
#ifndef GROWABLEFLOATARRAY_HPP
#define GROWABLEFLOATARRAY_HPP
#include "include/array/GrowableArray.hpp"
class GrowableFloatArray{
public:
GrowableFloatArray(unsigned int initSize=minmum_capacity);
float* getArrayData();
unsigned int capacity();
const unsigned int& length=arrlen;
const unsigned int& element_size=elementSize;
void put(const float e);
void set(unsigned index, const float e);
void copyFrom(const float* data, unsigned int count);
void copyFrom(const float* data, unsigned int index, unsigned int count);
void copyFrom(const float* data, unsigned int index, unsigned int bufferOffset, unsigned int count);
float get(unsigned int index);
void remove(unsigned int index);
void gc();
void clear();
~GrowableFloatArray();
private:
GrowableArray* array;
unsigned int arrlen;
unsigned int elementSize;
static const unsigned int minmum_capacity;
};
#endif // GROWABLEFLOATARRAY_HPP