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