Adding benchmark file for encrypted cloud storage.
[iotcloud.git] / version2 / src / C / PendingTransaction.h
index e919ca80f3aa3977baf6facd07a230bedb5c3e9f..96f6f949bddc570defef7243c4f859f54a9d6c9d 100644 (file)
@@ -5,25 +5,26 @@
 
 class PendingTransaction {
 private:
-       Hashset<KeyValue *> *keyValueUpdateSet = NULL;
-       Hashset<KeyValue *> *keyValueGuardSet = NULL;
-       int64_t arbitrator = -1;
-       int64_t clientLocalSequenceNumber = -1;
-       int64_t machineId = -1;
-       int32_T currentDataSize = 0;
+       Hashset<KeyValue *> *keyValueUpdateSet;
+       Hashset<KeyValue *> *keyValueGuardSet;
+       int64_t arbitrator;
+       int64_t clientLocalSequenceNumber;
+       int64_t machineId;
+       int32_t currentDataSize;
 
 public:
        PendingTransaction(int64_t _machineId);
+       ~PendingTransaction();
        /**
         * Add a new key value to the updates
         *
         */
-       void addKV(KeyValue newKV);
+       void addKV(KeyValue *newKV);
        /**
         * Add a new key value to the guard set
         *
         */
-       void addKVGuard(KeyValue newKV);
+       void addKVGuard(KeyValue *newKV);
        /**
         * Checks if the arbitrator is the same
         */
@@ -31,7 +32,7 @@ public:
        /**
         * Get the transaction arbitrator
         */
-       int64_t getArbitrator();
+       int64_t getArbitrator() {return arbitrator;}
        /**
         * Get the key value update set
         */
@@ -40,7 +41,7 @@ public:
        /**
         * Get the key value update set
         */
-       public Hashset<KeyValue *> *getKVGuard() { return keyValueGuardSet; }
+       Hashset<KeyValue *> *getKVGuard() { return keyValueGuardSet; }
 
        void setClientLocalSequenceNumber(int64_t _clientLocalSequenceNumber) { clientLocalSequenceNumber = _clientLocalSequenceNumber; }
 
@@ -48,7 +49,7 @@ public:
 
        int64_t getMachineId() { return machineId; }
 
-       bool evaluateGuard(Hashtable<IoTString *, KeyValue *> keyValTableCommitted, Hashtable<IoTString *, KeyValue *> keyValTableSpeculative, Hashtable<IoTString *, KeyValue *> keyValTablePendingTransSpeculative);
+       bool evaluateGuard(Hashtable<IoTString *, KeyValue *> *keyValTableCommitted, Hashtable<IoTString *, KeyValue *> *keyValTableSpeculative, Hashtable<IoTString *, KeyValue *> *keyValTablePendingTransSpeculative);
 
        Transaction *createTransaction();