From bf5c4e2c4712b83befff7da25147902408146dd7 Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Fri, 22 Dec 2017 00:26:07 -0600 Subject: [PATCH] Add missing optype.hpp file --- src/ox/mc/optype.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/ox/mc/optype.hpp diff --git a/src/ox/mc/optype.hpp b/src/ox/mc/optype.hpp new file mode 100644 index 000000000..7e3b96c6f --- /dev/null +++ b/src/ox/mc/optype.hpp @@ -0,0 +1,27 @@ +/* + * 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 +}; + +template +ox::Error ioOp(T *io, O *obj) { + if (io->opType() == ox::OpType::Read) { + return ioOpRead(io, obj); + } else { + return ioOpWrite(io, obj); + } +} + +}