libnative-utilities/include/array/GrowableLongArray.hpp

53 lines
1.1 KiB
C++
Raw Normal View History

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