nodestack: add support functions for check_recency() w/ Promises
[c11tester.git] / nodestack.cc
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.