BloombergLP::bdlcc::TimeQueue::add

Add an item with the specified time and associated data.

Synopsis

Declared in <bdlcc_timequeue.h>

TimeQueue<DATA>::Handle
add(
    bsls::TimeInterval const& time,
    DATA const& data,
    int* isNewTop = 0,
    int* newLength = 0);

Description

Add a new item to this queue having the specified time value, and associated data. Optionally use the specified key to uniquely identify the item in subsequent calls to remove and update. Optionally load into the optionally specified isNewTop a non-zero value if the item is now the lowest item in this queue, and a 0 value otherwise. If specified, load into the optionally specified newLength, the new number of items in this queue. Return a value that may be used to identify the newly added item in future calls to time queue on success, and -1 if the maximum queue length has been reached.

Return Value

handle for the item, or -1 if the queue is full

Parameters

NameDescription
timescheduled time for the item
datadata associated with the item
isNewTopoptional flag set if the item is the new lowest
newLengthoptional location for the new queue length