4 * This Entry records the last message sent by a given machine.
5 * @author Brian Demsky <bdemsky@uci.edu>
10 class LastMessage extends Entry {
11 private int64_t machineid;
12 private int64_t seqnum;
14 public LastMessage(Slot slot, int64_t _machineid, int64_t _seqnum) {
20 public int64_t getMachineID() {
24 public int64_t getSequenceNumber() {
28 static Entry decode(Slot slot, ByteBuffer bb) {
29 int64_t machineid=bb->getLong();
30 int64_t seqnum=bb->getLong();
31 return new LastMessage(slot, machineid, seqnum);
34 public void encode(ByteBuffer bb) {
35 bb->put(Entry.TypeLastMessage);
36 bb->putLong(machineid);
40 public int getSize() {
41 return 2*sizeof(int64_t)+sizeof(char);
44 public char getType() {
45 return Entry.TypeLastMessage;
48 public Entry getCopy(Slot s) {
49 return new LastMessage(s, machineid, seqnum);