52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#ifndef GROWABLEDOUBLEARRAY_HPP
|
|
#define GROWABLEDOUBLEARRAY_HPP
|
|
|
|
#include "include/array/GrowableArray.hpp"
|
|
|
|
class GrowableDoubleArray{
|
|
|
|
public:
|
|
|
|
GrowableDoubleArray(unsigned int initSize=minmum_capacity);
|
|
|
|
double* getArrayData();
|
|
|
|
unsigned int capacity();
|
|
|
|
const unsigned int& length=arrlen;
|
|
|
|
const unsigned int& element_size=elementSize;
|
|
|
|
void put(const double e);
|
|
|
|
void set(unsigned index, const double e);
|
|
|
|
void copyFrom(const double* data, unsigned int count);
|
|
|
|
void copyFrom(const double* data, unsigned int index, unsigned int count);
|
|
|
|
void copyFrom(const double* data, unsigned int index, unsigned int bufferOffset, unsigned int count);
|
|
|
|
double get(unsigned int index);
|
|
|
|
void remove(unsigned int index);
|
|
|
|
void gc();
|
|
|
|
void clear();
|
|
|
|
~GrowableDoubleArray();
|
|
|
|
private:
|
|
|
|
GrowableArray* array;
|
|
|
|
unsigned int arrlen;
|
|
unsigned int elementSize;
|
|
|
|
static const unsigned int minmum_capacity;
|
|
|
|
};
|
|
|
|
#endif // GROWABLEDOUBLEARRAY_HPP
|