sipxportlib
Version 3.3
|
#include <UtlLink.h>
Friends | |
class | UtlChainPool |
class | UtlContainer |
class | UtlList |
class | UtlListIterator |
class | UtlSList |
class | UtlSListIterator |
class | UtlSortedList |
class | UtlHashBag |
class | UtlHashBagIterator |
class | UtlLinkTest |
class | UtlInit |
Traversal Operations | |
UtlContainable * | data |
The containable object whose place in the list this UtlLink is tracking. More... | |
unsigned | hash |
The hash code for the containable object whose place in the list this UtlLink is tracking. More... | |
UtlLink * | next () const |
Returns the next UtlLink forward in a chain (or NULL for the end). More... | |
UtlLink * | prev () const |
Returns the next UtlLink backward in a chain (or NULL for the end). More... | |
UtlLink * | findDataRef (UtlContainable *target) const |
Linear search starting at this link for a matching data value. More... | |
UtlLink * | findNextHash (unsigned targetHash) const |
Linear search starting at this link for a matching data value. More... | |
Memory Management | |
static size_t | totalAllocated () |
Get the total number of UtlLink blocks allocated. More... | |
Link Manipulation in a Chain | |
These methods insert and remove this UtlLink in a chain. They do not do any special handling for the ends of a chain, so they can be used in either NULL-terminated or circular chains. | |
UtlContainable * | unlink () |
Take the link block out of its list, and return the data pointer. More... | |
static UtlLink * | before (UtlChain *existing, UtlContainable *newData) |
Insert a new UtlLink to newData before existing, returning the new UtlLink. More... | |
static UtlLink * | after (UtlChain *existing, UtlContainable *newData) |
Insert a new UtlLink to newData after existing, returning the new UtlLink. More... | |
List Operations | |
These methods do the special handling for using a UtlChain as a list header. The UtlChain.next points to the head (first) UtlLink on the list. The UtlChain.prev points to the tail (last) UtlLink. The UtlLink objects on the list form a NULL-terminated chain - they do not point to the UtlChain that serves as the header. | |
UtlContainable * | detachFrom (UtlChain *listHead) |
Remove a link from a list. More... | |
static UtlLink * | listBefore (UtlChain *list, UtlChain *existing, UtlContainable *newData) |
Insert a new item into a list before an existing entry (before NULL == at the tail). More... | |
static UtlLink * | listAfter (UtlChain *list, UtlChain *existing, UtlContainable *newData) |
Insert a new item into a list before an existing entry (after NULL == at the head). More... | |
static UtlLink * | findData (UtlChain *list, UtlContainable *target) |
Find the first matching target in the list by reference. More... | |
Constructor and Destructor | |
| |
UtlLink () | |
The UtlLink constructor is protected. More... | |
~UtlLink () | |
Destructor. More... | |
void | release () |
Return a UtlLink to the pool. More... | |
void | rehash () |
Recalculate the hash for this item. More... | |
static UtlLink * | get () |
Get a UtlLink from the pool. More... | |
Additional Inherited Members | |
Public Member Functions inherited from UtlChain | |
UtlChain () | |
Constructor initializes to unlinked. More... | |
~UtlChain () | |
Destructor. 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... | |
UtlChain * | listHead () const |
Returns the head (first) UtlLink on the list (or NULL if the list is empty). More... | |
UtlChain * | listTail () const |
Returns the tail (last) UtlLink on the list (or NULL if the list is empty). More... | |
UtlLink * | head () const |
Returns the head (first) UtlLink on the list (or NULL if the list is empty). More... | |
UtlLink * | tail () 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... | |
UtlChain * | detachFromList (UtlChain *listHead) |
Remove a link from a list. More... | |
Protected Attributes inherited from UtlChain | |
UtlChain * | prev |
backward chain pointer More... | |
UtlChain * | next |
forward chain pointer More... | |
UtlLink implements linked lists of data blocks. It may not be used directly because it is not thread safe; use one of the classes derived from UtlList.
In addition to the links forward (next) and backward (prev) provided by the parent UtlChain, a UtlLink also points to an item whose place it implements in the list (data).
|
inlineprotected |
|
inlineprotected |
Destructor.
A UtlLink is only destructed when the UtlLinkPool destructor is invoked.
|
inline |
Linear search starting at this link for a matching data value.
|
inline |
Linear search starting at this link for a matching data value.
|
static |
Get the total number of UtlLink blocks allocated.
Because the underlying UtlLinkPool implementation allocates UtlLinks in blocks, this number will usually be slightly higher than the maximum number ever in use (rounded up to the nearest UTLLINK_BLOCK_SIZE)
|
protected |
Take the link block out of its list, and return the data pointer.
|
staticprotected |
|
staticprotected |
|
staticprotected |
Insert a new item into a list before an existing entry (before NULL == at the tail).
list | the list to insert into |
existing | the UtlLink for the position in the list to insert before. NULL means at the end of the list. |
newData | the new data item to be inserted. |
|
staticprotected |
Insert a new item into a list before an existing entry (after NULL == at the head).
list | the list to insert into |
existing | the UtlLink for the position in the list to insert after. NULL means at the beginning of the list. |
newData | the new data item to be inserted. |
|
protected |
Remove a link from a list.
|
inlinestaticprotected |
Find the first matching target in the list by reference.
|
protected |
Return a UtlLink to the pool.
|
protected |
Recalculate the hash for this item.
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
UtlContainable* data |
The containable object whose place in the list this UtlLink is tracking.
unsigned hash |
The hash code for the containable object whose place in the list this UtlLink is tracking.