diff --git a/src/backend/concrete_history.cc b/src/backend/concrete_history.cc index 90f52cd..fb2a379 100644 --- a/src/backend/concrete_history.cc +++ b/src/backend/concrete_history.cc @@ -290,6 +290,17 @@ ConcreteHistory::remove(SubRequest& subrequest) } +void +ConcreteHistory::clear() +{ + for_each(_snapshots.begin(), _snapshots.end(), + deletor()); + _snapshots.clear(); + _snapshots.push_back(new ConcreteEnvironment()); + assert(_snapshots.size() == 1); +} + + ConcreteHistory::ResourcePair ConcreteHistory::add_resource(const Glib::ustring& name, bool preemptable, diff --git a/src/backend/concrete_history.hh b/src/backend/concrete_history.hh index fbda2e2..479929d 100644 --- a/src/backend/concrete_history.hh +++ b/src/backend/concrete_history.hh @@ -60,6 +60,7 @@ namespace sgpem virtual void remove(Request& request); virtual void remove(SubRequest& subrequest); + virtual void clear(); virtual ResourcePair add_resource(const Glib::ustring& name, bool preemptable = false, diff --git a/src/backend/history.hh b/src/backend/history.hh index 41e2665..a556cf6 100644 --- a/src/backend/history.hh +++ b/src/backend/history.hh @@ -77,6 +77,8 @@ namespace sgpem virtual void remove(Request& request) = 0; virtual void remove(SubRequest& subrequest) = 0; + // \brief Clears the whole history + virtual void clear() = 0; virtual ResourcePair add_resource(const Glib::ustring& name, bool preemptable = false,