BloombergLP::bdlcc::SkipList

Thread-safe ordered associative skip list of key/data pairs.

Synopsis

Declared in <bdlcc_skiplist.h>

template<
    class KEY,
    class DATA>
class SkipList;

Description

This class provides a generic thread-safe Skip List (an ordered associative container). It supports an almost complete set of value semantic operations, including copy construction, assignment, equality comparison, and ostream printing (but not BDEX serialization).

Type Aliases

NameDescription
Pair Unmanaged reference to a key/data pair in this list.
PairHandle Managed handle to a key/data pair in this list.

Enums

NameDescription
Unnamed enum Status codes returned by skip-list operations.

Member Functions

NameDescription
SkipList [constructor]Constructors
~SkipList [destructor]Destroy this Skip List. The behavior is undefined if references are outstanding to any pairs in the list.
operator= Assign to this list the value of rhs.
add add overloads
addAtLevelRaw Add a key/data pair at a specified skip-list level.
addAtLevelRawR Add a key/data pair at level, searching from the back.
addAtLevelUniqueRaw Add a unique key/data pair at the specified level.
addAtLevelUniqueRawR Add a unique key/data pair at level, searching from the back.
addPairReferenceRaw Increment the reference count for the pair at reference.
addR addR overloads
addRaw Add a key/data pair and load a raw reference into result.
addRawR Add key/data from the back and load a raw reference.
addUnique addUnique overloads
addUniqueR addUniqueR overloads
addUniqueRaw Add a unique key/data pair and load a raw reference.
addUniqueRawR Add a unique key/data pair and return a raw reference to it.
allocator Return the allocator used by this object to supply memory.
back Load a reference to the last item into back.
backRaw Load a raw reference to the last item into back.
data Load into value the data of the pair at reference.
exists Return whether a pair with the specified key is in the list.
find Find the element with key, searching from the front.
findLowerBound Find the lower bound for key, searching from the front.
findLowerBoundR Find the lower bound for key, searching from the back.
findLowerBoundRRaw Find the reverse lower bound for key.
findLowerBoundRaw Find the lower bound for key and load a raw reference.
findR Find the element with key, searching from the back.
findRRaw Find key from the back and load a raw reference into item.
findRaw Find key from the front and load a raw reference into item.
findUpperBound Find the upper bound for key, searching from the front.
findUpperBoundR Find the upper bound for key, searching from the back.
findUpperBoundRRaw Find the reverse upper bound for key.
findUpperBoundRaw Find the upper bound for key and load a raw reference.
front Load a reference to the first item into front.
frontRaw Load a raw reference to the first item into front.
isEmpty Return true if this list is empty, and false otherwise.
key Load into value the key of the pair at reference.
length Return the number of items in this list.
next Load into next the list item after reference.
nextRaw Load a raw reference to the item after reference into next.
popFront Remove and return the first item in the list.
popFrontRaw Remove the first item and load a raw reference into item.
previous Load into prevPair the pair before reference.
previousRaw Load a raw reference to the pair before reference.
print Format this list to the specified output stream.
releaseReferenceRaw Release the reference to the pair at reference.
remove Remove the item identified by reference from this list.
removeAll removeAll overloads
removeAllRaw Remove all items and append raw references to removed.
skipBackward Move item to the previous item, or reset it at the front.
skipBackwardRaw Move the raw reference item to the previous item.
skipForward Advance item to the next item in the list.
skipForwardRaw Advance the raw reference item to the next item.
update Assign newKey to the pair at reference, moving it as needed.
updateR Update the key of a pair, searching for position from the back.
operator BloombergLP::bslmf::NestedTraitDeclaration<SkipList, UsesBslmaAllocator> Return the nested trait declaration for this skip-list type.

Static Member Functions

NameDescription
level Return the skip-list level of the pair at reference.

Friends

NameDescription
BloombergLP::bdlcc::operator!=Return true if the specified lists have different values.
BloombergLP::bdlcc::operator==Return true if the specified lists have the same value.
BloombergLP::bdlcc::SkipListPairHandleManaged handle to a key/data pair in a SkipList.
BloombergLP::bdlcc::SkipListPairType-safe pointer to a key/data pair in a SkipList.

Non-Member Functions

NameDescription
operator!=Return whether lhs and rhs have different values.
operator==Return whether lhs and rhs have the same value.