edits
[iotcloud.git] / version2 / src / C / Transaction.cc
index 526c0ba8dba74862cdf0ba608863eabc8818ebe0..aad62e5b6373cb9ab984367af144a5d6f23ad2f7 100644 (file)
@@ -1,10 +1,20 @@
 #include "Transaction.h"
 
-Transaction::Transaction() {
-       parts = new Hashtable<int32_t, TransactionPart>();
-       keyValueGuardSet = new HashSet<KeyValue>();
-       keyValueUpdateSet = new HashSet<KeyValue>();
-       partsPendingSend = new Vector<int32_t>();
+Transaction::Transaction() :
+       parts(new Hashtable<int32_t, TransactionPart>()),
+       missingParts(NULL),
+       partsPendingSend(new Vector<int32_t>()),
+       fldisComplete(false),
+       hasLastPart(false),
+       keyValueGuardSet(new HashSet<KeyValue>()),
+       keyValueUpdateSet(new HashSet<KeyValue>()),
+       isDead(false),
+       sequenceNumber(-1),
+       clientLocalSequenceNumber(-1),
+       arbitratorId(-1),
+       machineId(-1),
+       transactionId(NULL),
+       hadServerFailure(false) {
 }
 
 void Transaction::addPartEncode(TransactionPart *newPart) {
@@ -17,7 +27,7 @@ void Transaction::addPartEncode(TransactionPart *newPart) {
        clientLocalSequenceNumber = newPart.getClientLocalSequenceNumber();
        machineId = newPart.getMachineId();
 
-       isComplete = true;
+       fldisComplete = true;
 }
 
 void Transaction::addPartDecode(TransactionPart *newPart) {
@@ -49,7 +59,7 @@ void Transaction::addPartDecode(TransactionPart *newPart) {
                }
        }
 
-       if (!isComplete && hasLastPart) {
+       if (!fldisComplete && hasLastPart) {
 
                // We have seen this part so remove it from the set of missing parts
                missingParts.remove(newPart.getPartNumber());
@@ -58,7 +68,7 @@ void Transaction::addPartDecode(TransactionPart *newPart) {
                if (missingParts.size() == 0) {
 
                        // We have all the parts
-                       isComplete = true;
+                       fldisComplete = true;
 
                        // Decode all the parts and create the key value guard and update sets
                        decodeTransactionData();
@@ -96,7 +106,7 @@ Hashtable<int32_t, TransactionPart *> *Transaction::getParts() {
 }
 
 bool Transaction::didSendAPartToServer() {
-       return didSendAPartToServer;
+       return flddidSendAPartToServer;
 }
 
 void Transaction::resetNextPartToSend() {
@@ -139,7 +149,7 @@ void Transaction::removeSentParts(Vector<int32_t> *sentParts) {
        nextPartToSend = 0;
        if (partsPendingSend.removeAll(sentParts))
        {
-               didSendAPartToServer = true;
+               flddidSendAPartToServer = true;
                transactionStatus.setTransactionSequenceNumber(sequenceNumber);
        }
 }
@@ -165,7 +175,7 @@ int64_t Transaction::getArbitrator() {
 }
 
 bool Transaction::isComplete() {
-       return isComplete;
+       return fldisComplete;
 }
 
 Pair<int64_t, int64_t> *Transaction::getId() {