Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <rev.h>
Public Types | |
typedef Map::key_type | key_type |
typedef Map::mapped_type | mapped_type |
typedef Map::value_type | value_type |
typedef Map::const_iterator | const_iterator |
Public Member Functions | |
void | SetLevel (int level) final |
int | Level () const |
bool | contains (key_type key) const |
const mapped_type & | at (key_type key) const |
void | EraseOrDie (key_type key) |
void | Set (key_type key, mapped_type value) |
int | size () const |
Wrapper to the underlying const map functions. | |
bool | empty () const |
const_iterator | find (const key_type &k) const |
const_iterator | begin () const |
const_iterator | end () const |
Like a normal map but support backtrackable operations.
This works on any class "Map" that supports: begin(), end(), find(), erase(), insert(), key_type, value_type, mapped_type and const_iterator.
Map::const_iterator operations_research::RevMap< Map >::const_iterator |
Map::key_type operations_research::RevMap< Map >::key_type |
Map::mapped_type operations_research::RevMap< Map >::mapped_type |
Map::value_type operations_research::RevMap< Map >::value_type |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void operations_research::RevMap< Map >::EraseOrDie | ( | key_type | key | ) |
|
inline |
|
inline |
void operations_research::RevMap< Map >::Set | ( | key_type | key, |
mapped_type | value ) |
|
finalvirtual |
Backtracking support: changes the current "level" (always non-negative).
Initially the class starts at level zero. Increasing the level works in O(level diff) and saves the state of the current old level. Decreasing the level restores the state to what it was at this level and all higher levels are forgotten. Everything done at level zero cannot be backtracked over.
This is ok even if level == Level().
Implements operations_research::ReversibleInterface.
|
inline |