SDC C-Project CF Review 프로그램
LAPTOP-N7PT1MHU\dit-709
2021-05-10 a94966aed7229fbacf418acf73dfb0885050f47d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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;
        }
    };
 
//};