dReal4
ScopedUnorderedSet< Key, Hash, KeyEqual, Allocator > Class Template Reference

Backtrackable set. More...

#include </home/soonhokong/work/dreal4/dreal/util/scoped_unordered_set.h>

Public Types

enum  ActionKind { INSERT }
 To backtrack, we need to record the actions applied to this container. More...
 
using UnorderedSetType = std::unordered_set< Key, Hash, KeyEqual, Allocator >
 Aliases.
 
using key_type = typename UnorderedSetType::key_type
 
using value_type = typename UnorderedSetType::value_type
 
using size_type = typename UnorderedSetType::size_type
 
using const_iterator = typename UnorderedSetType::const_iterator
 
using Action = std::tuple< ActionKind, Key >
 

Public Member Functions

 ScopedUnorderedSet (const ScopedUnorderedSet &)=default
 
 ScopedUnorderedSet (ScopedUnorderedSet &&) noexcept=default
 
ScopedUnorderedSetoperator= (const ScopedUnorderedSet &)=default
 
ScopedUnorderedSetoperator= (ScopedUnorderedSet &&) noexcept=default
 
const_iterator begin () const
 Iterators. More...
 
const_iterator cbegin () const
 
const_iterator end () const
 
const_iterator cend () const
 
bool empty () const
 Capacity.
 
size_type size () const
 
void clear ()
 Modifiers.
 
void insert (const Key &k)
 
size_type count (const Key &key) const
 
const_iterator find (const Key &key) const
 
void push ()
 Push/Pop.
 
void pop ()
 

Detailed Description

template<class Key, class Hash = std::hash<Key>, class KeyEqual = std::equal_to<Key>, class Allocator = std::allocator<Key>>
class dreal::ScopedUnorderedSet< Key, Hash, KeyEqual, Allocator >

Backtrackable set.

Member Enumeration Documentation

◆ ActionKind

enum ActionKind
strong

To backtrack, we need to record the actions applied to this container.

Enumerator
INSERT 

Insert(k) means that k is inserted.

Member Function Documentation

◆ begin()

const_iterator begin ( ) const
inline

Iterators.

Note
We only provide 'const' iterators because any modification should be done explicitly via its APIs so that we can keep track of changes and undo when pop() is called.

◆ find()

const_iterator find ( const Key &  key) const
inline
Note
It returns 'const' iterator.

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