edits
[iotcloud.git] / version2 / src / C / PendingTransaction.cc
index be7575f7e9aac70bf87ba2f0108408f411b1d0ee..f4532190bca1e43d490cc4717c200f1827c1a98d 100644 (file)
@@ -27,7 +27,7 @@ void PendingTransaction::addKV(KeyValue *newKV) {
        KeyValue *rmKV = NULL;
 
        // Make sure there are no duplicates
-       SetIterator<KeyValue *> *kvit = keyValueUpdateSet->iterator();
+       SetIterator<KeyValue *, KeyValue *> *kvit = keyValueUpdateSet->iterator();
        while (kvit->hasNext()) {
                KeyValue *kv = kvit->next();
                if (kv->getKey()->equals(newKV->getKey())) {
@@ -71,7 +71,7 @@ bool PendingTransaction::checkArbitrator(int64_t arb) {
 }
 
 bool PendingTransaction::evaluateGuard(Hashtable<IoTString *, KeyValue *> *keyValTableCommitted, Hashtable<IoTString *, KeyValue *> *keyValTableSpeculative, Hashtable<IoTString *, KeyValue *> *keyValTablePendingTransSpeculative) {
-       SetIterator<KeyValue *> *kvit = keyValueGuardSet->iterator();
+       SetIterator<KeyValue *, KeyValue *> *kvit = keyValueGuardSet->iterator();
        while (kvit->hasNext()) {
                KeyValue *kvGuard = kvit->next();
                // First check if the key is in the speculative table, this is the
@@ -116,7 +116,7 @@ Transaction *PendingTransaction::createTransaction() {
        Array<char> *charData = convertDataToBytes();
 
        int currentPosition = 0;
-       for(int remaining = charData->length(); remaining > 0;) {
+       for (int remaining = charData->length(); remaining > 0;) {
                bool isLastPart = false;
                // determine how much to copy
                int copySize = TransactionPart_MAX_NON_HEADER_SIZE;
@@ -124,7 +124,7 @@ Transaction *PendingTransaction::createTransaction() {
                        copySize = remaining;
                        isLastPart = true;//last bit of data so last part
                }
-               
+
                // Copy to a smaller version
                Array<char> *partData = new Array<char>(copySize);
                System_arraycopy(charData, currentPosition, partData, 0, copySize);
@@ -139,7 +139,7 @@ Transaction *PendingTransaction::createTransaction() {
        }
 
        // Add the Guard Conditions
-       SetIterator<KeyValue *> *kvit = keyValueGuardSet->iterator();
+       SetIterator<KeyValue *, KeyValue *> *kvit = keyValueGuardSet->iterator();
        while (kvit->hasNext()) {
                KeyValue *kv = kvit->next();
                newTransaction->addGuardKV(kv);
@@ -170,7 +170,7 @@ Array<char> *PendingTransaction::convertDataToBytes() {
        bbEncode->putInt(keyValueUpdateSet->size());
 
        // Encode all the guard conditions
-       SetIterator<KeyValue *> *kvit = keyValueGuardSet->iterator();
+       SetIterator<KeyValue *, KeyValue *> *kvit = keyValueGuardSet->iterator();
        while (kvit->hasNext()) {
                KeyValue *kv = kvit->next();
                kv->encode(bbEncode);