forked from knela96/XMultiply-Arcade-Game
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDynamicArray.h
More file actions
53 lines (36 loc) · 711 Bytes
/
DynamicArray.h
File metadata and controls
53 lines (36 loc) · 711 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef __DYNAMIC_ARRAY_H__
#define __DYNAMIC_ARRAY_H__
#define DYNAMIC_ARRAY_CHUNK_SIZE 5
#define DYNAMIC_ARRAY_INITIAL_CAPACITY 5
template <class T>
class DynamicArray
{
private:
void increaseCapacity();
T *mArray = nullptr;
unsigned int mCapacity;
unsigned int mSize;
public:
DynamicArray() {
mCapacity = DYNAMIC_ARRAY_INITIAL_CAPACITY;
mSize = 0;
mArray = new[DYNAMIC_ARRAY_CHUNK_SIZE];
}
~DynamicArray();
unsigned int size() const {
}
T operator[ ](unsigned int index) const {
}
void push_back(T value) {
}
T elementAt(unsigned int index) const {
return mArray(index);
}
void insert(T value) {
}
void remove(unsigned int index() {
}
void empty() {
}
};
#endif