示例#1
0
        public __tuple <BoolType_, byte> _getOpen(
            ushort nIndex)
        {
            __tuple <BoolStruct, BoolStruct> tuple_ =
                this._getIndex(nIndex);
            BoolStruct first    = tuple_._get_0();
            BoolStruct second   = tuple_._get_1();
            byte       pos      = 0;
            BoolType_  boolType = first._getBoolType();

            if (BoolType_.mSucess_ == boolType)
            {
                __tuple <BoolType_, byte> tupleOpen =
                    this._getOpen(first._getLength(),
                                  first._getFirst(), first._getSecond());
                boolType = tupleOpen._get_0();
                pos      = tupleOpen._get_1();
            }
            if ((BoolType_.mOpened_ == boolType) &&
                (BoolType_.mSucess_ == second._getBoolType()))
            {
                __tuple <BoolType_, byte> tupleOpen =
                    this._getOpen(second._getLength(),
                                  second._getFirst(), second._getSecond());
                boolType = tupleOpen._get_0();
                pos      = tupleOpen._get_1();
            }
            return(new __tuple <BoolType_, byte>(boolType, pos));
        }
示例#2
0
        public BoolType_ _runOpen(byte nIndex)
        {
            __tuple <BoolStruct, BoolStruct> tuple_ =
                this._getIndex(nIndex);
            BoolStruct first  = tuple_._get_0();
            BoolStruct second = tuple_._get_1();
            BoolType_  result = first._getBoolType();

            if (BoolType_.mSucess_ == result)
            {
                result = this._openIndex(first._getLength(),
                                         first._getFirst(), first._getSecond());
            }
            if ((BoolType_.mOpened_ == result) &&
                (BoolType_.mSucess_ == second._getBoolType()))
            {
                result = this._openIndex(second._getLength(),
                                         second._getFirst(), second._getSecond());
            }
            if (BoolType_.mNext_ == result)
            {
                this._clearIndex(first._getLength(),
                                 first._getFirst(), first._getSecond());
                this._clearIndex(second._getLength(),
                                 second._getFirst(), second._getSecond());
            }
            return(result);
        }
示例#3
0
 public BoolStruct(
     BoolType_ nBoolType,
     ushort nLength,
     byte nFirst,
     byte nSecond)
 {
     mBoolType = nBoolType;
     mLength   = nLength;
     mFirst    = nFirst;
     mSecond   = nSecond;
 }
示例#4
0
        public BoolType_ _runOpen(ushort nIndex)
        {
            __tuple <BoolType_, ushort, byte> tuple_ =
                this._getIndex(nIndex);
            BoolType_ result = tuple_._get_0();

            if (BoolType_.mSucess_ == result)
            {
                result = this._openPos(tuple_._get_1(),
                                       tuple_._get_2());
            }
            return(result);
        }
示例#5
0
        public BoolType_ _isOpen(ushort nIndex)
        {
            BoolStruct boolStruct_ =
                this._getSecond(nIndex);
            BoolType_ result =
                boolStruct_._getBoolType();

            if (BoolType_.mSucess_ == result)
            {
                result = this._isOpen(
                    boolStruct_._getLength(),
                    boolStruct_._getSecond());
            }
            return(result);
        }
示例#6
0
        __tuple <BoolType_, byte> _getOpen(ushort nLength,
                                           byte nFirst, byte nSecond)
        {
            BoolType_ boolType = BoolType_.mOpened_;
            byte      pos      = 0;
            ulong     value_   = 1;

            value_ <<= nFirst;
            for (byte i = nFirst; i <= nSecond; ++i)
            {
                if ((value_ & mValue[nLength]) < 1)
                {
                    boolType = BoolType_.mSucess_;
                    pos      = (byte)(i - nFirst);
                    break;
                }
                value_ <<= 1;
            }
            return(new __tuple <BoolType_, byte>(
                       boolType, pos));
        }
示例#7
0
 public void _setBoolType(
     BoolType_ nBoolType)
 {
     mBoolType = nBoolType;
 }