summaryrefslogtreecommitdiffstats
path: root/include/framework/interface/Record.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/framework/interface/Record.h')
-rw-r--r--include/framework/interface/Record.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/framework/interface/Record.h b/include/framework/interface/Record.h
index d380f9b..19ccadd 100644
--- a/include/framework/interface/Record.h
+++ b/include/framework/interface/Record.h
@@ -132,6 +132,23 @@ struct Record {
}
};
+template<typename V>
+struct Record<const char*, V> {
+ const char* key;
+ V value;
+ size_t len;
+
+ inline bool operator<(const Record& other) const {
+ size_t n = std::min(len, other.len) + 1;
+ return strncmp(key, other.key, n) < 0;
+ }
+
+ inline bool operator==(const Record& other) const {
+ size_t n = std::min(len, other.len) + 1;
+ return strncmp(key, other.key, n) == 0;
+ }
+};
+
template <typename K, typename V, typename W>
struct WeightedRecord {
K key;