Generating IV from random numbers, not machine ID and local sequence number.
[iotcloud.git] / version2 / src / C / KeyValue.h
index 2493bb219e6f15aecebd12e03be9ef9f0ba35a96..f0b0fe2474b430a88bd8d9efbfa60419ee77249a 100644 (file)
@@ -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