Пример #1
0
        public void ClearChangesMask <U>(DynamicUpdateField <U> updateField) where U : new()
        {
            if (typeof(U).GetInterfaces().Any(x => typeof(IHasChangesMask) == x))
            {
                for (int i = 0; i < updateField.Size(); ++i)
                {
                    ((IHasChangesMask)updateField[i]).ClearChangesMask();
                }

                updateField.ClearChangesMask();
            }
        }
Пример #2
0
        public void ClearChangesMask <U>(DynamicUpdateField <U> updateField) where U : new()
        {
            if (typeof(U).BaseType == typeof(IHasChangesMask))
            {
                for (int i = 0; i < updateField.Size(); ++i)
                {
                    ((IHasChangesMask)updateField[i]).ClearChangesMask();
                }

                updateField.ClearChangesMask();
            }
        }
Пример #3
0
        public void ClearChangesMask <U>(DynamicUpdateField <U> updateField) where U : new()
        {
            if (typeof(IHasChangesMask).IsAssignableFrom(typeof(U)))
            {
                for (int i = 0; i < updateField.Size(); ++i)
                {
                    ((IHasChangesMask)updateField[i]).ClearChangesMask();
                }

                updateField.ClearChangesMask();
            }
        }
Пример #4
0
        public DynamicUpdateFieldSetter <U> ModifyValue <U>(DynamicUpdateField <U> updateField, int index) where U : new()
        {
            if (index >= updateField._values.Count)
            {
                // fill with zeros until reaching desired slot
                updateField._values.Resize((uint)index + 1);
                updateField._updateMask.Resize((uint)(updateField._values.Count + 31) / 32);
            }

            _changesMask.Set(updateField.BlockBit);
            _changesMask.Set(updateField.Bit);
            updateField.MarkChanged(index);

            return(new DynamicUpdateFieldSetter <U>(updateField, index));
        }
Пример #5
0
 public DynamicUpdateFieldSetter(DynamicUpdateField <T> dynamicUpdateField, int index)
 {
     _dynamicUpdateField = dynamicUpdateField;
     _index = index;
 }
Пример #6
0
 public DynamicUpdateField <U> ModifyValue <U>(DynamicUpdateField <U> updateField) where U : new()
 {
     _changesMask.Set(updateField.BlockBit);
     _changesMask.Set(updateField.Bit);
     return(updateField);
 }
Пример #7
0
 public void ClearChanged <U>(DynamicUpdateField <U> updateField, int index) where U : new()
 {
     _changesMask.Reset(Bit);
     updateField.ClearChanged(index);
 }