+void Node::set_promise(uint32_t i) {
+ if (i>=promises.size())
+ promises.resize(i+1,0);
+ promises[i]=1;
+}
+
+bool Node::get_promise(uint32_t i) {
+ return (promises[i]==2);
+}
+
+bool Node::increment_promises() {
+ for (unsigned int i=0;i<promises.size();i++) {
+ if (promises[i]==1) {
+ promises[i]=2;
+ do {
+ i--;
+ if (promises[i]==2)
+ promises[i]=1;
+ } while(i>0);
+ return true;
+ }
+ }
+ return false;
+}
+
+bool Node::promises_empty() {
+ for (unsigned int i=0;i<promises.size();i++)
+ if (promises[i]==1)
+ return false;
+ return true;
+}
+