Quick Links:

bal | bbl | bdl | bsl

Classes | Public Types | Public Member Functions | Static Public Member Functions | Friends

bdlcc::SkipList< KEY, DATA > Class Template Reference

#include <bdlcc_skiplist.h>

List of all members.

Classes

class  IsVector
class  PairFactory
class  PairHandleFactory

Public Types

enum  {
  e_SUCCESS = 0, e_NOT_FOUND = 1, e_DUPLICATE = 2, e_INVALID = 3,
  BCEC_SUCCESS = e_SUCCESS, BCEC_NOT_FOUND = e_NOT_FOUND, BCEC_DUPLICATE = e_DUPLICATE, BCEC_INVALID = e_INVALID,
  RET_SUCCESS = e_SUCCESS, RET_NOT_FOUND = e_NOT_FOUND, RET_DUPLICATE = e_DUPLICATE, RET_INVALID = e_INVALID
}
typedef SkipListPair< KEY, DATA > Pair
typedef SkipListPairHandle
< KEY, DATA > 
PairHandle

Public Member Functions

 BSLMF_NESTED_TRAIT_DECLARATION (SkipList, bslma::UsesBslmaAllocator)
 SkipList (bslma::Allocator *basicAllocator=0)
 SkipList (const SkipList &original, bslma::Allocator *basicAllocator=0)
 ~SkipList ()
SkipListoperator= (const SkipList &rhs)
void releaseReferenceRaw (const Pair *reference)
void add (const KEY &key, const DATA &data, bool *newFrontFlag=0)
void add (PairHandle *result, const KEY &key, const DATA &data, bool *newFrontFlag=0)
void addAtLevelRaw (Pair **result, int level, const KEY &key, const DATA &data, bool *newFrontFlag=0)
int addAtLevelUniqueRaw (Pair **result, int level, const KEY &key, const DATA &data, bool *newFrontFlag=0)
void addRaw (Pair **result, const KEY &key, const DATA &data, bool *newFrontFlag=0)
int addUnique (const KEY &key, const DATA &data, bool *newFrontFlag=0)
int addUnique (PairHandle *result, const KEY &key, const DATA &data, bool *newFrontFlag=0)
int addUniqueRaw (Pair **result, const KEY &key, const DATA &data, bool *newFrontFlag=0)
void addAtLevelRawR (Pair **result, int level, const KEY &key, const DATA &data, bool *newFrontFlag=0)
int addAtLevelUniqueRawR (Pair **result, int level, const KEY &key, const DATA &data, bool *newFrontFlag=0)
void addR (const KEY &key, const DATA &data, bool *newFrontFlag=0)
void addR (PairHandle *result, const KEY &key, const DATA &data, bool *newFrontFlag=0)
void addRawR (Pair **result, const KEY &key, const DATA &data, bool *newFrontFlag=0)
int addUniqueR (const KEY &key, const DATA &data, bool *newFrontFlag=0)
int addUniqueR (PairHandle *result, const KEY &key, const DATA &data, bool *newFrontFlag=0)
int addUniqueRawR (Pair **result, const KEY &key, const DATA &data, bool *newFrontFlag=0)
int popFront (PairHandle *item=0)
int popFrontRaw (Pair **item)
int remove (const Pair *reference)
int removeAll ()
int removeAll (bsl::vector< PairHandle > *removed)
int removeAll (std::vector< PairHandle > *removed)
int removeAllRaw (bsl::vector< Pair * > *removed)
int removeAllRaw (std::vector< Pair * > *removed)
int update (const Pair *reference, const KEY &newKey, bool *newFrontFlag=0, bool allowDuplicates=true)
int updateR (const Pair *reference, const KEY &newKey, bool *newFrontFlag=0, bool allowDuplicates=true)
PairaddPairReferenceRaw (const Pair *reference) const
int back (PairHandle *back) const
int backRaw (Pair **back) const
bool exists (const KEY &key) const
int front (PairHandle *front) const
int frontRaw (Pair **front) const
bool isEmpty () const
int length () const
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
int find (PairHandle *item, const KEY &key) const
int findRaw (Pair **item, const KEY &key) const
int findR (PairHandle *item, const KEY &key) const
int findRRaw (Pair **item, const KEY &key) const
int findLowerBound (PairHandle *item, const KEY &key) const
int findLowerBoundRaw (Pair **item, const KEY &key) const
int findLowerBoundR (PairHandle *item, const KEY &key) const
int findLowerBoundRRaw (Pair **item, const KEY &key) const
int findUpperBound (PairHandle *item, const KEY &key) const
int findUpperBoundRaw (Pair **item, const KEY &key) const
int findUpperBoundR (PairHandle *item, const KEY &key) const
int findUpperBoundRRaw (Pair **item, const KEY &key) const
int next (PairHandle *next, const Pair *reference) const
int nextRaw (Pair **next, const Pair *reference) const
int previous (PairHandle *prevPair, const Pair *reference) const
int previousRaw (Pair **prevPair, const Pair *reference) const
int skipBackward (PairHandle *item) const
int skipBackwardRaw (Pair **item) const
int skipForward (PairHandle *item) const
int skipForwardRaw (Pair **item) const
bslma::Allocatorallocator () const

Static Public Member Functions

static int level (const Pair *reference)

Friends

class SkipListPair< KEY, DATA >
class SkipListPairHandle< KEY, DATA >
template<class KEY2 , class DATA2 >
bool operator== (const SkipList< KEY2, DATA2 > &, const SkipList< KEY2, DATA2 > &)
template<class KEY2 , class DATA2 >
bool operator!= (const SkipList< KEY2, DATA2 > &, const SkipList< KEY2, DATA2 > &)

Detailed Description

template<class KEY, class DATA>
class bdlcc::SkipList< KEY, DATA >

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).

See Component bdlcc_skiplist


Member Typedef Documentation

template<class KEY, class DATA>
typedef SkipListPair<KEY, DATA> bdlcc::SkipList< KEY, DATA >::Pair
template<class KEY, class DATA>
typedef SkipListPairHandle<KEY, DATA> bdlcc::SkipList< KEY, DATA >::PairHandle

Member Enumeration Documentation

template<class KEY, class DATA>
anonymous enum
Enumerator:
e_SUCCESS 
e_NOT_FOUND 
e_DUPLICATE 
e_INVALID 
BCEC_SUCCESS 
BCEC_NOT_FOUND 
BCEC_DUPLICATE 
BCEC_INVALID 
RET_SUCCESS 
RET_NOT_FOUND 
RET_DUPLICATE 
RET_INVALID 

Constructor & Destructor Documentation

template<class KEY, class DATA>
bdlcc::SkipList< KEY, DATA >::SkipList ( bslma::Allocator basicAllocator = 0  )  [explicit]

Create a new Skip List. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

template<class KEY, class DATA>
bdlcc::SkipList< KEY, DATA >::SkipList ( const SkipList< KEY, DATA > &  original,
bslma::Allocator basicAllocator = 0 
)

Create a new Skip List initialized to the value of the specified original list. Optionally specify a basicAllocator used to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

template<class KEY, class DATA>
bdlcc::SkipList< KEY, DATA >::~SkipList (  ) 

Destroy this Skip List. The behavior is undefined if references are outstanding to any pairs in the list.


Member Function Documentation

template<class KEY, class DATA>
bdlcc::SkipList< KEY, DATA >::BSLMF_NESTED_TRAIT_DECLARATION ( SkipList< KEY, DATA >  ,
bslma::UsesBslmaAllocator   
)
template<class KEY, class DATA>
static int bdlcc::SkipList< KEY, DATA >::level ( const Pair reference  )  [static]

Return the level of the pair identified by the specified reference. This method is provided for testing.

template<class KEY, class DATA>
SkipList& bdlcc::SkipList< KEY, DATA >::operator= ( const SkipList< KEY, DATA > &  rhs  ) 

Assign to this Skip List the value of the specified rhs list and return a reference to the modifiable list.

template<class KEY, class DATA>
void bdlcc::SkipList< KEY, DATA >::releaseReferenceRaw ( const Pair reference  ) 

Release the specified reference. After calling this method, the value of reference must not be used or released again.

template<class KEY, class DATA>
void bdlcc::SkipList< KEY, DATA >::add ( const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list. 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.

template<class KEY, class DATA>
void bdlcc::SkipList< KEY, DATA >::add ( PairHandle result,
const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list, and load into the specified result a reference to the pair in the list. Load into the optionally specified newFrontFlag a true value if the pair is at the front of the list, and a false value otherwise.

template<class KEY, class DATA>
void bdlcc::SkipList< KEY, DATA >::addAtLevelRaw ( Pair **  result,
int  level,
const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list at the specified level, and load into the specified result a reference to the pair in the list. The result reference must be released (using releaseReferenceRaw) when it is no longer needed. 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. The behavior is undefined if level is greater than the implementation-defined maximum level of this class, or if level is negative. Note that this method is provided for testing purposes.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::addAtLevelUniqueRaw ( Pair **  result,
int  level,
const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list at the specified level, and load into the specified result a reference to the pair in the list. The result reference must be released (using releaseReferenceRaw) when it is no longer needed. 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. 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.

template<class KEY, class DATA>
void bdlcc::SkipList< KEY, DATA >::addRaw ( Pair **  result,
const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list, and load into the specified result a reference to the pair in the list. 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.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::addUnique ( const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list. 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. Return 0 on success, and a non-zero value (with no effect on the list) if key is already in the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::addUnique ( PairHandle result,
const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list, and load into the specified result a reference to the pair in the list. Load into the optionally specified newFrontFlag a true value if the pair is at the front of the list, and a false value otherwise. Return 0 on success, and a non-zero value (with no effect on the list) if key is already in the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::addUniqueRaw ( Pair **  result,
const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list, and load into the specified result a reference to the pair in the list. 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. Return 0 on success, and a non-zero value (with no effect on the list) if key is already in the list.

template<class KEY, class DATA>
void bdlcc::SkipList< KEY, DATA >::addAtLevelRawR ( Pair **  result,
int  level,
const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list at the specified level, and load into the specified result a reference to the pair in the list. 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. Note that this method is provided for testing purposes.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::addAtLevelUniqueRawR ( Pair **  result,
int  level,
const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list at the specified level, and load into the specified result a reference to the pair in the list. 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.

template<class KEY, class DATA>
void bdlcc::SkipList< KEY, DATA >::addR ( const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list. Search for the correct position for key from the back of the list (in descending order by key value). Load into the optionally specified newFrontFlag a true value if the pair is at the front of the list, and a false value otherwise.

template<class KEY, class DATA>
void bdlcc::SkipList< KEY, DATA >::addR ( PairHandle result,
const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list, and load into the specified result a reference to the pair in the list. Search for the correct position for key from the back of the list (in descending order by key value). Load into the optionally specified newFrontFlag a true value if the pair is at the front of the list, and a false value otherwise.

template<class KEY, class DATA>
void bdlcc::SkipList< KEY, DATA >::addRawR ( Pair **  result,
const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list, and load into the specified result a reference to the pair in the list. 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.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::addUniqueR ( const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list. Search for the correct position for key from the back of the list (in descending order by key value). Load into the optionally specified newFrontFlag a true value if the pair is at the front of the list, and a false value otherwise. Return 0 on success, and a non-zero value (with no effect on the list) if key is already in the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::addUniqueR ( PairHandle result,
const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list, and load into the specified result a reference to the pair in the list. Search for the correct position for key from the back of the list (in descending order by key value). Load into the optionally specified newFrontFlag a true value if the pair is at the front of the list, and a false value otherwise. Return 0 on success, and a non-zero value (with no effect on the list) if key is already in the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::addUniqueRawR ( Pair **  result,
const KEY &  key,
const DATA &  data,
bool *  newFrontFlag = 0 
)

Add the specified key / data pair to this list, and load into the specified result a reference to the pair in the list. 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. Return 0 on success, and a non-zero value (with no effect on the list) if key is already in the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::popFront ( PairHandle item = 0  ) 

Remove the first item from the list and load a reference to it into the optionally specified item. Return 0 on success, and a non-zero value if the list is empty.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::popFrontRaw ( Pair **  item  ) 

Remove the first item from the list and load a reference to it into the specified item. This reference must be released (using releaseReferenceRaw) when it is no longer needed. Return 0 on success, and a non-zero value if the list is empty.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::remove ( const Pair reference  ) 

Remove the item identified by the specified reference from the list. Return 0 on success, and a non-zero value if the pair has already been removed from the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::removeAll (  ) 
template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::removeAll ( bsl::vector< PairHandle > *  removed  ) 
template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::removeAll ( std::vector< PairHandle > *  removed  ) 

Remove all items from this list. Optionally specify removed, a vector to which to append handles to the removed nodes. The items appended to removed will be in ascending order by key value. Return the number of items that were removed from this list. Note that all references in removed must be released (i.e., destroyed) before this skip list is destroyed. Note that if removed is not specified, all removed elements will be released by this method.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::removeAllRaw ( bsl::vector< Pair * > *  removed  ) 
template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::removeAllRaw ( std::vector< Pair * > *  removed  ) 

Remove all items from this list. Append to the specified removed vector pointers that can be used to refer to the removed items. Each such pointer must be released (using releaseReferenceRaw) when it is no longer needed. The pairs appended to removed will be in ascending order by key value. Return the number of items that were removed from this list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::update ( const Pair reference,
const KEY &  newKey,
bool *  newFrontFlag = 0,
bool  allowDuplicates = true 
)

Assign the specified newKey value to the pair identified by the specified reference, moving the pair within the list as necessary. Load into the optionally specified newFrontFlag a true value if the new location of the pair is the front of the list. Return 0 on success, e_NOT_FOUND if the pair referred to by reference is no longer in the list, or e_DUPLICATE if the optionally specified allowDuplicates is false and newKey already appears in the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::updateR ( const Pair reference,
const KEY &  newKey,
bool *  newFrontFlag = 0,
bool  allowDuplicates = true 
)

Assign the specified newKey value to the pair identified by the specified reference, moving the pair within the list as necessary. Search for the new position from the back of the list (in descending order by key value). Load into the optionally specified newFrontFlag a true value if the new location of the pair is the front of the list. Return 0 on success, e_NOT_FOUND if the pair referred to by reference is no longer in the list, or e_DUPLICATE if the optionally specified allowDuplicates is false and newKey already appears in the list.

template<class KEY, class DATA>
Pair* bdlcc::SkipList< KEY, DATA >::addPairReferenceRaw ( const Pair reference  )  const

Increment the reference count for the list element referred to by the specified reference. There must be a corresponding call to releaseReferenceRaw when the reference is no longer needed. The behavior is undefined item has already been released. Return reference.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::back ( PairHandle back  )  const

Load into the specified back a reference to the last item in the list. Return 0 on success, and a non-zero value (with no effect on back) if the list is empty.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::backRaw ( Pair **  back  )  const

Load into the specified back a reference to the last item in the list. The back reference must be released (using releaseReferenceRaw) when it is no longer needed. Return 0 on success, and a non-zero value if the list is empty. Note that if the list is empty, the value of *back is undefined.

template<class KEY, class DATA>
bool bdlcc::SkipList< KEY, DATA >::exists ( const KEY &  key  )  const

Return true if there is a pair in the list with the specified key, and false otherwise.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::front ( PairHandle front  )  const

Load into the specified front a reference to the first item in the list. Return 0 on success, and a non-zero value (with no effect on front) if the list is empty.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::frontRaw ( Pair **  front  )  const

Load into the specified front a reference to the first item in the list. The front reference must be released (using releaseReferenceRaw) when it is no longer needed. Return 0 on success, and a non-zero value if the list is empty.

template<class KEY, class DATA>
bool bdlcc::SkipList< KEY, DATA >::isEmpty (  )  const

Return true if this list is empty, and false otherwise.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::length (  )  const

Return the number of items in this list.

template<class KEY, class DATA>
bsl::ostream& bdlcc::SkipList< KEY, DATA >::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const

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. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, suppress all indentation AND format the entire output on one line. If stream is not valid on entry, this operation has no effect.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::find ( PairHandle item,
const KEY &  key 
) const

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). If multiple elements having key are in the container, load item with the first matching element. Return 0 on success, and a non-zero value (with no effect on item) if no such element exists. If there are multiple elements in the list with the key, it is undefined which one is returned.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::findRaw ( Pair **  item,
const KEY &  key 
) const

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). Return 0 on success, and a non-zero value (with no effect on item) if no such element exists. If there are multiple elements in the list with the key, it is undefined which one is returned. The item reference must be released (using releaseReferenceRaw) when it is no longer needed.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::findR ( PairHandle item,
const KEY &  key 
) const

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). If multiple elements having key are in the container, load item with the last matching element. key are present, find the last one. Return 0 on success, and a non-zero value (with no effect on item) if no such element exists. If there are multiple elements in the list with the key, it is undefined which one is returned.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::findRRaw ( Pair **  item,
const KEY &  key 
) const

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). Return 0 on success, and a non-zero value (with no effect on item) if no such element exists. If there are multiple elements in the list with the key, it is undefined which one is returned. The item reference must be released (using releaseReferenceRaw) when it is no longer needed.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::findLowerBound ( PairHandle item,
const KEY &  key 
) const

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). Return 0 on success, and a non-zero value (with no effect on item) if no such element exists.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::findLowerBoundRaw ( Pair **  item,
const KEY &  key 
) const

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). Return 0 on success, and a non-zero value (with no effect on item) if no such element exists. The item reference must be released (using releaseReferenceRaw) when it is no longer needed.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::findLowerBoundR ( PairHandle item,
const KEY &  key 
) const

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). Return 0 on success, and a non-zero value (with no effect on item) if no such element exists.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::findLowerBoundRRaw ( Pair **  item,
const KEY &  key 
) const

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). Return 0 on success, and a non-zero value (with no effect on item) if no such element exists. The item reference must be released (using releaseReferenceRaw) when it is no longer needed.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::findUpperBound ( PairHandle item,
const KEY &  key 
) const

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). Return 0 on success, and a non-zero value (with no effect on item) if no such element exists.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::findUpperBoundRaw ( Pair **  item,
const KEY &  key 
) const

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). Return 0 on success, and a non-zero value (with no effect on item) if no such element exists. The item reference must be released (using releaseReferenceRaw) when it is no longer needed.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::findUpperBoundR ( PairHandle item,
const KEY &  key 
) const

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). Return 0 on success, and a non-zero value (with no effect on item) if no such element exists.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::findUpperBoundRRaw ( Pair **  item,
const KEY &  key 
) const

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). Return 0 on success, and a non-zero value (with no effect on item) if no such element exists. The item reference must be released (using releaseReferenceRaw) when it is no longer needed.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::next ( PairHandle next,
const Pair reference 
) const

Load into the specified next a reference to the item that appears in the list after the item identified by the specified reference. Return 0 on success, or a non-zero value if reference refers to the back of the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::nextRaw ( Pair **  next,
const Pair reference 
) const

Load into the specified next a reference to the item that appears in the list after the item identified by the specified reference. The next reference must be released (using releaseReferenceRaw) when it is no longer needed. Return 0 on success, or a non-zero value if reference refers to the back of the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::previous ( PairHandle prevPair,
const Pair reference 
) const

Load into the specified prevPair a reference to the pair that appears in the list before the pair identified by the specified reference. Return 0 on success, or a non-zero value if reference refers to the front of the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::previousRaw ( Pair **  prevPair,
const Pair reference 
) const

Load into the specified prevPair a reference to the pair that appears in the list before the pair identified by the specified reference. The prevPair reference must be released (using releaseReferenceRaw) when it is no longer needed. Return 0 on success, or a non-zero value if reference refers to the front of the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::skipBackward ( PairHandle item  )  const

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; otherwise reset the value of item. Return 0 on success, and e_NOT_FOUND (with no effect on the value of item) if item is no longer in the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::skipBackwardRaw ( Pair **  item  )  const

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; otherwise reset the value of item. Return 0 on success, and e_NOT_FOUND (with no effect on the value of item) if item is no longer in the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::skipForward ( PairHandle item  )  const

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; otherwise reset the value of item. Return 0 on success, and e_NOT_FOUND (with no effect on the value of item) if item is no longer in the list.

template<class KEY, class DATA>
int bdlcc::SkipList< KEY, DATA >::skipForwardRaw ( Pair **  item  )  const

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; otherwise reset the value of item. Return 0 on success, and e_NOT_FOUND (with no effect on the value of item) if item is no longer in the list.

template<class KEY, class DATA>
bslma::Allocator* bdlcc::SkipList< KEY, DATA >::allocator (  )  const

Return the allocator used by this object to supply memory.


Friends And Related Function Documentation

template<class KEY, class DATA>
friend class SkipListPair< KEY, DATA > [friend]
template<class KEY, class DATA>
friend class SkipListPairHandle< KEY, DATA > [friend]
template<class KEY, class DATA>
template<class KEY2 , class DATA2 >
bool operator== ( const SkipList< KEY2, DATA2 > &  ,
const SkipList< KEY2, DATA2 > &   
) [friend]
template<class KEY, class DATA>
template<class KEY2 , class DATA2 >
bool operator!= ( const SkipList< KEY2, DATA2 > &  ,
const SkipList< KEY2, DATA2 > &   
) [friend]

The documentation for this class was generated from the following file: