+#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