Compiles
[iotcloud.git] / version2 / src / C / Entry.h
index c3cc8a23d2eda3892d17938e42557d0fbcc963b7..acdd04a8a0174d431516ac13866a4ee45ab0e054 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #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.
@@ -43,32 +44,26 @@ class Entry : public Liveness {
        /**
         * Serializes the Entry object into the char buffer.
         */
-  virtual 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.
         */
-  virtual int getSize() = 0;
-
-
-       /**
-        * Returns a char encoding the type of the entry object.
-        */
-  virtual char getType() = 0;
+       virtual int getSize() = 0;
 
 
        /**
         * Returns a copy of the Entry that can be added to a different slot.
         */
-  virtual 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