Adding files to initialize, update, and read key-value (to be used together with...
[iotcloud.git] / version2 / src / C / Transaction.h
index f635a7a2821f70852e2896064e92d2d22a0d16c7..a9973829d452c8beb70fe1b906b8ea8874ab8c57 100644 (file)
@@ -2,6 +2,7 @@
 #define TRANSACTION_H
 #include "common.h"
 #include "Pair.h"
+#include "IoTString.h"
 
 class Transaction {
 private:
@@ -19,7 +20,7 @@ private:
        int64_t arbitratorId;
        int64_t machineId;
        Pair<int64_t, int64_t> transactionId;
-       int nextPartToSend;
+       uint32_t nextPartToSend;
        bool flddidSendAPartToServer;
        TransactionStatus *transactionStatus;
        bool hadServerFailure;
@@ -27,6 +28,7 @@ private:
 
 public:
        Transaction();
+       ~Transaction();
        void addPartEncode(TransactionPart *newPart);
        void addPartDecode(TransactionPart *newPart);
        void addUpdateKV(KeyValue *kv);
@@ -50,9 +52,8 @@ public:
        int64_t getMachineId();
        int64_t getArbitrator();
        bool isComplete();
-       Pair<int64_t, int64_t> getId();
+       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