edits
[iotcloud.git] / version2 / src / C / TableStatus.h
index 9637f7a17efaa7086fe7aafa5aaeeaeb5b6f0a5c..e7978c08bc477f143460a59791381b94e9fe9dde 100644 (file)
@@ -1,3 +1,7 @@
+#ifndef TABLESTATUS_H
+#define TABLESTATUS_H
+#include "common.h"
+#include "Entry.h"
 
 /**
  * TableStatus entries record the current size of the data structure
  * @version 1.0
  */
 
+class TableStatus : public Entry {
+private:
+       int maxslots;
 
-class TableStatus extends Entry {
-       private int maxslots;
-
-       TableStatus(Slot slot, int _maxslots) {
-               super(slot);
-               maxslots=_maxslots;
-       }
-
-       int getMaxSlots() {
-               return maxslots;
-       }
-
-       static Entry decode(Slot slot, ByteBuffer bb) {
-               int maxslots=bb.getInt();
-               return new TableStatus(slot, maxslots);
+public:
+       TableStatus(Slot *slot, int _maxslots) : Entry(slot),
+               maxslots(_maxslots) {
        }
+       int getMaxSlots() { return maxslots; }
+       void encode(ByteBuffer *bb);
+       int getSize() { return sizeof(int32_t) + sizeof(char); }
 
-       void encode(ByteBuffer bb) {
-               bb.put(Entry.TypeTableStatus);
-               bb.putInt(maxslots);
-       }
+       char getType() { return TypeTableStatus; }
 
-       int getSize() {
-               return sizeof(int32_t)+sizeof(char);
-       }
+       Entry *getCopy(Slot *s) { return new TableStatus(s, maxslots); }
+};
 
-       char getType() {
-               return Entry.TypeTableStatus;
-       }
-
-       Entry getCopy(Slot s) {
-               return new TableStatus(s, maxslots);
-       }
-}
+Entry *TableStatus_decode(Slot *slot, ByteBuffer *bb);
+#endif