edits
[iotcloud.git] / version2 / src / C / TableStatus.h
index 9637f7a17efaa7086fe7aafa5aaeeaeb5b6f0a5c..ce2576e97702b42ba9a09c5237fe34b1b3706154 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 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);
-       }
-
-       void encode(ByteBuffer bb) {
-               bb.put(Entry.TypeTableStatus);
-               bb.putInt(maxslots);
-       }
-
-       int getSize() {
-               return sizeof(int32_t)+sizeof(char);
-       }
-
-       char getType() {
-               return Entry.TypeTableStatus;
-       }
-
-       Entry getCopy(Slot s) {
-               return new TableStatus(s, maxslots);
-       }
-}
+class TableStatus : public Entry {
+ private:
+       int 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); }
+       
+       char getType() { return TypeTableStatus; }
+       
+       Entry * getCopy(Slot * s) { return new TableStatus(s, maxslots); }
+};
+
+Entry * TableStatus_decode(Slot * slot, ByteBuffer * bb);
+#endif