26#ifndef WATER_LINKEDLISTPOINTER_H_INCLUDED
27#define WATER_LINKEDLISTPOINTER_H_INCLUDED
60template <
class ObjectType>
86 inline operator ObjectType*()
const noexcept
108 while (
l->item !=
nullptr)
109 l = &(
l->item->nextListItem);
122 for (ObjectType*
i =
item;
i !=
nullptr;
i =
i->nextListItem)
136 while (--index >= 0 &&
l->item !=
nullptr)
137 l = &(
l->item->nextListItem);
150 while (--index >= 0 &&
l->item !=
nullptr)
151 l = &(
l->item->nextListItem);
157 bool contains (
const ObjectType*
const itemToLookFor)
const noexcept
159 for (ObjectType*
i =
item;
i !=
nullptr;
i =
i->nextListItem)
160 if (itemToLookFor ==
i)
173 wassert (newItem->nextListItem ==
nullptr);
174 newItem->nextListItem =
item;
187 while (index != 0 &&
l->item !=
nullptr)
189 l = &(
l->item->nextListItem);
193 l->insertNext (newItem);
202 wassert (newItem->nextListItem ==
nullptr);
204 ObjectType*
const oldItem =
item;
206 item->nextListItem = oldItem->nextListItem.item;
207 oldItem->nextListItem.item =
nullptr;
230 for (ObjectType*
i = other.
item;
i !=
nullptr;
i =
i->nextListItem)
233 insertPoint = &(insertPoint->
item->nextListItem);
243 ObjectType*
const oldItem =
item;
245 if (oldItem !=
nullptr)
247 item = oldItem->nextListItem;
248 oldItem->nextListItem.item =
nullptr;
257 void remove (ObjectType*
const itemToRemove)
268 while (
item !=
nullptr)
270 ObjectType*
const oldItem =
item;
271 item = oldItem->nextListItem;
284 while (
l->item !=
nullptr)
286 if (
l->item == itemToLookFor)
289 l = &(
l->item->nextListItem);
301 wassert (destArray !=
nullptr);
303 for (ObjectType*
i =
item;
i !=
nullptr;
i =
i->nextListItem)
310 std::swap (
item, other.item);
330 wassert (endOfListPointer.item ==
nullptr);
334 void append (ObjectType*
const newItem)
noexcept
#define CARLA_DECLARE_NON_COPYABLE(ClassName)
Definition CarlaDefines.h:242
#define noexcept
Definition DistrhoDefines.h:72
void append(ObjectType *const newItem) noexcept
Definition LinkedListPointer.h:334
Appender(LinkedListPointer &endOfListPointer) noexcept
Definition LinkedListPointer.h:326
LinkedListPointer * endOfList
Definition LinkedListPointer.h:341
void deleteAll()
Definition LinkedListPointer.h:266
void insertAtIndex(int index, ObjectType *newItem)
Definition LinkedListPointer.h:182
void copyToArray(ObjectType **destArray) const noexcept
Definition LinkedListPointer.h:299
void append(ObjectType *const newItem)
Definition LinkedListPointer.h:217
void swapWith(LinkedListPointer &other) noexcept
Definition LinkedListPointer.h:308
bool contains(const ObjectType *const itemToLookFor) const noexcept
Definition LinkedListPointer.h:157
LinkedListPointer & operator=(ObjectType *const newItem) noexcept
Definition LinkedListPointer.h:78
void addCopyOfList(const LinkedListPointer &other)
Definition LinkedListPointer.h:226
ObjectType * removeNext() noexcept
Definition LinkedListPointer.h:241
ObjectType * get() const noexcept
Definition LinkedListPointer.h:92
LinkedListPointer & getLast() noexcept
Definition LinkedListPointer.h:104
ObjectType * replaceNext(ObjectType *const newItem) noexcept
Definition LinkedListPointer.h:199
void remove(ObjectType *const itemToRemove)
Definition LinkedListPointer.h:257
LinkedListPointer & operator[](int index) noexcept
Definition LinkedListPointer.h:132
ObjectType * item
Definition LinkedListPointer.h:348
LinkedListPointer(ObjectType *const headItem) noexcept
Definition LinkedListPointer.h:72
LinkedListPointer() noexcept
Definition LinkedListPointer.h:66
void insertNext(ObjectType *const newItem)
Definition LinkedListPointer.h:170
LinkedListPointer * findPointerTo(ObjectType *const itemToLookFor) noexcept
Definition LinkedListPointer.h:280
int size() const noexcept
Definition LinkedListPointer.h:118
int * l
Definition inflate.c:1579
register unsigned i
Definition inflate.c:1575
#define wassert(expression)
Definition AudioSampleBuffer.h:33
#define const
Definition zconf.h:137