edits
[iotcloud.git] / version2 / src / C / KeyValue.h
1 #ifndef KEYVALUE_H
2 #define KEYVALUE_H
3 #include "common.h"
4
5 /**
6  * KeyValue entry for Slot.
7  * @author Brian Demsky <bdemsky@uci.edu>
8  * @version 1.0
9  */
10
11 class KeyValue { /*extends Entry */
12 private:
13         IoTString *key;
14         IoTString *value;
15
16 public:
17         KeyValue(IoTString *_key, IoTString *_value) :
18                 key(_key),
19                 value(_value) {
20         }
21         ~KeyValue();
22
23         IoTString *getKey() { return key; }
24         IoTString *getValue() { return value; }
25         void encode(ByteBuffer *bb);
26         int32_t getSize();
27         KeyValue *getCopy();
28 };
29
30 KeyValue *KeyValue_decode(ByteBuffer *bb);
31 unsigned int hashKeyValue(KeyValue *kv);
32 bool equalsKeyValue(KeyValue *a, KeyValue *b);
33 #endif