4 * Generic class that wraps all the different types of information
5 * that can be stored in a Slot.
6 * @author Brian Demsky <bdemsky@uci.edu>
13 #define TypeCommitPart 1
15 #define TypeTransactionPart 3
17 #define TypeLastMessage 5
18 #define TypeRejectedMessage 6
19 #define TypeTableStatus 7
21 class Entry : public Liveness {
22 /* Records whether the information is still live or has been
23 superceded by a newer update. */
30 Entry(Slot *_parentslot) : islive(true), parentslot(_parentslot) {}
33 * Returns true if the Entry object is still live.
35 bool isLive() { return islive; }
38 * Flags the entry object as dead. Also decrements the live count
44 * Serializes the Entry object into the char buffer.
46 virtual void encode(ByteBuffer *bb) = 0;
49 * Returns the size in chars the entry object will take in the char
52 virtual int getSize() = 0;
56 * Returns a char encoding the type of the entry object.
58 virtual char getType() = 0;
62 * Returns a copy of the Entry that can be added to a different slot.
64 virtual Entry *getCopy(Slot *s) = 0;
65 friend Entry *Entry_decode(Slot *slot, ByteBuffer *bb);
69 * Static method for decoding char array into Entry objects. First
70 * char tells the type of entry.
72 Entry *Entry_decode(Slot *slot, ByteBuffer *bb);