*/
#include "Liveness.h"
+#include "common.h"
#define TypeCommitPart 1
#define TypeAbort 2
#define TypeLastMessage 5
#define TypeRejectedMessage 6
#define TypeTableStatus 7
+#define TypeSlot 8
class Entry : public Liveness {
/* Records whether the information is still live or has been
- superceded by a newer update. */
- private:
+ superceded by a newer update. */
+private:
bool islive;
+protected:
+ Slot *parentslot;
- protected:
- Slot * parentslot;
-
- public:
- Entry(Slot * _parentslot) : islive(true), parentslot(_parentslot) {}
+public:
+ Entry(Slot *_parentslot) : islive(true), parentslot(_parentslot) {}
/**
* Returns true if the Entry object is still live.
/**
* 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;
-
-
- /**
- * Returns a char encoding the type of the entry object.
- */
- char getType() = 0;
+ virtual int getSize() = 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;
+ friend Entry *Entry_decode(Slot *slot, ByteBuffer *bb);
};
/**
* Static method for decoding char array into Entry objects. First
* char tells the type of entry.
*/
-Entry * Entry_decode(Slot * slot, ByteBuffer * bb);
+Entry *Entry_decode(Slot *slot, ByteBuffer *bb);
#endif