#include <volatile_set.hpp>
Public Types | |
using | iterator = typename std::unordered_set< Key, Hash, Pred >::iterator |
Public Member Functions | |
void | insert (Key const &val) |
void | erase (Key const &val) |
int | count (Key const &val) |
void | foreach (std::function< void(Key const &) > const &fun) |
iterator & | lock_begin () |
this is stack based; lock_end unlocks (and invalidates) iterator returned by last lock_begin call More... | |
iterator & | lock_find (Key const &val) |
void | unlock () |
iterator | end () |
size_t | size () |
bool | empty () |
Detailed Description
template<class Key, class Hash = std::hash<Key>, class Pred = std::equal_to<Key>>
class iv::volatile_set< Key, Hash, Pred >
Works like unordered_set, but elements can be inserted and removed while iterating using foreach() method. Items that are inserted during iteration will be added after the iteration ends. Item erasure is instant.
Definition at line 16 of file volatile_set.hpp.
Member Typedef Documentation
◆ iterator
using iv::volatile_set< Key, Hash, Pred >::iterator = typename std::unordered_set< Key, Hash, Pred >::iterator |
Definition at line 19 of file volatile_set.hpp.
Member Function Documentation
◆ insert()
void iv::volatile_set< Key, Hash, Pred >::insert | ( | Key const & | val | ) |
Definition at line 5 of file volatile_set.inl.
◆ erase()
void iv::volatile_set< Key, Hash, Pred >::erase | ( | Key const & | val | ) |
Definition at line 14 of file volatile_set.inl.
◆ count()
int iv::volatile_set< Key, Hash, Pred >::count | ( | Key const & | val | ) |
Definition at line 79 of file volatile_set.inl.
◆ foreach()
void iv::volatile_set< Key, Hash, Pred >::foreach | ( | std::function< void(Key const &) > const & | fun | ) |
Definition at line 31 of file volatile_set.inl.
◆ lock_begin()
volatile_set< Key, Hash, Pred >::iterator & iv::volatile_set< Key, Hash, Pred >::lock_begin |
this is stack based; lock_end unlocks (and invalidates) iterator returned by last lock_begin call
Definition at line 46 of file volatile_set.inl.
◆ lock_find()
volatile_set< Key, Hash, Pred >::iterator & iv::volatile_set< Key, Hash, Pred >::lock_find | ( | Key const & | val | ) |
Definition at line 54 of file volatile_set.inl.
◆ unlock()
void iv::volatile_set< Key, Hash, Pred >::unlock |
Definition at line 61 of file volatile_set.inl.
◆ end()
volatile_set< Key, Hash, Pred >::iterator iv::volatile_set< Key, Hash, Pred >::end |
Definition at line 73 of file volatile_set.inl.
◆ size()
size_t iv::volatile_set< Key, Hash, Pred >::size |
Definition at line 85 of file volatile_set.inl.
◆ empty()
bool iv::volatile_set< Key, Hash, Pred >::empty |
Definition at line 92 of file volatile_set.inl.
The documentation for this class was generated from the following files:
- ivorium_core/Basics/volatile_set.hpp
- ivorium_core/Basics/volatile_set.inl