16 #include <type_traits> 23 #define AUTO_PACK 0x01 24 #define PACK_NEEDED 0x02 25 #define AUTO_TRIM 0x04 26 #define OWNS_MEMBERS 0x08 27 #define END_OF_LIST -1 28 #define INVALID_INDEX -1 33 #define MAKE_LISTTYPE_DEF(C, T) \ 34 typedef DynaList<C> T##List 42 T** _members =
nullptr;
48 void _insertArray(T** array,
int arrayOffset,
int toIndex,
int count);
49 void _swap(
int index1,
int index2);
52 void _deleteExcessCapacity();
53 void _deleteRange(
int frIndex,
int toIndex);
54 void _clearRange(
int frIndex,
int toIndex);
55 void _nullRange(
int frIndex,
int toIndex);
56 void _deleteOrClear(
int frIndex,
int toIndex);
57 bool _setAutoPack(
bool isPack);
58 bool _setAutoTrim(
bool isTrim);
61 inline void setFlags(uint8_t flags) { _flags |= flags; }
63 inline void clearFlags(uint8_t flags) { _flags &= ~flags; }
65 inline bool isFlags(uint8_t flags) {
return (_flags & flags) == flags; }
72 explicit DynaList(uint initCapacity);
73 explicit DynaList(T* array,
int count);
82 inline uint
count() {
return _count; }
83 inline bool isFull() {
return _count == _capacity; }
84 inline bool isEmpty() {
return _count == 0; }
85 inline T*
get(uint index)
const {
return _members[index]; }
88 inline T*
first() {
return _count > 0 ? _members[0] :
nullptr; }
89 inline T*
last() {
return _count > 0 ? _members[_count-1] :
nullptr; }
94 inline T* operator [](uint index)
const {
return _members[index]; }
95 inline T*& operator [](uint index) {
return _members[index]; }
111 void adjustSize(
int delta);
112 void adjustSizeLog(
int delta);
117 int indexOf(T* value, uint start, uint step);
118 int indexOf(T** value, uint arraySize, uint start, uint step);
120 int insert(
int index, T* value);
121 int insert(
int index, T&& value);
122 int insert(
int index, T** array, uint length);
124 int append(T* value);
125 int append(T&& value);
126 int append(T** array, uint length);
128 T*
set(
int index, T*
value);
129 void move(
int index,
int destIndex);
130 void slide(
int frIndex,
int toIndex);
131 T*
remove(
int index);
133 void deleteItem(
int index);
134 void deleteItems(
int frIndex,
int toIndex);
136 void pushLast(T* value);
150 : _curIndex(start), _list(list)
154 bool hasNext() {
return _curIndex < _list->_count; }
158 return _curIndex == other._curIndex;
162 return _curIndex != other._curIndex;
165 T* operator* ()
const {
166 return _list->
get( _curIndex );
CONSTCD11 bool operator==(const day &x, const day &y) NOEXCEPT
Definition: date.h:1274
#define OWNS_MEMBERS
Definition: DynaList.h:26
bool hasNext()
Definition: DynaList.h:154
GeneratorWrapper< T > value(T &&value)
Definition: catch.hpp:4005
void clearAllFlags()
Definition: DynaList.h:64
void setAllFlags(uint8_t flags)
Definition: DynaList.h:62
DynaListIter(const DynaList< T > *list, int start)
Definition: DynaList.h:149
uint capacity()
Definition: DynaList.h:81
uint getCount()
Definition: DynaList.h:80
T * get(uint index) const
Definition: DynaList.h:85
void clearFlags(uint8_t flags)
Definition: DynaList.h:63
bool isEmpty()
Definition: DynaList.h:84
#define INVALID_INDEX
Definition: DynaList.h:28
T ** getInternalTypedArray()
Definition: DynaList.h:86
std::string trim(std::string const &str)
Returns a new string without whitespace at the start/end.
Definition: DynaList.h:38
#define AUTO_PACK
Definition: DynaList.h:23
CONSTCD11 bool operator!=(const day &x, const day &y) NOEXCEPT
Definition: date.h:1282
T * last()
Definition: DynaList.h:89
auto operator+=(std::string &lhs, StringRef const &sr) -> std::string &
uint getCapacity()
Definition: DynaList.h:79
bool hasPrev()
Definition: DynaList.h:155
#define MAKE_LISTTYPE_DEF(C, T)
Definition: DynaList.h:33
void setFlags(uint8_t flags)
Definition: DynaList.h:61
bool isFlags(uint8_t flags)
Definition: DynaList.h:65
uint count()
Definition: DynaList.h:82
int getIndex()
Definition: DynaList.h:153
std::ostream & operator<<(std::ostream &, Catch_global_namespace_dummy)
T * first()
Definition: DynaList.h:88
Definition: ICopyable.h:8
#define AUTO_TRIM
Definition: DynaList.h:25
void ** getInternalRawArray()
Definition: DynaList.h:87
Definition: DynaList.h:36
bool isFull()
Definition: DynaList.h:83