[#BloombergLP-bdlcc-SkipList-0d]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlcc.adoc[bdlcc]::xref:BloombergLP/bdlcc/SkipList-0a.adoc[SkipList]&lt;long long, xref:BloombergLP/bdlmt/EventScheduler.adoc[RecurringEventData]&gt;
:relfileprefix: ../../
:mrdocs:

This class provides a generic thread&hyphen;safe Skip List (an ordered associative container)&period; It supports an almost complete set of _value_ _semantic_ operations, including copy construction, assignment, equality comparison, and `ostream` printing (but not BDEX serialization)&period;

== Synopsis

Declared in `&lt;bdlcc&lowbar;skiplist&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;&gt;
class xref:BloombergLP/bdlcc/SkipList-0a.adoc[SkipList]&lt;long long, xref:BloombergLP/bdlmt/EventScheduler.adoc[RecurringEventData]&gt;;
----

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/SkipList-0d/Pair.adoc[`Pair`] 
| Unmanaged reference to a key&sol;data pair in this list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/PairHandle.adoc[`PairHandle`] 
| Managed handle to a key&sol;data pair in this list&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/SkipList-0d/_04enum-0e.adoc[`Unnamed enum`] 
| Status codes returned by skip&hyphen;list operations&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/SkipList-0d/2constructor-0a.adoc[`SkipList`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bdlcc/SkipList-0d/2destructor.adoc[`&#126;SkipList`] [.small]#[destructor]#
| Destroy this Skip List&period; The behavior is undefined if references are outstanding to any pairs in the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/operator_assign.adoc[`operator&equals;`] 
| Assign to this Skip List the value of the specified `rhs` list and return a reference to the modifiable list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/add-05.adoc[`add`] 
| `add` overloads
| xref:BloombergLP/bdlcc/SkipList-0d/addAtLevelRaw.adoc[`addAtLevelRaw`] 
| Add the specified `key` &sol; `data` pair to this list at the specified `level`, and load into the specified `result` a reference to the pair in the list&period; The `result` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Load into the the optionally specified `newFrontFlag` a `true` value if the pair is at the front of the list, and a `false` value otherwise&period; The behavior is undefined if `level` is greater than the implementation&hyphen;defined maximum level of this class, or if `level` is negative&period; Note that this method is provided for testing purposes&period;
| xref:BloombergLP/bdlcc/SkipList-0d/addAtLevelRawR.adoc[`addAtLevelRawR`] 
| Add the specified `key` &sol; `data` pair to this list at the specified `level`, and load into the specified `result` a reference to the pair in the list&period; Search for the correct position for `key` from the back of the list (in descending order by key value)&period; The `result` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Load into the optionally specified `newFrontFlag` a `true` value if the pair is at the front of the list, and a `false` value otherwise&period; The behavior is undefined if `level` is greater than the implementation&hyphen;defined maximum level of this class, or if `level` is negative&period; Note that this method is provided for testing purposes&period;
| xref:BloombergLP/bdlcc/SkipList-0d/addAtLevelUniqueRaw.adoc[`addAtLevelUniqueRaw`] 
| Add the specified `key` &sol; `data` pair to this list at the specified `level`, and load into the specified `result` a reference to the pair in the list&period; The `result` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Load into the the optionally specified `newFrontFlag` a `true` value if the pair is at the front of the list, and a `false` value otherwise&period; The behavior is undefined if `level` is greater than the implementation&hyphen;defined maximum level of this class, or if `level` is negative&period; Return 0 on success, and a non&hyphen;zero value (with no effect on the list) if `key` is already in the list&period; Note that this method is provided for testing purposes&period;
| xref:BloombergLP/bdlcc/SkipList-0d/addAtLevelUniqueRawR.adoc[`addAtLevelUniqueRawR`] 
| Add the specified `key` &sol; `data` pair to this list at the specified `level`, and load into the specified `result` a reference to the pair in the list&period; Search for the correct position for `key` from the back of the list (in descending order by key value)&period; The `result` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Load into the optionally specified `newFrontFlag` a `true` value if the pair is at the front of the list, and a `false` value otherwise&period; The behavior is undefined if `level` is greater than the implementation&hyphen;defined maximum level of this class, or if `level` is negative&period; Return 0 on success, and a non&hyphen;zero value (with no effect on the list) if `key` is already in the list&period; Note that this method is provided for testing purposes&period;
| xref:BloombergLP/bdlcc/SkipList-0d/addPairReferenceRaw-07.adoc[`addPairReferenceRaw`] 
| Increment the reference count for the list element referred to by the specified `reference`&period; There must be a corresponding call to `releaseReferenceRaw` when the reference is no longer needed&period; The behavior is undefined `item` has already been released&period; Return `reference`&period;
| xref:BloombergLP/bdlcc/SkipList-0d/addR-07.adoc[`addR`] 
| `addR` overloads
| xref:BloombergLP/bdlcc/SkipList-0d/addRaw.adoc[`addRaw`] 
| Add the specified `key` &sol; `data` pair to this list, and load into the specified `result` a reference to the pair in the list&period; The `result` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Load into the optionally specified `newFrontFlag` a `true` value if the pair is at the front of the list, and a `false` value otherwise&period;
| xref:BloombergLP/bdlcc/SkipList-0d/addRawR.adoc[`addRawR`] 
| Add the specified `key` &sol; `data` pair to this list, and load into the specified `result` a reference to the pair in the list&period; Search for the correct position for `key` from the back of the list (in descending order by key value)&period; The `result` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Load into the optionally specified `newFrontFlag` a `true` value if the pair is at the front of the list, and a `false` value otherwise&period;
| xref:BloombergLP/bdlcc/SkipList-0d/addUnique-07.adoc[`addUnique`] 
| `addUnique` overloads
| xref:BloombergLP/bdlcc/SkipList-0d/addUniqueR-04.adoc[`addUniqueR`] 
| `addUniqueR` overloads
| xref:BloombergLP/bdlcc/SkipList-0d/addUniqueRaw.adoc[`addUniqueRaw`] 
| Add the specified `key` &sol; `data` pair to this list, and load into the specified `result` a reference to the pair in the list&period; The `result` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Load into the optionally specified `newFrontFlag` a `true` value if the pair is at the front of the list, and a `false` value otherwise&period; Return 0 on success, and a non&hyphen;zero value (with no effect on the list) if `key` is already in the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/addUniqueRawR.adoc[`addUniqueRawR`] 
| Add the specified `key` &sol; `data` pair to this list, and load into the specified `result` a reference to the pair in the list&period; Search for the correct position for `key` from the back of the list (in descending order by key value)&period; The `result` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Load into the optionally specified `newFrontFlag` a `true` value if the pair is at the front of the list, and a `false` value otherwise&period; Return 0 on success, and a non&hyphen;zero value (with no effect on the list) if `key` is already in the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/allocator.adoc[`allocator`] 
| Return the allocator used by this object to supply memory&period;
| xref:BloombergLP/bdlcc/SkipList-0d/back.adoc[`back`] 
| Load into the specified `back` a reference to the last item in the list&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `back`) if the list is empty&period;
| xref:BloombergLP/bdlcc/SkipList-0d/backRaw.adoc[`backRaw`] 
| Load into the specified `back` a reference to the last item in the list&period; The `back` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Return 0 on success, and a non&hyphen;zero value if the list is empty&period; Note that if the list is empty, the value of `&ast;back` is undefined&period;
| xref:BloombergLP/bdlcc/SkipList-0d/data-03.adoc[`data`] 
| Load into the specified `value` the &quot;data&quot; value of the pair identified by the `reference`&period;
| xref:BloombergLP/bdlcc/SkipList-0d/exists.adoc[`exists`] 
| Return `true` if there is a pair in the list with the specified `key`, and `false` otherwise&period;
| xref:BloombergLP/bdlcc/SkipList-0d/find.adoc[`find`] 
| Load into the specified `item` a reference to the element in this list with the specified `key` found by searching the list from the front (in ascending order of key value)&period; If multiple elements having `key` are in the container, load `item` with the _first_ matching element&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `item`) if no such element exists&period; If there are multiple elements in the list with the `key`, it is undefined which one is returned&period;
| xref:BloombergLP/bdlcc/SkipList-0d/findLowerBound.adoc[`findLowerBound`] 
| Load into the specified `item` a reference to the first element in this list whose key value is not less than the specified `key` found by searching the list from the front (in ascending order of key value)&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `item`) if no such element exists&period;
| xref:BloombergLP/bdlcc/SkipList-0d/findLowerBoundR.adoc[`findLowerBoundR`] 
| Load into the specified `item` a reference to the first element in this list whose key value is not less than the specified `key` found by searching the list from the back (in descending order of key value)&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `item`) if no such element exists&period;
| xref:BloombergLP/bdlcc/SkipList-0d/findLowerBoundRRaw.adoc[`findLowerBoundRRaw`] 
| Load into the specified `item` a reference to the first element in this list whose key value is not less than the specified `key` found by searching the list from the back (in descending order of key value)&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `item`) if no such element exists&period; The `item` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period;
| xref:BloombergLP/bdlcc/SkipList-0d/findLowerBoundRaw.adoc[`findLowerBoundRaw`] 
| Load into the specified `item` a reference to the first element in this list whose key value is not less than the specified `key` found by searching the list from the front (in ascending order of key value)&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `item`) if no such element exists&period; The `item` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period;
| xref:BloombergLP/bdlcc/SkipList-0d/findR.adoc[`findR`] 
| Load into the specified `item` a reference to the element in this list with the specified `key` found by searching the list from the back (in descending order of key value)&period; If multiple elements having `key` are in the container, load `item` with the _last_ matching element&period; `key` are present, find the last one&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `item`) if no such element exists&period; If there are multiple elements in the list with the `key`, it is undefined which one is returned&period;
| xref:BloombergLP/bdlcc/SkipList-0d/findRRaw.adoc[`findRRaw`] 
| Load into the specified `item` a reference to the element in this list with the specified `key` found by searching the list from the back (in descending order of key value)&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `item`) if no such element exists&period; If there are multiple elements in the list with the `key`, it is undefined which one is returned&period; The `item` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period;
| xref:BloombergLP/bdlcc/SkipList-0d/findRaw.adoc[`findRaw`] 
| Load into the specified `item` a reference to the element in this list with the specified `key` found by searching the list from the front (in ascending order of key value)&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `item`) if no such element exists&period; If there are multiple elements in the list with the `key`, it is undefined which one is returned&period; The `item` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period;
| xref:BloombergLP/bdlcc/SkipList-0d/findUpperBound.adoc[`findUpperBound`] 
| Load into the specified `item` a reference to the first element in this list whose key value is greater than the specified `key` found by searching the list from the front (in ascending order of key value)&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `item`) if no such element exists&period;
| xref:BloombergLP/bdlcc/SkipList-0d/findUpperBoundR.adoc[`findUpperBoundR`] 
| Load into the specified `item` a reference to the first element in this list whose key value is greater than the specified `key` found by searching the list from the back (in descending order of key value)&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `item`) if no such element exists&period;
| xref:BloombergLP/bdlcc/SkipList-0d/findUpperBoundRRaw.adoc[`findUpperBoundRRaw`] 
| Load into the specified `item` a reference to the first element in this list whose key value is greater than the specified `key` found by searching the list from the back (in descending order of key value)&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `item`) if no such element exists&period; The `item` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period;
| xref:BloombergLP/bdlcc/SkipList-0d/findUpperBoundRaw.adoc[`findUpperBoundRaw`] 
| Load into the specified `item` a reference to the first element in this list whose key value is greater than the specified `key` found by searching the list from the front (in ascending order of key value)&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `item`) if no such element exists&period; The `item` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period;
| xref:BloombergLP/bdlcc/SkipList-0d/front.adoc[`front`] 
| Load into the specified `front` a reference to the first item in the list&period; Return 0 on success, and a non&hyphen;zero value (with no effect on `front`) if the list is empty&period;
| xref:BloombergLP/bdlcc/SkipList-0d/frontRaw.adoc[`frontRaw`] 
| Load into the specified `front` a reference to the first item in the list&period; The `front` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Return 0 on success, and a non&hyphen;zero value if the list is empty&period;
| xref:BloombergLP/bdlcc/SkipList-0d/isEmpty.adoc[`isEmpty`] 
| Return `true` if this list is empty, and `false` otherwise&period;
| xref:BloombergLP/bdlcc/SkipList-0d/key-0b.adoc[`key`] 
| Load into the specified `value` the &quot;key&quot; value of the pair identified by the `reference`&period;
| xref:BloombergLP/bdlcc/SkipList-0d/length.adoc[`length`] 
| Return the number of items in this list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/next.adoc[`next`] 
| Load into the specified `next` a reference to the item that appears in the list after the item identified by the specified `reference`&period; Return 0 on success, or a non&hyphen;zero value if `reference` refers to the back of the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/nextRaw.adoc[`nextRaw`] 
| Load into the specified `next` a reference to the item that appears in the list after the item identified by the specified `reference`&period; The `next` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Return 0 on success, or a non&hyphen;zero value if `reference` refers to the back of the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/popFront.adoc[`popFront`] 
| Remove the first item from the list and load a reference to it into the optionally specified `item`&period; Return 0 on success, and a non&hyphen;zero value if the list is empty&period;
| xref:BloombergLP/bdlcc/SkipList-0d/popFrontRaw.adoc[`popFrontRaw`] 
| Remove the first item from the list and load a reference to it into the specified `item`&period; This reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Return 0 on success, and a non&hyphen;zero value if the list is empty&period;
| xref:BloombergLP/bdlcc/SkipList-0d/previous.adoc[`previous`] 
| Load into the specified `prevPair` a reference to the pair that appears in the list before the pair identified by the specified `reference`&period; Return 0 on success, or a non&hyphen;zero value if `reference` refers to the front of the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/previousRaw.adoc[`previousRaw`] 
| Load into the specified `prevPair` a reference to the pair that appears in the list before the pair identified by the specified `reference`&period; The `prevPair` reference must be released (using `releaseReferenceRaw`) when it is no longer needed&period; Return 0 on success, or a non&hyphen;zero value if `reference` refers to the front of the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/print.adoc[`print`] 
| Format this list object to the specified output `stream` at the (absolute value of) the optionally specified indentation `level` and return a reference to `stream`&period; If `level` is specified, optionally specify `spacesPerLevel`, the number of spaces per indentation level for this and all of its nested objects&period; If `level` is negative, suppress indentation of the first line&period; If `spacesPerLevel` is negative, suppress all indentation AND format the entire output on one line&period; If `stream` is not valid on entry, this operation has no effect&period;
| xref:BloombergLP/bdlcc/SkipList-0d/releaseReferenceRaw-0b.adoc[`releaseReferenceRaw`] 
| Release the specified `reference`&period; After calling this method, the value of `reference` must not be used or released again&period;
| xref:BloombergLP/bdlcc/SkipList-0d/remove.adoc[`remove`] 
| Remove the item identified by the specified `reference` from the list&period; Return 0 on success, and a non&hyphen;zero value if the pair has already been removed from the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/removeAll-0a.adoc[`removeAll`] 
| `removeAll` overloads
| xref:BloombergLP/bdlcc/SkipList-0d/removeAllRaw-04.adoc[`removeAllRaw`] 
| `removeAllRaw` overloads
| xref:BloombergLP/bdlcc/SkipList-0d/skipBackward-08.adoc[`skipBackward`] 
| If the item identified by the specified `item` is not at the front of the list, load a reference to the previous item in the list into `item`&semi; otherwise reset the value of `item`&period; Return 0 on success, and `e&lowbar;NOT&lowbar;FOUND` (with no effect on the value of `item`) if `item` is no longer in the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/skipBackwardRaw.adoc[`skipBackwardRaw`] 
| If the item identified by the specified `item` is not at the front of the list, load a reference to the previous item in the list into `item`&semi; otherwise reset the value of `item`&period; Return 0 on success, and `e&lowbar;NOT&lowbar;FOUND` (with no effect on the value of `item`) if `item` is no longer in the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/skipForward-0b.adoc[`skipForward`] 
| If the item identified by the specified `item` is not at the end of the list, load a reference to the next item in the list into `item`&semi; otherwise reset the value of `item`&period; Return 0 on success, and `e&lowbar;NOT&lowbar;FOUND` (with no effect on the value of `item`) if `item` is no longer in the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/skipForwardRaw.adoc[`skipForwardRaw`] 
| If the item identified by the specified `item` is not at the end of the list, load a reference to the next item in the list into `item`&semi; otherwise reset the value of `item`&period; Return 0 on success, and `e&lowbar;NOT&lowbar;FOUND` (with no effect on the value of `item`) if `item` is no longer in the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/update.adoc[`update`] 
| Assign the specified `newKey` value to the pair identified by the specified `reference`, moving the pair within the list as necessary&period; Load into the optionally specified `newFrontFlag` a `true` value if the new location of the pair is the front of the list&period; Return 0 on success, `e&lowbar;NOT&lowbar;FOUND` if the pair referred to by `reference` is no longer in the list, or `e&lowbar;DUPLICATE` if the optionally specified `allowDuplicates` is `false` and `newKey` already appears in the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/updateR.adoc[`updateR`] 
| Assign the specified `newKey` value to the pair identified by the specified `reference`, moving the pair within the list as necessary&period; Search for the new position from the back of the list (in descending order by key value)&period; Load into the optionally specified `newFrontFlag` a `true` value if the new location of the pair is the front of the list&period; Return 0 on success, `e&lowbar;NOT&lowbar;FOUND` if the pair referred to by `reference` is no longer in the list, or `e&lowbar;DUPLICATE` if the optionally specified `allowDuplicates` is `false` and `newKey` already appears in the list&period;
| xref:BloombergLP/bdlcc/SkipList-0d/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;SkipList&lt;long long, RecurringEventData&gt;, UsesBslmaAllocator&gt;`] 
| 
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlcc/SkipList-0d/level.adoc[`level`] 
| Return the level of the pair identified by the specified `reference`&period; This method is provided for testing&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/bdlcc/operator_not_eq-0e.adoc[BloombergLP::bdlcc::operator!&equals;]`
| Return `true` if the specified `lhs` list list has a different value from the specified `rhs` list, and `false` otherwise&period; Two lists A and B have different values if they have a different of elements, or if there exists an i in the range &lsqb;0, numberOfElements) such that the i&apos;th pair from the&rsqb; front of A differs in key or data values from i&apos;th pair from the front of B&period;
| `xref:BloombergLP/bdlcc/operator_eq-05.adoc[BloombergLP::bdlcc::operator&equals;&equals;]`
| Return `true` if the specified `lhs` list has the same value as the specified `rhs` list, and `false` otherwise&period; Two lists A and B have the same value if they have the same number of elements, and if for all i in the range &lsqb;0, numberOfElements), the i&apos;th pair from the front of A has the&rsqb; same key and data values as the i&apos;th pair from the front of B&period; Note that if there are duplicate key values in a list, the order of iteration over those pairs may be different than for another list that was constructed from the same sequence of values (and thus the lists may not compare equal)&period;
| `xref:BloombergLP/bdlcc/SkipListPairHandle.adoc[BloombergLP::bdlcc::SkipListPairHandle]`
| Objects of this class refer to an association (pair) in a `SkipList`&period; A `bdlcc&colon;&colon;SkipListPairHandle` is implicitly convertible to a `const Pair&ast;` and thus may be used anywhere in the `SkipList` API that a `const Pair&ast;` is expected&period;
| `xref:BloombergLP/bdlcc/SkipListPair.adoc[BloombergLP::bdlcc::SkipListPair]`
| Pointers to objects of this class are used in the &quot;raw&quot; API of `SkipList`&semi; however, objects of the class are never constructed as the class serves only to provide type&hyphen;safe pointers&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
