31 class object_database;
35 std::unordered_map<object_id_type, std::unique_ptr<object> >
old_values;
37 std::unordered_set<object_id_type>
new_ids;
38 std::unordered_map<object_id_type, std::unique_ptr<object> >
removed;
56 :_db(mv._db),_apply_undo(mv._apply_undo)
58 mv._apply_undo =
false;
61 void commit() { _apply_undo =
false; _db.commit(); }
62 void undo() {
if( _apply_undo ) _db.undo(); _apply_undo =
false; }
63 void merge() {
if( _apply_undo ) _db.merge(); _apply_undo =
false; }
67 if(
this == &mv )
return *
this;
68 if( _apply_undo ) _db.undo();
69 _apply_undo = mv._apply_undo;
70 mv._apply_undo =
false;
78 : _db(db),_disable_on_exit(disable_on_exit) {}
81 bool _apply_undo =
true;
82 bool _disable_on_exit =
false;
87 bool enabled()
const {
return !_disabled; }
120 std::size_t
size()
const {
return _stack.size(); }
132 uint32_t _active_sessions = 0;
133 bool _disabled =
true;
134 std::deque<undo_state> _stack;
136 size_t _max_size = 256;