From 70896b8761b758d13d1a48bc4aaa38681389c51a Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sun, 15 Oct 2017 00:55:25 -0500 Subject: [PATCH] Add OpType for Metal Claw operators --- deps/ox/src/ox/mc/optype.hpp | 18 ++++++++++++++++++ deps/ox/src/ox/mc/read.hpp | 5 +++++ deps/ox/src/ox/mc/write.hpp | 5 +++++ 3 files changed, 28 insertions(+) create mode 100644 deps/ox/src/ox/mc/optype.hpp diff --git a/deps/ox/src/ox/mc/optype.hpp b/deps/ox/src/ox/mc/optype.hpp new file mode 100644 index 00000000..1cd88743 --- /dev/null +++ b/deps/ox/src/ox/mc/optype.hpp @@ -0,0 +1,18 @@ +/* + * Copyright 2015 - 2017 gtalent2@gmail.com + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#pragma once + +namespace ox { + +enum class OpType { + Read = 0, + Write = 1 +}; + +} diff --git a/deps/ox/src/ox/mc/read.hpp b/deps/ox/src/ox/mc/read.hpp index 11b39287..ca521d32 100644 --- a/deps/ox/src/ox/mc/read.hpp +++ b/deps/ox/src/ox/mc/read.hpp @@ -11,6 +11,7 @@ #include #include #include "err.hpp" +#include "optype.hpp" #include "presencemask.hpp" namespace ox { @@ -49,6 +50,10 @@ class MetalClawReader { void setFields(int fields); + OpType opType() { + return OpType::Read; + } + private: template int readInteger(I *val); diff --git a/deps/ox/src/ox/mc/write.hpp b/deps/ox/src/ox/mc/write.hpp index 8380b3c7..8aebf220 100644 --- a/deps/ox/src/ox/mc/write.hpp +++ b/deps/ox/src/ox/mc/write.hpp @@ -11,6 +11,7 @@ #include #include #include "err.hpp" +#include "optype.hpp" #include "presencemask.hpp" namespace ox { @@ -49,6 +50,10 @@ class MetalClawWriter { void setFields(int fields); + OpType opType() { + return OpType::Write; + } + private: template int appendInteger(I val);