Rudiments
dynamicarray.h
1// Copyright (c) 1999-2018 David Muse
2// See the COPYING file for more information.
3
4#ifndef RUDIMENTS_DYNAMICARRAY_H
5#define RUDIMENTS_DYNAMICARRAY_H
6
7#include <rudiments/private/dynamicarrayincludes.h>
8
51template <class valuetype>
52class dynamicarray : public arraycollection<valuetype> {
53 public:
56
61 dynamicarray(uint64_t initiallength, uint64_t incrementlength);
62
66
70
75
80
84
87 void zero(uint64_t count);
88
91 void zero(uint64_t start, uint64_t count);
92
95 void set(byte_t value, uint64_t count);
96
99 void set(byte_t value, uint64_t start, uint64_t count);
100
103 valuetype &operator[](uint64_t index);
104
105 /* Returns the number of elements in the initial extent. */
106 uint64_t getInitialCount();
107
108 /* Returns the number of elements in each incremental
109 * extent. */
110 uint64_t getIncrementCount();
111
113 uint64_t getCount();
114
118 bool clear();
119
122 bool clear(uint64_t initiallength, uint64_t incrementlength);
123
124 #include <rudiments/private/dynamicarray.h>
125};
126
127#include <rudiments/private/dynamicarrayinlines.h>
128
129#endif
Definition arraycollection.h:13
Definition dynamicarray.h:52
dynamicarray()
Definition dynamicarrayinlines.h:9
bool clear()
Definition dynamicarrayinlines.h:254
void zero(uint64_t count)
Definition dynamicarrayinlines.h:127
~dynamicarray()
Definition dynamicarrayinlines.h:121
uint64_t getCount()
Definition dynamicarrayinlines.h:196
dynamicarray< valuetype > & operator=(dynamicarray< valuetype > &v)
Definition dynamicarrayinlines.h:40
valuetype & operator[](uint64_t index)
Definition dynamicarrayinlines.h:155
void set(byte_t value, uint64_t count)
Definition dynamicarrayinlines.h:139