Template Class ConcurrentList

Class Documentation

template<typename Element>
class ConcurrentList

Abstraction for a thread-safe list implementation.

A limited number of operations are currently supported; only what we've needed so far. Current implementation is really simple: using a STL list with a reader-writer lock around the operations.

Public Functions

inline ConcurrentList()
inline void PushBack(Element const &element)

Appends an element to the end of the list.

inline void Remove(Element const &element)

Removes all elements with the given value from the list.

inline void Iterate(std::function<void(Element)> const &callback)

Iterates over the list, calling the given user-callback with each iteration.

inline size_t Size()

Returns the size (number of elements) of the list.

inline void Clear()

Removes all elements from the list.