From 92548464d3f8d3542c43e64c45072fd6d764e908 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 18 Sep 2017 20:51:53 -0700 Subject: [PATCH] ircd::db: Enumerate all deltas. --- include/ircd/db/cell.h | 5 +++++ include/ircd/db/column.h | 5 +++++ include/ircd/db/delta.h | 5 +++++ include/ircd/db/row.h | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/include/ircd/db/cell.h b/include/ircd/db/cell.h index d823d3ec1..713d63bb1 100644 --- a/include/ircd/db/cell.h +++ b/include/ircd/db/cell.h @@ -132,6 +132,11 @@ namespace ircd::db struct ircd::db::cell::delta :std::tuple { + enum + { + OP, CELL, VAL, + }; + delta(cell &c, const string_view &val, const enum op &op = op::SET) :std::tuple{op, &c, val} {} diff --git a/include/ircd/db/column.h b/include/ircd/db/column.h index 26ab12e7b..4a9185a99 100644 --- a/include/ircd/db/column.h +++ b/include/ircd/db/column.h @@ -157,6 +157,11 @@ struct ircd::db::column struct ircd::db::column::delta :std::tuple { + enum + { + OP, KEY, VAL, + }; + delta(const string_view &key, const string_view &val, const enum op &op = op::SET) :std::tuple{op, key, val} {} diff --git a/include/ircd/db/delta.h b/include/ircd/db/delta.h index 9fdf52b7b..4ecedb6af 100644 --- a/include/ircd/db/delta.h +++ b/include/ircd/db/delta.h @@ -53,6 +53,11 @@ namespace ircd::db struct ircd::db::delta :std::tuple { + enum + { + OP, COL, KEY, VAL, + }; + delta(const string_view &col, const string_view &key, const string_view &val = {}, const enum op &op = op::SET) :std::tuple{op, col, key, val} {} diff --git a/include/ircd/db/row.h b/include/ircd/db/row.h index 739d09f89..d50140fbb 100644 --- a/include/ircd/db/row.h +++ b/include/ircd/db/row.h @@ -112,6 +112,11 @@ namespace ircd::db struct ircd::db::row::delta :std::tuple { + enum + { + OP, ROW + }; + delta(row &r, const enum op &op = op::SET) :std::tuple{op, &r} {}