edits
[iotcloud.git] / version2 / src / C / Transaction.h
index aa62661ecfbcb07ac11ca679d78529de63f8c0dd..08eebea1b656f80bf9ec3108935d461e78168779 100644 (file)
@@ -1,26 +1,29 @@
 #ifndef TRANSACTION_H
 #define TRANSACTION_H
 #include "common.h"
+#include "Pair.h"
+#include "IoTString.h"
 
 class Transaction {
 private:
-       Hashtable<int32_t, TransactionPart *> *parts = NULL;
-       Hashset<int32_t> *missingParts = NULL;
-       Vector<int32_t> *partsPendingSend = NULL;
-       bool isComplete = false;
-       bool hasLastPart = false;
-       Hashset<KeyValue *> *keyValueGuardSet = NULL;
-       Hashset<KeyValue *> *keyValueUpdateSet = NULL;
-       bool isDead = false;
-       int64_t sequenceNumber = -1;
-       int64_t clientLocalSequenceNumber = -1;
-       int64_t arbitratorId = -1;
-       int64_t machineId = -1;
-       Pair<uint64_t, uint64_t> *transactionId = NULL;
-       int nextPartToSend = 0;
-       bool didSendAPartToServer = false;
-       TransactionStatus *transactionStatus = NULL;
-       bool hadServerFailure = false;
+       Vector<TransactionPart *> *parts;
+       uint partCount;
+       Hashset<int32_t> *missingParts;
+       Vector<int32_t> *partsPendingSend;
+       bool fldisComplete;
+       bool hasLastPart;
+       Hashset<KeyValue *> *keyValueGuardSet;
+       Hashset<KeyValue *> *keyValueUpdateSet;
+       bool isDead;
+       int64_t sequenceNumber;
+       int64_t clientLocalSequenceNumber;
+       int64_t arbitratorId;
+       int64_t machineId;
+       Pair<int64_t, int64_t> transactionId;
+       uint32_t nextPartToSend;
+       bool flddidSendAPartToServer;
+       TransactionStatus *transactionStatus;
+       bool hadServerFailure;
        void decodeTransactionData();
 
 public:
@@ -32,7 +35,7 @@ public:
        int64_t getSequenceNumber();
        void setSequenceNumber(int64_t _sequenceNumber);
        int64_t getClientLocalSequenceNumber();
-       Hashtable<int32_t, TransactionPart *> *getParts();
+       Vector<TransactionPart *> *getParts();
        bool didSendAPartToServer();
        void resetNextPartToSend();
        TransactionPart *getNextPartToSend();
@@ -51,6 +54,6 @@ public:
        Pair<int64_t, int64_t> *getId();
        void setDead();
        TransactionPart *getPart(int32_t index);
-       bool evaluateGuard(Hashtable<IoTString *, KeyValue *> *committedKeyValueTable, Hashtable<IoTString *, KeyValue *> *speculatedKeyValueTable, Hashtable<IoTString *, KeyValue *> *pendingTransactionSpeculatedKeyValueTable);
+       bool evaluateGuard(Hashtable<IoTString *, KeyValue *, uintptr_t, 0, hashString, StringEquals> *committedKeyValueTable, Hashtable<IoTString *, KeyValue *, uintptr_t, 0, hashString, StringEquals> *speculatedKeyValueTable, Hashtable<IoTString *, KeyValue *, uintptr_t, 0, hashString, StringEquals> *pendingTransactionSpeculatedKeyValueTable);
 };
 #endif