From c08b701c90c8998b241c82638d5c488e03238214 Mon Sep 17 00:00:00 2001 From: LYW <leeyeanwoo@diteam.co.kr> Date: 목, 23 9월 2021 17:39:47 +0900 Subject: [PATCH] Ongoing100 #3517 CF AOI Review 자가진단 기능 개선 --- ReviewHistory/include/akCore/akBit.h | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 57 insertions(+), 0 deletions(-) diff --git a/ReviewHistory/include/akCore/akBit.h b/ReviewHistory/include/akCore/akBit.h new file mode 100644 index 0000000..32c6701 --- /dev/null +++ b/ReviewHistory/include/akCore/akBit.h @@ -0,0 +1,57 @@ +#pragma once + + +#include "akCoreLinker.h" + +//namespace akCore +//{ + + class AKCORE_DLLSPEC CakBit + { + public: + CakBit(void); + CakBit(int nBit); + ~CakBit(void); + + + void setBit(int nBit); + void setBitFlag(int nBitIndex, bool bFlag); + + int getBit(); + bool getBitFlag(int nBitIndex); + + + protected: + int m_nBit; + + public: + //비트 체크(on되있으면 true 반환) + static int bitChk(int orig, int target) + { + if(target<32 && (orig&(0x1 << target)))return 1; + else return 0; + } + + //비트 온 + static int bitOn(int orig, int target) + { + if(target<32)return orig|(0x1 << target); + else return orig; + } + + //비트 오프 + static int bitOff(int orig, int target) + { + if(target<32)return orig&(~(0x1 << target)); + else return orig; + } + + //비트 스위치 + static int bitTurn(int orig, int target) + { + if(target<32)return orig^(0x1 << target); + else return orig; + } + }; + +//}; \ No newline at end of file -- Gitblit v1.9.3