nodestack: add support functions for check_recency() w/ Promises
authorBrian Norris <banorris@uci.edu>
Sat, 2 Mar 2013 03:06:30 +0000 (19:06 -0800)
committerBrian Norris <banorris@uci.edu>
Sat, 2 Mar 2013 03:06:30 +0000 (19:06 -0800)
nodestack.cc
nodestack.h

index 515a2d313abbee54abbd132057100c89f9f711fc..01273479a69ed90919c3b60765fe8a814d2a584b 100644 (file)
@@ -462,6 +462,24 @@ Promise * Node::get_read_from_promise() const
        return read_from_promises[read_from_promise_idx]->get_reads_from_promise();
 }
 
+/**
+ * Gets a particular 'read-from-promise' form this Node. Only vlaid for a node
+ * where this->action is a 'read'.
+ * @param i The index of the Promise to get
+ * @return The Promise at index i, if the Promise is still available; NULL
+ * otherwise
+ */
+Promise * Node::get_read_from_promise(int i) const
+{
+       return read_from_promises[i]->get_reads_from_promise();
+}
+
+/** @return The size of the read-from-promise set */
+int Node::get_read_from_promise_size() const
+{
+       return read_from_promises.size();
+}
+
 /**
  * Checks whether the read_from_promises set for this node is empty.
  * @return true if the read_from_promises set is empty.
index f478db2841917edd170cd7d0649c5acdbd6a23ef..3cffac9c9b2219905020262302f4c580f9f03784 100644 (file)
@@ -76,6 +76,8 @@ public:
 
        void add_read_from_promise(const ModelAction *reader);
        Promise * get_read_from_promise() const;
+       Promise * get_read_from_promise(int i) const;
+       int get_read_from_promise_size() const;
 
        bool add_future_value(struct future_value fv);
        struct future_value get_future_value() const;