Bug fixes + tabbing
[iotcloud.git] / version2 / src / C / ArbitrationRound.cc
index 3ddf5cb49852141d216a3f6783cf70dfdabd3e4a..f5a1521722e444bbeff3e2d841a23dfce3e6a8c5 100644 (file)
@@ -22,10 +22,34 @@ ArbitrationRound::~ArbitrationRound() {
        delete parts;
 }
 
        delete parts;
 }
 
+void ArbitrationRound::generateParts() {
+       if (didGenerateParts) {
+               return;
+       }
+       parts = new Vector<Entry *>();
+       SetIterator<Abort *, Abort *> *abit = abortsBefore->iterator();
+       while (abit->hasNext())
+               parts->add((Entry *)abit->next());
+       delete abit;
+       if (commit != NULL) {
+               Vector<CommitPart *> *cParts = commit->getParts();
+               uint cPartsSize = cParts->size();
+               for (uint i = 0; i < cPartsSize; i++) {
+                       parts->add((Entry *)cParts->get(i));
+               }
+       }
+}
+
 Vector<Entry *> *ArbitrationRound::getParts() {
        return parts;
 }
 
 Vector<Entry *> *ArbitrationRound::getParts() {
        return parts;
 }
 
+void ArbitrationRound::removeParts(Vector<Entry *> *removeParts) {
+       parts->removeAll(removeParts);
+       didSendPart = true;
+}
+
+
 bool ArbitrationRound::isDoneSending() {
        if ((commit == NULL) && abortsBefore->isEmpty()) {
                return true;
 bool ArbitrationRound::isDoneSending() {
        if ((commit == NULL) && abortsBefore->isEmpty()) {
                return true;