* @version 1.0
*/
-
class LastMessage : public Entry {
private:
int64_t machineid;
machineid(_machineid),
seqnum(_seqnum) {
}
-
int64_t getMachineID() { return machineid; }
int64_t getSequenceNumber() { return seqnum; }
void encode(ByteBuffer *bb);
#include "ByteBuffer.h"
#include "IoTString.h"
+NewKey::NewKey(Slot *slot, IoTString *_key, int64_t _machineid) :
+ Entry(slot),
+ key(new IoTString(_key)),
+ machineid(_machineid) {
+}
+
+NewKey::~NewKey() {
+ delete key;
+}
+
Entry *decode(Slot *slot, ByteBuffer *bb) {
int keylength = bb->getInt();
Array<char> *key = new Array<char>(keylength);
return new NewKey(slot, IoTString_shallow(key), machineid);
}
+Entry *NewKey::getCopy(Slot *s) { return new NewKey(s, new IoTString(key), machineid); }
+
void NewKey::encode(ByteBuffer *bb) {
bb->put(TypeNewKey);
bb->putInt(key->length());
* @version 1.0
*/
-
class NewKey : public Entry {
private:
IoTString *key;
int64_t machineid;
-
public:
- NewKey(Slot *slot, IoTString *_key, int64_t _machineid) :
- Entry(slot),
- key(_key),
- machineid(_machineid) {
- }
-
+ NewKey(Slot *slot, IoTString *_key, int64_t _machineid);
+ ~NewKey();
int64_t getMachineID() { return machineid; }
IoTString *getKey() { return key; }
void setSlot(Slot *s) { parentslot = s; }
-
-
void encode(ByteBuffer *bb);
int getSize();
char getType() { return TypeNewKey; }
-
- Entry *getCopy(Slot *s) { return new NewKey(s, key, machineid); }
+ Entry *getCopy(Slot *s);
};
Entry *NewKey_decode(Slot *slot, ByteBuffer *bb);
-
#endif