pva2pva 1.4.2
Loading...
Searching...
No Matches
weak_set< T >::XIterator Struct Reference

an iterator-ish object which also locks the set during iteration More...

#include <weakset.h>

Collaboration diagram for weak_set< T >::XIterator:

Public Member Functions

 XIterator (weak_set &S)
value_pointer next ()
 yield the next live entry

Public Attributes

weak_set & set
epicsGuard< epicsMutex > guard
store_t::iterator it
store_t::iterator end

Detailed Description

template<typename T>
struct weak_set< T >::XIterator

an iterator-ish object which also locks the set during iteration

Definition at line 204 of file weakset.h.

Constructor & Destructor Documentation

◆ XIterator()

template<typename T>
weak_set< T >::XIterator::XIterator ( weak_set & S)
inline

Definition at line 208 of file weakset.h.

208:set(S), guard(S.mutex()), it(S._data->store.begin()), end(S._data->store.end()) {}
a std::set-ish container where entries are removed when ref. counts fall to zero
Definition weakset.h:58
epicsMutex & mutex() const
Definition weakset.h:199

Member Function Documentation

◆ next()

template<typename T>
value_pointer weak_set< T >::XIterator::next ( )
inline

yield the next live entry

Definition at line 210 of file weakset.h.

210 {
212 while(it!=end) {
213 ret = (it++)->lock();
214 if(ret) break;
215 }
216 return ret;
217 }

Member Data Documentation

◆ end

template<typename T>
store_t::iterator weak_set< T >::XIterator::end

Definition at line 207 of file weakset.h.

◆ guard

template<typename T>
epicsGuard<epicsMutex> weak_set< T >::XIterator::guard

Definition at line 206 of file weakset.h.

◆ it

template<typename T>
store_t::iterator weak_set< T >::XIterator::it

Definition at line 207 of file weakset.h.

◆ set

template<typename T>
weak_set& weak_set< T >::XIterator::set

Definition at line 205 of file weakset.h.


The documentation for this struct was generated from the following file: