- Add History::clear() to empty an existing history (equivalent
to removing all of its resources and all of its processes, but faster) git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@887 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
0933d63344
commit
0b4db098eb
|
@ -290,6 +290,17 @@ ConcreteHistory::remove(SubRequest& subrequest)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
ConcreteHistory::clear()
|
||||
{
|
||||
for_each(_snapshots.begin(), _snapshots.end(),
|
||||
deletor<ConcreteEnvironment>());
|
||||
_snapshots.clear();
|
||||
_snapshots.push_back(new ConcreteEnvironment());
|
||||
assert(_snapshots.size() == 1);
|
||||
}
|
||||
|
||||
|
||||
ConcreteHistory::ResourcePair
|
||||
ConcreteHistory::add_resource(const Glib::ustring& name,
|
||||
bool preemptable,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue