sipxportlib
Version 3.3
|
#include <UtlContainer.h>
Public Member Functions | |
UtlContainer () | |
virtual | ~UtlContainer () |
virtual UtlContainable * | insert (UtlContainable *obj)=0 |
virtual UtlBoolean | destroy (UtlContainable *)=0 |
virtual void | destroyAll ()=0 |
virtual UtlContainable * | removeReference (const UtlContainable *object)=0 |
virtual void | removeAll ()=0 |
virtual UtlContainable * | find (const UtlContainable *) const =0 |
virtual unsigned | hash () const |
virtual UtlContainableType | getContainableType () const |
virtual UtlBoolean | isEmpty () const =0 |
virtual UtlBoolean | contains (const UtlContainable *) const =0 |
virtual size_t | entries () const =0 |
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... | |
Static Public Member Functions | |
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... | |
Static Public Attributes | |
static const UtlContainableType | TYPE = "UtlContainer" |
Static Public Attributes inherited from UtlContainable | |
static const UtlContainableType | TYPE = "UtlContainable" |
Protected Member Functions | |
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 Attributes | |
OsBSem | mContainerLock |
Must be taken when making any change to container state. More... | |
UtlChain | mIteratorList |
Friends | |
class | UtlIterator |
class | UtlInit |
UtlContainer defines an abstract container designed to hold UtlContainable derived objects.
UtlContainer | ( | ) |
< Class type used for runtime checking Default Constructor
|
virtual |
Destructor
|
pure virtual |
Inserts the designated containable object into the list
Implemented in UtlSList, UtlHashMap, UtlHashBag, and UtlSortedList.
|
pure virtual |
Removes the designated objects from the list and frees the object by calling delete.
Implemented in UtlHashMap, UtlList, UtlSList, and UtlHashBag.
|
pure virtual |
Removes all elements from the container and deletes each one.
Implemented in UtlHashMap, UtlList, and UtlHashBag.
|
pure virtual |
Removes the designated object by reference (as opposed to searching for an equality match).
Implemented in UtlHashMap, UtlList, and UtlHashBag.
|
pure virtual |
Removes all elements from the container without freeing the objects.
Implemented in UtlHashMap, UtlList, and UtlHashBag.
|
pure virtual |
Find the designated value within the container
Implemented in UtlHashMap, UtlList, UtlSList, UtlHashBag, and UtlSortedList.
|
virtual |
Calculate a unique hash code for this object. If the equals operator returns true for another object, then both of those objects must return the same hashcode.
Calculate a unique hash code for this object. If the equals operator returns true between two objects, then both objects must have the same hash code.
Implements UtlContainable.
|
virtual |
Get the ContainableType for a UtlContainable derived class.
Implements UtlContainable.
Reimplemented in UtlList, UtlHashMap, UtlHashBag, UtlSList, UtlCopyableSList, UtlSortedList, UtlCopyableSortedList, OsContactList, and UtlDList.
|
pure virtual |
Determine if the container is empty.
Implemented in UtlList, UtlHashMap, and UtlHashBag.
|
pure virtual |
Determine if the container includes the designated objects.
Implemented in UtlList, UtlHashMap, and UtlHashBag.
|
pure virtual |
Determine the number of elements within the container.
Implemented in UtlList, UtlHashMap, and UtlHashBag.
|
virtual |
Compare the this object to another like-objects. Results for designating a non-like object are undefined.
Compare the this object to another like object. Results for comparing with a non-like object are undefined.
Implements UtlContainable.
|
static |
Lock the linkage between containers and iterators.
This must be called by any code that will take both the mContainerRefLock in an iterator and the mContainerLock in a container. It can be released as soon as both those locks are acquired, and should be, since most operations on any iterator will need to take it briefly.
|
static |
Unlock the linkage between containers and iterators.
|
protected |
Add an iterator to the list to be notified of changes to this container.
newIterator | to be notified of container changes |
|
protected |
Called from iterator destructor to prevent further notices.
< The caller must be holding this->mContainerLock and newIterator->mContainerRefLock
This also sets the mpMyContainer pointer in newIterator. The caller must be holding both this->mContainerLock and existingIterator->mContainerRefLock; see also acquireIteratorConnectionLock.
Remove the existingIterator from the list to be called for changes to this UtlContainer.
existingIterator | iterator to remove from notice list |
|
protected |
Call the invalidate method on all iterators.
This is for use in subclasses that have other state that must be cleaned up.
:NOTE: the caller must be holding the iterator list lock; see iteratorListLock
|
friend |
|
friend |
|
static |
|
mutableprotected |
Must be taken when making any change to container state.
|
protected |
mpIterator list is the list of existing UtlIterator objects constructed using this UtlContainer
This is used to invoke methods on each UtlIterator when changes are made to the UtlContainer ->remove when an element is about to be removed from the UtlContainer, ->invalidate when this UtlContainer is being deleted see sIteratorConnectionLock