From cd3c3b85485b68891c2024b50c08443736aa7268 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Fri, 20 Apr 2012 10:35:16 -0700 Subject: [PATCH] model: add iteration routines for class Backtrack --- model.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/model.h b/model.h index 54144f3..db13601 100644 --- a/model.h +++ b/model.h @@ -49,15 +49,19 @@ public: Backtrack(ModelAction *d, action_list_t *t) { diverge = d; actionTrace = t; - //currentIterator = actionTrace->getFirst(); + iter = actionTrace->begin(); } ModelAction *get_diverge() { return diverge; } action_list_t *get_trace() { return actionTrace; } + void advance_state() { iter++; } + ModelAction *get_state() { + return iter == actionTrace->end() ? NULL : *iter; + } private: ModelAction *diverge; - /* unused for now; will be used when re-exploring this path? */ - //MyListElement *currentIterator; action_list_t *actionTrace; + /* points to position in actionTrace as we replay */ + action_list_t::iterator iter; }; class ModelChecker { -- 2.34.1