Add missing optype.hpp file
This commit is contained in:
@@ -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<typename T, typename O>
|
||||||
|
ox::Error ioOp(T *io, O *obj) {
|
||||||
|
if (io->opType() == ox::OpType::Read) {
|
||||||
|
return ioOpRead(io, obj);
|
||||||
|
} else {
|
||||||
|
return ioOpWrite(io, obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user