Skip to content

AQueue#

A std::queue with AUI extensions.

Header:#include <AUI/Common/AQueue.h>
CMake:aui_link(my_target PUBLIC aui::core)

Public Methods#

contains#


bool AQueue::contains(const StoredType& value)
Returns
true if container contains an element, false otherwise.

Examples:

examples/ui/contacts/src/main.cpp

AUI Contacts — Usage of AUI_DECLARATIVE_FOR to make a contacts-like application.

    _<AView> searchQueryList() {
        auto searchFilter = ranges::views::filter([&](const _<Contact>& c) {
            for (const auto& field : { c->displayName, c->note }) {
                if (field->lowercase().contains(*mSearchQueryLowercased)) {
                    return true;
                }
            }
            return false;
        });

isSubsetOf#


template<typename OtherContainer >
bool AQueue::isSubsetOf(const OtherContainer& c)
Returns
true if c container is a subset of this container, false otherwise.

popOrGenerate#


StoredType AQueue::popOrGenerate(Factory factory)

Pops the element and returns it. If queue is empty, the result of factory() returned. The result of factory() is never added to the queue.

Returns
result of front() if not empty; result of factory() otherwise

removeAll#


void AQueue::removeAll(const StoredType& item)
Arguments
item
element to remove.

Removes all occurrences of item.

removeFirst#


void AQueue::removeFirst(const StoredType& item)
Arguments
item
element to remove.

Removes first occurrence of item.

Examples:

examples/7guis/crud/src/main.cpp

7GUIs CRUD — Create/Read/Update/Delete example.

        (*mSelectedUser)->surname = std::exchange(mEditedUser.surname, {});
    }

    void deleteClicked() {
        mUsers.writeScope()->removeFirst(*mSelectedUser);
        mSelectedUser = nullptr;
    }
};

AUI_ENTRY {