From: bdemsky Date: Thu, 18 Jan 2018 21:18:11 +0000 (-0800) Subject: edits X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=47ee5448a5177a43a6567626424c4ca25e2fd554;p=iotcloud.git edits --- diff --git a/version2/src/C/Abort.cc b/version2/src/C/Abort.cc index 619c02d..32dd99e 100644 --- a/version2/src/C/Abort.cc +++ b/version2/src/C/Abort.cc @@ -8,7 +8,7 @@ Abort::Abort(Slot * slot, int64_t _transactionClientLocalSequenceNumber, int64_t transactionMachineId(_transactionMachineId), transactionArbitrator(_transactionArbitrator), arbitratorLocalSequenceNumber(_arbitratorLocalSequenceNumber), - abortId(new Pair(transactionMachineId, transactionClientLocalSequenceNumber)) { + abortId(new Pair(transactionMachineId, transactionClientLocalSequenceNumber)) { } Abort::Abort(Slot * slot, int64_t _transactionClientLocalSequenceNumber, int64_t _transactionSequenceNumber, int64_t _sequenceNumber , int64_t _transactionMachineId, int64_t _transactionArbitrator, int64_t _arbitratorLocalSequenceNumber) : @@ -19,7 +19,7 @@ Abort::Abort(Slot * slot, int64_t _transactionClientLocalSequenceNumber, int64_t transactionMachineId(_transactionMachineId), transactionArbitrator(_transactionArbitrator), arbitratorLocalSequenceNumber(_arbitratorLocalSequenceNumber), - abortId(new Pair(transactionMachineId, transactionClientLocalSequenceNumber)) { + abortId(new Pair(transactionMachineId, transactionClientLocalSequenceNumber)) { } Entry * Abortdecode(Slot * slot, ByteBuffer * bb) { @@ -34,7 +34,7 @@ Entry * Abortdecode(Slot * slot, ByteBuffer * bb) { } void Abort::encode(ByteBuffer * bb) { - bb->put(Entry.TypeAbort); + bb->put(TypeAbort); bb->putLong(transactionClientLocalSequenceNumber); bb->putLong(transactionSequenceNumber); bb->putLong(sequenceNumber); diff --git a/version2/src/C/Abort.h b/version2/src/C/Abort.h index 4b15cd3..d03d845 100644 --- a/version2/src/C/Abort.h +++ b/version2/src/C/Abort.h @@ -29,7 +29,7 @@ class Abort : public Entry { void setSequenceNumber(int64_t _sequenceNumber) { sequenceNumber = _sequenceNumber; } int64_t getTransactionArbitrator() { return transactionArbitrator; } - void encode(ByteBuffer bb); + void encode(ByteBuffer * bb); int getSize() { return (6 * sizeof(uint64_t)) + sizeof(char); } char getType() { return TypeAbort; } Entry * getCopy(Slot * s) { return new Abort(s, transactionClientLocalSequenceNumber, transactionSequenceNumber, sequenceNumber, transactionMachineId, transactionArbitrator, arbitratorLocalSequenceNumber); } diff --git a/version2/src/C/Entry.h b/version2/src/C/Entry.h index c474d42..c3cc8a2 100644 --- a/version2/src/C/Entry.h +++ b/version2/src/C/Entry.h @@ -43,26 +43,26 @@ class Entry : public Liveness { /** * Serializes the Entry object into the char buffer. */ - void encode(ByteBuffer bb) = 0; + virtual void encode(ByteBuffer * bb) = 0; /** * Returns the size in chars the entry object will take in the char * array. */ - int getSize() = 0; + virtual int getSize() = 0; /** * Returns a char encoding the type of the entry object. */ - char getType() = 0; + virtual char getType() = 0; /** * Returns a copy of the Entry that can be added to a different slot. */ - Entry * getCopy(Slot * s) = 0; + virtual Entry * getCopy(Slot * s) = 0; }; /** diff --git a/version2/src/C/Pair.h b/version2/src/C/Pair.h index 4e719c4..127f9f8 100644 --- a/version2/src/C/Pair.h +++ b/version2/src/C/Pair.h @@ -3,10 +3,11 @@ template class Pair { -private: + private: A a; B b; - + + public: Pair(A _a, B _b) : a(_a), b(_b) {