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
22 class Entry : public Liveness {
23 /* Records whether the information is still live or has been
24 superceded by a newer update. */
31 Entry(Slot *_parentslot) : islive(true), parentslot(_parentslot) {}
34 * Returns true if the Entry object is still live.
36 bool isLive() { return islive; }
39 * Flags the entry object as dead. Also decrements the live count
45 * Serializes the Entry object into the char buffer.
47 virtual void encode(ByteBuffer *bb) = 0;
50 * Returns the size in chars the entry object will take in the char
53 virtual int getSize() = 0;
57 * Returns a copy of the Entry that can be added to a different slot.
59 virtual Entry *getCopy(Slot *s) = 0;
60 friend Entry *Entry_decode(Slot *slot, ByteBuffer *bb);
64 * Static method for decoding char array into Entry objects. First
65 * char tells the type of entry.
67 Entry *Entry_decode(Slot *slot, ByteBuffer *bb);