edits
[iotcloud.git] / version2 / src / C / TransactionStatus.h
index d153743..b3c696d 100644 (file)
@@ -1,50 +1,37 @@
+#ifndef TRANSACTIONSTATUS_H
+#define TRANSACTIONSTATUS_H
 
-class TransactionStatus {
-       static final char StatusAborted = 1;
-       static final char StatusPending = 2;
-       static final char StatusCommitted = 3;
-       // static final char StatusRetrying = 4;
-       static final char StatusSentPartial = 5;
-       static final char StatusSentFully = 6;
-       static final char StatusNoEffect = 10;
-
-       private char status = 0;
-       private bool applicationReleased = false;
-       private bool wasSentInChain = false;
-       private int64_t transactionSequenceNumber = 0;
-       private int64_t arbitrator = -1;
-
-
-       public TransactionStatus(char _status, int64_t _arbitrator) {
-               status = _status;
-               arbitrator = _arbitrator;
-       }
-
-       public char getStatus() {
-               return status;
-       }
-
-       public void setStatus(char _status) {
-               status = _status;
-       }
+#define TransactionStatus_StatusAborted 1
+#define TransactionStatus_StatusPending 2
+#define TransactionStatus_StatusCommitted 3
+#define TransactionStatus_StatusRetrying 4
+#define TransactionStatus_StatusSentPartial 5
+#define TransactionStatus_StatusSentFully 6
+#define TransactionStatus_StatusNoEffect 10
 
-       public int64_t getTransactionSequenceNumber() {
-               return transactionSequenceNumber;
-       }
-
-       public void setTransactionSequenceNumber(int64_t _transactionSequenceNumber) {
-               transactionSequenceNumber = _transactionSequenceNumber;
-       }
-
-       public int64_t getTransactionArbitrator() {
-               return arbitrator;
-       }
-
-       public void release() {
-               applicationReleased = true;
-       }
-
-       public bool getReleased() {
-               return applicationReleased;
-       }
-}
+class TransactionStatus {
+ private:
+       char status;
+       bool applicationReleased;
+       bool wasSentInChain;
+       int64_t transactionSequenceNumber;
+       int64_t arbitrator;
+       
+ public:
+ TransactionStatus(char _status, int64_t _arbitrator) :
+       status(_status),
+               applicationReleased(false),
+               wasSentInChain(false),
+               transactionSequenceNumber(0),
+               arbitrator(_arbitrator) {
+               }
+       
+       char getStatus() { return status; }
+       void setStatus(char _status) { status = _status; }
+       int64_t getTransactionSequenceNumber() { return transactionSequenceNumber; }
+       void setTransactionSequenceNumber(int64_t _transactionSequenceNumber) { transactionSequenceNumber = _transactionSequenceNumber; }
+       int64_t getTransactionArbitrator() { return arbitrator; }
+       void release() { applicationReleased = true;}
+       bool getReleased() { return applicationReleased;}
+};
+#endif