55template <
class ObjectType>
87 jassert (
this != &other);
96 inline operator ObjectType*()
const noexcept
102 inline ObjectType*
get() const noexcept
118 while (l->item !=
nullptr)
119 l = &(l->item->nextListItem);
132 for (
auto* i = item; i !=
nullptr; i = i->nextListItem)
146 while (--index >= 0 && l->item !=
nullptr)
147 l = &(l->item->nextListItem);
160 while (--index >= 0 && l->item !=
nullptr)
161 l = &(l->item->nextListItem);
167 bool contains (
const ObjectType*
const itemToLookFor)
const noexcept
169 for (
auto* i = item; i !=
nullptr; i = i->nextListItem)
170 if (itemToLookFor == i)
182 JUCE_BEGIN_IGNORE_WARNINGS_MSVC (6011)
183 jassert (newItem !=
nullptr);
184 jassert (newItem->nextListItem ==
nullptr);
185 newItem->nextListItem = item;
187 JUCE_END_IGNORE_WARNINGS_MSVC
196 jassert (newItem !=
nullptr);
199 while (index != 0 && l->item !=
nullptr)
201 l = &(l->item->nextListItem);
205 l->insertNext (newItem);
213 JUCE_BEGIN_IGNORE_WARNINGS_MSVC (6011 28182)
214 jassert (newItem !=
nullptr);
215 jassert (newItem->nextListItem ==
nullptr);
219 item->nextListItem = oldItem->nextListItem.item;
220 oldItem->nextListItem.item =
nullptr;
222 JUCE_END_IGNORE_WARNINGS_MSVC
242 auto* insertPoint =
this;
244 for (
auto* i = other.item; i !=
nullptr; i = i->nextListItem)
246 insertPoint->insertNext (
new ObjectType (*i));
247 insertPoint = &(insertPoint->item->nextListItem);
259 if (oldItem !=
nullptr)
261 item = oldItem->nextListItem;
262 oldItem->nextListItem.item =
nullptr;
271 void remove (ObjectType*
const itemToRemove)
282 while (item !=
nullptr)
285 item = oldItem->nextListItem;
298 while (l->item !=
nullptr)
300 if (l->item == itemToLookFor)
303 l = &(l->item->nextListItem);
315 JUCE_BEGIN_IGNORE_WARNINGS_MSVC (6011)
316 jassert (destArray !=
nullptr);
318 for (
auto* i = item; i !=
nullptr; i = i->nextListItem)
321 JUCE_END_IGNORE_WARNINGS_MSVC
327 std::swap (item, other.item);
344 : endOfList (&endOfListPointer)
347 jassert (endOfListPointer.item ==
nullptr);
351 void append (ObjectType*
const newItem)
noexcept
353 *endOfList = newItem;
354 endOfList = &(newItem->nextListItem);
360 JUCE_DECLARE_NON_COPYABLE (
Appender)
Appender(LinkedListPointer &endOfListPointer) noexcept
void append(ObjectType *const newItem) noexcept
LinkedListPointer & getLast() noexcept
LinkedListPointer * findPointerTo(ObjectType *const itemToLookFor) noexcept
LinkedListPointer & operator[](int index) noexcept
ObjectType * replaceNext(ObjectType *const newItem) noexcept
void append(ObjectType *const newItem)
LinkedListPointer & operator=(ObjectType *const newItem) noexcept
bool contains(const ObjectType *const itemToLookFor) const noexcept
ObjectType * removeNext() noexcept
LinkedListPointer(ObjectType *const headItem) noexcept
void insertNext(ObjectType *const newItem)
ObjectType * get() const noexcept
void addCopyOfList(const LinkedListPointer &other)
int size() const noexcept
void insertAtIndex(int index, ObjectType *newItem)
void copyToArray(ObjectType **destArray) const noexcept
LinkedListPointer() noexcept
void swapWith(LinkedListPointer &other) noexcept
void remove(ObjectType *const itemToRemove)