BloombergLP::bdlcc::SkipList::addAtLevelUniqueRawR

Add a unique key/data pair at level, searching from the back.

Synopsis

Declared in <bdlcc_skiplist.h>

int
addAtLevelUniqueRawR(
    Pair** result,
    int level,
    KEY const& key,
    DATA const& data,
    bool* newFrontFlag = 0);

Description

Search for the correct position for key from the back of the list (in descending order by key value). The result reference must be released (using releaseReferenceRaw) when it is no longer needed. Load into the optionally specified newFrontFlag a true value if the pair is at the front of the list, and a false value otherwise. The behavior is undefined if level is greater than the implementation-defined maximum level of this class, or if level is negative. Return 0 on success, and a non-zero value (with no effect on the list) if key is already in the list. Note that this method is provided for testing purposes.

Return Value

0 on success, and a non-zero value if key already exists

Parameters

NameDescription
resultreceives a reference to the inserted pair
levelskip-list level at which to insert
keykey of the pair
datadata associated with key
newFrontFlagif non-null, set to whether the pair is at the front