Inherited by w_list_const_i< T, LOCK >.
Inheritance diagram for w_list_i< T, LOCK >:
Modifying the list while iterating over it: You can remove items from the list while iterating over it thus:
while(iter.next()) {
item = iter.curr();
\< Now you can remove the item. \>
}
w_list_t<sthread_t*> thread_list; w_list_i<sthread_t*> i(thread_list); while(i.next()) { sthread_t *t = i.curr(); if (t-> .....) .... }
Definition at line 438 of file w_list.h.
Public Member Functions | |
NORET | w_list_i () |
NORET | w_list_i (const w_list_t< T, LOCK > &l, bool backwards=false) |
NORET | ~w_list_i () |
void | reset (const w_list_t< T, LOCK > &l, bool backwards=false) |
T * | next () |
T * | curr () const |
Return the current item in the list. | |
Protected Attributes | |
const w_list_t< T, LOCK > * | _list |
void w_list_i< T, LOCK >::reset | ( | const w_list_t< T, LOCK > & | l, | |
bool | backwards = false | |||
) | [inline] |
Make an iterator usable (possibly again), for the given list, backward or forward.
Definition at line 457 of file w_list.h.
Referenced by w_list_const_i< T, LOCK >::reset().
Here is the caller graph for this function:
T* w_list_i< T, LOCK >::next | ( | ) | [inline] |
Adjust the iterator to point to the next item in the list and return a pointer to that next item. Returns NULL if there is no next item. Note that this depends on the results of the previous next() call, but what we do with curr() from the prior call is immaterial.
Reimplemented in w_list_const_i< T, LOCK >.
Definition at line 469 of file w_list.h.
Referenced by sthread_t::check_all_stacks(), option_group_t::check_required(), sthread_t::collect(), sthread_t::dumpall(), sthread_t::for_each_thread(), w_hash_t< T, LOCK, K >::lookup(), option_group_t::lookup(), w_list_const_i< T, LOCK >::next(), operator<<(), option_group_t::print_usage(), option_group_t::print_values(), w_hash_t< T, LOCK, K >::remove(), and option_group_t::~option_group_t().
Here is the caller graph for this function:
T* w_list_i< T, LOCK >::curr | ( | ) | const [inline] |
Return the current item in the list.
Returns NULL if there is no current item. There is no current item until next() is called at least once, thus, one must call next() to get the first item.
Reimplemented in w_list_const_i< T, LOCK >.
Definition at line 488 of file w_list.h.
Referenced by sthread_t::check_all_stacks(), sthread_t::collect(), w_list_const_i< T, LOCK >::curr(), sthread_t::dumpall(), sthread_t::for_each_thread(), option_group_t::lookup(), operator<<(), option_group_t::print_usage(), option_group_t::print_values(), w_hash_t< T, LOCK, K >::remove(), and option_group_t::~option_group_t().
Here is the caller graph for this function: