sipxportlib  Version 3.3
Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | Friends | List of all members
UtlSortedList Class Reference

#include <UtlSortedList.h>

Inheritance diagram for UtlSortedList:
Inheritance graph
[legend]
Collaboration diagram for UtlSortedList:
Collaboration graph
[legend]

Public Member Functions

 UtlSortedList ()
 
virtual UtlContainableinsert (UtlContainable *obj)
 
virtual UtlContainableremove (const UtlContainable *)
 
virtual UtlContainablefind (const UtlContainable *) const
 
virtual size_t index (const UtlContainable *obj) const
 
virtual size_t occurrencesOf (const UtlContainable *obj) const
 
UtlContainableType getContainableType () const
 
- Public Member Functions inherited from UtlList
virtual ~UtlList ()
 
UtlContainableget ()
 
UtlContainableremoveReference (const UtlContainable *obj)
 
UtlContainableremoveAt (const size_t N)
 
virtual UtlBoolean destroy (UtlContainable *)
 
void destroyAll ()
 
void removeAll ()
 
void rehash ()
 
virtual UtlContainableat (size_t N) const
 
virtual UtlContainablefirst () const
 
virtual UtlContainablelast () const
 
virtual size_t entries () const
 
virtual UtlBoolean isEmpty () const
 
virtual UtlBoolean contains (const UtlContainable *object) const
 
virtual UtlBoolean containsReference (const UtlContainable *) const
 
- Public Member Functions inherited from UtlContainer
 UtlContainer ()
 
virtual ~UtlContainer ()
 
virtual unsigned hash () const
 
virtual int compareTo (const UtlContainable *otherObject) const
 
- Public Member Functions inherited from UtlContainable
virtual ~UtlContainable ()
 
unsigned directHash () const
 Provides a hash function that uses the object pointer as the hash value. More...
 
virtual UtlBoolean isEqual (UtlContainable const *) const
 Test this object to another object for equality. More...
 
virtual UtlBoolean isInstanceOf (const UtlContainableType type) const
 Determine if this object is a derivative of the specified UtlContainableType. More...
 
- Public Member Functions inherited from UtlChain
 UtlChain ()
 Constructor initializes to unlinked. More...
 
 ~UtlChain ()
 Destructor. More...
 

Static Public Attributes

static const UtlContainableType TYPE = "UtlSortedList"
 
- Static Public Attributes inherited from UtlList
static UtlContainableType TYPE = "UtlList"
 
- Static Public Attributes inherited from UtlContainer
static const UtlContainableType TYPE = "UtlContainer"
 
- Static Public Attributes inherited from UtlContainable
static const UtlContainableType TYPE = "UtlContainable"
 

Protected Types

enum  MatchType { POSITION, EXACTLY }
 

Protected Member Functions

UtlLinkfindNode (UtlLink *starting, MatchType match, const UtlContainable *obj) const
 
- Protected Member Functions inherited from UtlList
 UtlList ()
 
void notifyIteratorsOfRemove (UtlLink *element)
 
virtual void removeLink (UtlLink *toBeRemoved)
 
- Protected Member Functions inherited from UtlContainer
void addIterator (UtlIterator *newIterator) const
 Add an iterator to the list to be notified of changes to this container. More...
 
void removeIterator (UtlIterator *existingIterator) const
 Called from iterator destructor to prevent further notices. More...
 
void invalidateIterators ()
 Call the invalidate method on all iterators. More...
 
- Protected Member Functions inherited from UtlChain
bool isUnLinked () const
 Is this block not linked to anything? More...
 
void unchain ()
 Take the link out of its chain. More...
 
void chainBefore (UtlChain *existing)
 Insert a new UtlChain before existing. More...
 
void chainAfter (UtlChain *existing)
 Insert a new UtlChain after existing.. More...
 
UtlChainlistHead () const
 Returns the head (first) UtlLink on the list (or NULL if the list is empty). More...
 
UtlChainlistTail () const
 Returns the tail (last) UtlLink on the list (or NULL if the list is empty). More...
 
UtlLinkhead () const
 Returns the head (first) UtlLink on the list (or NULL if the list is empty). More...
 
UtlLinktail () const
 Returns the tail (last) UtlLink on the list (or NULL if the list is empty). More...
 
void listBefore (UtlChain *list, UtlChain *existing)
 Insert this link into a list before an existing entry (before NULL == at the tail). More...
 
void listAfter (UtlChain *list, UtlChain *existing)
 Insert this link into a list after an existing entry (after NULL == at the head). More...
 
UtlChaindetachFromList (UtlChain *listHead)
 Remove a link from a list. More...
 

Friends

class UtlSortedListIterator
 

Additional Inherited Members

- Static Public Member Functions inherited from UtlContainer
static void acquireIteratorConnectionLock ()
 Lock the linkage between containers and iterators. More...
 
static void releaseIteratorConnectionLock ()
 Unlock the linkage between containers and iterators. More...
 
- Static Public Member Functions inherited from UtlContainable
static unsigned stringHash (char const *value)
 Provides a hash function appropriate for null-terminated string values. More...
 
static UtlBoolean areSameTypes (const UtlContainableType type1, const UtlContainableType type2)
 Are UtlContainable types the same. More...
 
- Protected Attributes inherited from UtlContainer
OsBSem mContainerLock
 Must be taken when making any change to container state. More...
 
UtlChain mIteratorList
 
- Protected Attributes inherited from UtlChain
UtlChainprev
 backward chain pointer More...
 
UtlChainnext
 forward chain pointer More...
 

Detailed Description

UtlSortedList is a list that is always sorted

Most list accessors and inquiry methods are performed by equality as opposed to by referencing (pointers). For example, a list.contains(obj) call will loop through all of the list objects and test equality by calling the isEquals(...) method. A list.containsReference(obj) call will search for a pointer match.

See also
UtlSListIterator
UtlList
UtlContainer
UtlContainable

Member Enumeration Documentation

enum MatchType
protected
Enumerator
POSITION 
EXACTLY 

Constructor & Destructor Documentation

Default Constructor

Member Function Documentation

UtlContainable * insert ( UtlContainable obj)
virtual

Inserts the designated containable object into the list

Returns
the object if successful, otherwise null

Implements UtlContainer.

UtlContainable * remove ( const UtlContainable obj)
virtual

Remove the designated object by equality (as opposed to by reference).

Implements UtlList.

UtlContainable * find ( const UtlContainable obj) const
virtual

Find the first occurrence of the designated object by equality (as opposed to by reference).

Implements UtlList.

size_t index ( const UtlContainable obj) const
virtual

Return the list position of the designated object or UTL_NOT_FOUND if not found.

Implements UtlList.

size_t occurrencesOf ( const UtlContainable obj) const
virtual

Return the number of occurrences of the designated object

Implements UtlList.

UtlContainableType getContainableType ( ) const
virtual

Get the ContainableType for the list as a contained object.

Reimplemented from UtlList.

UtlLink * findNode ( UtlLink starting,
MatchType  match,
const UtlContainable obj 
) const
protected

Return the first UtlLink which is greater or equal to the designated object, or NULL if not found.

The caller must hold the mContainerLock

Friends And Related Function Documentation

friend class UtlSortedListIterator
friend

Member Data Documentation

const UtlContainableType TYPE = "UtlSortedList"
static