Attempt to remove the most urgent item from this queue immediately.

Synopsis

Declared in <bdlcc_multipriorityqueue.h>

int
tryPopFront(
    TYPE* item,
    int* itemPriority = 0);

Description

Attempt to remove (immediately) the least‐recently added item having the most urgent priority (lowest value) from this multi‐priority queue. On success, load the value of the popped item into the specified item; if the optionally specified itemPriority is non‐null, load the priority of the popped item into itemPriority; and return 0. Otherwise, leave item and itemPriority unmodified, and return a non‐zero value indicating that this queue was empty. The behavior is undefined unless item is non‐null. Note this is unaffected by the enabled / disabled state of the queue.

Return Value

0 on success, and a non‐zero value if the queue is empty

Parameters

Name

Description

item

receives the removed item

itemPriority

if non‐null, receives the removed item's priority

Created with MrDocs