[asterisk-commits] mmichelson: branch mmichelson/ao2_containers r138940 - /team/mmichelson/ao2_c...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Aug 19 17:58:15 CDT 2008


Author: mmichelson
Date: Tue Aug 19 17:58:15 2008
New Revision: 138940

URL: http://svn.digium.com/view/asterisk?view=rev&rev=138940
Log:
astobj2 is a nifty API that has proven to be helpful
on many occasions. So helpful, in fact, that it was
backported to 1.4 shortly after its introduction to
Asterisk trunk.

Its usefulness, however, has been limited by the fact
that it contains but one type of container, a hash table.
While the hash table is great due to its average O(1)
insertion, deletion, and searching, the structure
has the downside of placing the elements in an order
which cannot be relied upon.

Thus it is this branch which will attempt to rectify the
situation. The goal is to add two new container types,
both of which allow for a specific order to be maintained
for the container.

Firstly, I will be implementing a linked list ao2 container.
The purpose of this will be to allow for each additional item
to be added either to the beginning or end of the list. This is
useful, for instance, when parsing items from a config file if
the order that the items in the config file are placed in should
be maintained in the container. This container will have an
O(1) insertion time, O(N) worst case deletion time, and O(N) worst
case search time.

Secondly, I will be implementing a skip list ao2 container.
Skip lists, by their nature, maintain an order on their own. This
type of container may be useful for a task such as keeping all 
elements in a list in alphabetical order by some primary key field
of the elements. This container will have an average O(logN) insertion,
deletion, and search time.

This is sort of a pet project of mine, so I'm not sure how often
updates will come for this, but it should be fun and I'm looking
forward to it.

Added:
    team/mmichelson/ao2_containers/
      - copied from r138937, trunk/




More information about the asterisk-commits mailing list