//---------------------------------------------------------------------------------------------------------------------- // Constructors //---------------------------------------------------------------------------------------------------------------------- template ThinListContainer::ThinListContainer() :first(0) { } //---------------------------------------------------------------------------------------------------------------------- template ThinListContainer::~ThinListContainer() { delete first; } //---------------------------------------------------------------------------------------------------------------------- // Iteration functions //---------------------------------------------------------------------------------------------------------------------- template typename ThinListContainer::Element* ThinListContainer::GetFirstEntry() const { return first; } //---------------------------------------------------------------------------------------------------------------------- // Insert functions //---------------------------------------------------------------------------------------------------------------------- template void ThinListContainer::PushToFront(const T& entry) { Element* newEntry = new Element(entry, first); first = newEntry; } //---------------------------------------------------------------------------------------------------------------------- template void ThinListContainer::InsertAfter(Element* element, const T& entry) { element->InsertAfter(entry); } //---------------------------------------------------------------------------------------------------------------------- // Erase functions //---------------------------------------------------------------------------------------------------------------------- template void ThinListContainer::EraseFromBackToElement(Element* targetElement) { Element* deleteStart = targetElement->next; targetElement->next = 0; delete deleteStart; } //---------------------------------------------------------------------------------------------------------------------- template void ThinListContainer::Clear() { delete first; first = 0; } //---------------------------------------------------------------------------------------------------------------------- // Query functions //---------------------------------------------------------------------------------------------------------------------- template bool ThinListContainer::Empty() const { return (first == 0); }