implemented enumerator for linked_list

This commit is contained in:
Martin Willi
2007-10-04 08:40:20 +00:00
parent d62a4526fd
commit a7e65d5262
2 changed files with 63 additions and 1 deletions
+16 -1
View File
@@ -31,6 +31,7 @@ typedef struct linked_list_t linked_list_t;
#include <library.h>
#include <utils/iterator.h>
#include <utils/enumerator.h>
/**
* @brief Class implementing a double linked list.
@@ -56,6 +57,9 @@ struct linked_list_t {
* @brief Creates a iterator for the given list.
*
* @warning Created iterator_t object has to get destroyed by the caller.
*
* @deprecated Iterator is obsolete and will disappear, it is too
* complicated to implement. Use enumerator instead.
*
* @param this calling object
* @param forward iterator direction (TRUE: front to end)
@@ -75,7 +79,18 @@ struct linked_list_t {
*/
iterator_t *(*create_iterator_locked) (linked_list_t *this,
pthread_mutex_t *mutex);
/**
* @brief Create an enumerator over the list.
*
* The enumerator is a "lightweight" iterator. It only has two methods
* and should therefore be much easier to implement.
*
* @param this calling object
* @return enumerator over list items
*/
enumerator_t* (*create_enumerator)(linked_list_t *this);
/**
* @brief Inserts a new item at the beginning of the list.
*