Add OpType for Metal Claw operators

This commit is contained in:
Gary Talent 2017-10-15 00:55:25 -05:00
parent 6815402ba1
commit 70896b8761
3 changed files with 28 additions and 0 deletions

18
deps/ox/src/ox/mc/optype.hpp vendored Normal file
View File

@ -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
};
}

View File

@ -11,6 +11,7 @@
#include <ox/std/byteswap.hpp> #include <ox/std/byteswap.hpp>
#include <ox/std/string.hpp> #include <ox/std/string.hpp>
#include "err.hpp" #include "err.hpp"
#include "optype.hpp"
#include "presencemask.hpp" #include "presencemask.hpp"
namespace ox { namespace ox {
@ -49,6 +50,10 @@ class MetalClawReader {
void setFields(int fields); void setFields(int fields);
OpType opType() {
return OpType::Read;
}
private: private:
template<typename I> template<typename I>
int readInteger(I *val); int readInteger(I *val);

View File

@ -11,6 +11,7 @@
#include <ox/std/string.hpp> #include <ox/std/string.hpp>
#include <ox/std/types.hpp> #include <ox/std/types.hpp>
#include "err.hpp" #include "err.hpp"
#include "optype.hpp"
#include "presencemask.hpp" #include "presencemask.hpp"
namespace ox { namespace ox {
@ -49,6 +50,10 @@ class MetalClawWriter {
void setFields(int fields); void setFields(int fields);
OpType opType() {
return OpType::Write;
}
private: private:
template<typename I> template<typename I>
int appendInteger(I val); int appendInteger(I val);