template class Core::Deque

Overview

Double-ended queue container class. More…

#include <coredeque.h>

template <class T>
class Deque: protected Core::LinkedList
{
public:
    // methods

    void addFront(const T& data);
    void addBack(const T& data);
    T popFront();
    T popBack();
    const T& peekFront() const;
    const T& peekBack() const;
};

Inherited Members

public:
    // methods

    void append(const T& data);
    void prepend(const T& data);
    bool insertBefore(const T& before, const T& data);
    bool insertBefore(ListIterator<T>& iter, const T& data);
    bool insertAfter(ListIterator<T>& iter, const T& data);
    bool insertAt(int idx, const T& data);
    bool addSorted(const T& data);
    bool replace(ListIterator<T>& iter, const T& newData);
    void swapContent(LinkedList<T>& other);
    bool remove(const T& data);
    bool removeAt(int idx);
    bool remove(ListIterator<T>& iter);

    template <class Predicate>
    int removeIf(const Predicate& recognize);

    int removeIf(ContainerPredicateFunction recognize);
    void removeAll();
    T removeFirst();
    T removeLast();
    bool isEmpty() const;
    bool isMultiple() const;
    int count() const;
    void sort();

    template <class Predicate>
    void sort(Predicate greater);

    const T& at(int idx) const;
    bool contains(const T& data) const;
    const T& lookup(const T& data) const;
    const T& getFirst() const;
    const T& getLast() const;

    template <class Predicate>
    const T& findIf(const Predicate& recognize) const;

    const T& findIf(ContainerPredicateFunction recognize) const;
    RangeIterator<LinkedList<T>, ListIterator<T>, T&> begin() const;
    RangeIterator<LinkedList<T>, ListIterator<T>, T&> end() const;

Detailed Documentation

Double-ended queue container class.

Elements can be added to or removed from both, front and back.

Methods

void addFront(const T& data)

Add element to front.

void addBack(const T& data)

Add element to back.

T popFront()

Remove element from front.

T popBack()

Remove element from back.

const T& peekFront() const

Peek at front-most element.

const T& peekBack() const

Peek at back-most element.