edits
[iotcloud.git] / version2 / src / C / TransactionPart.cc
index 7931ae9..6e0528f 100644 (file)
@@ -12,8 +12,8 @@ class TransactionPart extends Entry {
     int partNumber = -1; // Parts position in the
     Boolean isLastPart = false;
 
-    Pair<Long, Long> transactionId = NULL;
-    Pair<Long, Integer> partId = NULL;
+    Pair<int64_t, int64_t> transactionId = NULL;
+    Pair<int64_t int32_t> partId = NULL;
 
     char[] data = NULL;
 
@@ -26,8 +26,8 @@ class TransactionPart extends Entry {
         data = _data;
         isLastPart = _isLastPart;
 
-        transactionId = new Pair<Long, Long>(machineId, clientLocalSequenceNumber);
-        partId = new Pair<Long, Integer>(clientLocalSequenceNumber, partNumber);
+        transactionId = new Pair<int64_t, int64_t>(machineId, clientLocalSequenceNumber);
+        partId = new Pair<int64_t int32_t>(clientLocalSequenceNumber, partNumber);
 
     }
 
@@ -42,7 +42,7 @@ class TransactionPart extends Entry {
         parentslot = s;
     }
 
-    Pair<Long, Long> getTransactionId() {
+    Pair<int64_t, int64_t> getTransactionId() {
         return transactionId;
     }
 
@@ -50,7 +50,7 @@ class TransactionPart extends Entry {
         return arbitratorId;
     }
 
-    Pair<Long, Integer> getPartId() {
+    Pair<int64_t int32_t> getPartId() {
         return partId;
     }
 
@@ -88,16 +88,16 @@ class TransactionPart extends Entry {
     }
 
     static Entry decode(Slot s, ByteBuffer bb) {
-        int64_t sequenceNumber = bb.getLong();
-        int64_t machineId = bb.getLong();
-        int64_t arbitratorId = bb.getLong();
-        int64_t clientLocalSequenceNumber = bb.getLong();
-        int partNumber = bb.getInt();
-        int dataSize = bb.getInt();
-        Boolean isLastPart = (bb.get() == 1);
+        int64_t sequenceNumber = bb->getLong();
+        int64_t machineId = bb->getLong();
+        int64_t arbitratorId = bb->getLong();
+        int64_t clientLocalSequenceNumber = bb->getLong();
+        int partNumber = bb->getInt();
+        int dataSize = bb->getInt();
+        Boolean isLastPart = (bb->get() == 1);
         // Get the data
         char[] data = new char[dataSize];
-        bb.get(data);
+        bb->get(data);
 
         TransactionPart returnTransactionPart = new TransactionPart(s, machineId, arbitratorId, clientLocalSequenceNumber, partNumber, data, isLastPart);
         returnTransactionPart.setSequenceNumber(sequenceNumber);
@@ -106,21 +106,21 @@ class TransactionPart extends Entry {
     }
 
     void encode(ByteBuffer bb) {
-        bb.put(Entry.TypeTransactionPart);
-        bb.putLong(sequenceNumber);
-        bb.putLong(machineId);
-        bb.putLong(arbitratorId);
-        bb.putLong(clientLocalSequenceNumber);
-        bb.putInt(partNumber);
-        bb.putInt(data.length);
+        bb->put(Entry.TypeTransactionPart);
+        bb->putLong(sequenceNumber);
+        bb->putLong(machineId);
+        bb->putLong(arbitratorId);
+        bb->putLong(clientLocalSequenceNumber);
+        bb->putInt(partNumber);
+        bb->putInt(data.length);
 
         if (isLastPart) {
-            bb.put((char)1);
+            bb->put((char)1);
         } else {
-            bb.put((char)0);
+            bb->put((char)0);
         }
 
-        bb.put(data);
+        bb->put(data);
     }
 
     char getType() {