template class Core::FixedDeque

Overview

Double-ended queue container class with fixed size and externally managed memory. More…

#include <coredeque.h>

template <class T>
class FixedDeque
{
public:
    // methods

    void initialize(T* _memoryStart, int _memorySize);
    int getCapacity() const;
    int count() const;
    bool isEmpty() const;
    bool addFront(const T& newItem);
    bool addBack(const T& newItem);
    bool popFront(T& result);
    bool popBack(T& result);
    bool peekFront(T& result);
    bool peekBack(T& result);
};

Detailed Documentation

Double-ended queue container class with fixed size and externally managed memory.

Methods

void initialize(T* _memoryStart, int _memorySize)

Initialize with external memory.

int getCapacity() const

Get capacitiy, i.e.

max. number of elements.

int count() const

Count elements in container.

bool isEmpty() const

Check if container is empty.

bool addFront(const T& newItem)

Add element to front.

bool addBack(const T& newItem)

Add element to back.

bool popFront(T& result)

Remove element from front.

bool popBack(T& result)

Remove element from back.

bool peekFront(T& result)

Peek at front-most element.

bool peekBack(T& result)

Peek at back-most element.