X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=version2%2Fsrc%2FC%2FKeyValue.h;h=f0b0fe2474b430a88bd8d9efbfa60419ee77249a;hb=44e35968685635bb5c8b28e89a0dafcfe5d1645b;hp=2493bb219e6f15aecebd12e03be9ef9f0ba35a96;hpb=f0e5bd79679ee0241e757953260e481dca736068;p=iotcloud.git diff --git a/version2/src/C/KeyValue.h b/version2/src/C/KeyValue.h index 2493bb2..f0b0fe2 100644 --- a/version2/src/C/KeyValue.h +++ b/version2/src/C/KeyValue.h @@ -1,6 +1,7 @@ #ifndef KEYVALUE_H #define KEYVALUE_H #include "common.h" +#include "IoTString.h" /** * KeyValue entry for Slot. @@ -8,7 +9,7 @@ * @version 1.0 */ -class KeyValue { /*extends Entry */ +class KeyValue {/*extends Entry */ private: IoTString *key; IoTString *value; @@ -28,6 +29,12 @@ public: }; KeyValue *KeyValue_decode(ByteBuffer *bb); -unsigned int hashKeyValue(KeyValue *kv); -bool equalsKeyValue(KeyValue *a, KeyValue *b); -#endif + +inline unsigned int hashKeyValue(KeyValue *a) { + return a->getKey()->hashValue(); +} + +inline bool KeyValueEquals(KeyValue *a, KeyValue *b) { + return a->getKey()->equals(b->getKey()); +} +#endif