implemented enumerator for linked_list
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user