edits
[iotcloud.git] / version2 / src / C / NewKey.h
1 #ifndef NEWKEY_H
2 #define NEWKEY_H
3 #include "common.h"
4 #include "Entry.h"
5
6 /**
7  * This Entry records the abort sent by a given machine.
8  * @author Ali Younis <ayounis@uci.edu>
9  * @version 1.0
10  */
11
12
13 class NewKey : public Entry {
14 private:
15         IoTString *key;
16         int64_t machineid;
17
18
19 public:
20         NewKey(Slot *slot, IoTString *_key, int64_t _machineid) :
21                 Entry(slot),
22                 key(_key),
23                 machineid(_machineid) {
24         }
25
26         int64_t getMachineID() { return machineid; }
27         IoTString *getKey() { return key; }
28         void setSlot(Slot *s) { parentslot = s; }
29
30
31         void encode(ByteBuffer *bb);
32         int getSize();
33         char getType() { return TypeNewKey; }
34
35         Entry *getCopy(Slot *s) { return new NewKey(s, key, machineid); }
36 };
37
38 Entry *NewKey_decode(Slot *slot, ByteBuffer *bb);
39
40 #endif