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