/// <summary> /// 删除节点 /// </summary> /// <param name="parser"></param> private void remove(ref OperationParameter.NodeParser parser) { HashCodeKey <keyType> key; if (HashCodeKey <keyType> .Get(ref parser, out key)) { System.Collections.Generic.Dictionary <HashCodeKey <keyType>, nodeType> dictionary = dictionarys[key.HashCode & 0xff]; if (dictionary != null) { nodeType node; if (dictionary.TryGetValue(key, out node)) { dictionary.Remove(key); --count; parser.SetOperationReturnParameter(); node.OnRemoved(); return; } } parser.ReturnParameter.ReturnParameterSet(false); } else { parser.ReturnParameter.ReturnType = ReturnType.ValueDataLoadError; } }
/// <summary> /// 设置数据 /// </summary> /// <param name="parser"></param> private void setValue(ref OperationParameter.NodeParser parser) { HashCodeKey <valueType> key; if (HashCodeKey <valueType> .Get(ref parser, out key)) { hashSet.Add(key); parser.SetOperationReturnParameter(); } }
/// <summary> /// 弹出数据 /// </summary> /// <param name="parser"></param> private void removeTop(ref OperationParameter.NodeParser parser) { if (heap.Count != 0) { heap.RemoveTop(); parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnType = ReturnType.HeapIsEmpty; } }
/// <summary> /// 删除数据 /// </summary> /// <param name="parser"></param> private void remove(ref OperationParameter.NodeParser parser) { int index = parser.GetValueData(-1); if ((uint)index < count) { arrays[index >> FragmentArray.ArrayShift][index & FragmentArray.ArraySizeAnd] = default(valueType); parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnType = ReturnType.ArrayIndexOutOfRange; } }
/// <summary> /// 删除数据 /// </summary> /// <param name="parser"></param> private void remove(ref OperationParameter.NodeParser parser) { LinkNode <valueType> node = getNode(parser.GetValueData(int.MinValue)); if (node != null) { node.Remove(this); --count; parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnType = ReturnType.LinkIndexOutOfRange; } }
/// <summary> /// 删除节点 /// </summary> /// <param name="parser"></param> private void remove(ref OperationParameter.NodeParser parser) { keyType key; if (HashCodeKey<keyType>.Get(ref parser, out key)) { nodeType node; if (dictionary.Remove(ref key, out node)) { parser.SetOperationReturnParameter(); node.OnRemoved(); } else parser.ReturnParameter.ReturnParameterSet(false); } else parser.ReturnParameter.ReturnType = ReturnType.ValueDataLoadError; }
/// <summary> /// 设置数据 /// </summary> /// <param name="parser"></param> private void setValue(ref OperationParameter.NodeParser parser) { HashCodeKey <keyType> key; if (HashCodeKey <keyType> .Get(ref parser, out key) && parser.LoadValueData() && parser.IsEnd && parser.ValueData.Type == ValueData.Data <valueType> .DataType) { fragmentDictionary[key] = ValueData.Data <valueType> .GetData(ref parser.ValueData); parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnType = ReturnType.ValueDataLoadError; } }
/// <summary> /// 删除数据 /// </summary> /// <param name="parser"></param> private void remove(ref OperationParameter.NodeParser parser) { HashCodeKey <valueType> key; if (HashCodeKey <valueType> .Get(ref parser, out key)) { if (hashSet.Remove(key)) { parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnParameterSet(false); } } }
/// <summary> /// 设置数据 /// </summary> /// <param name="parser"></param> private void setValue(ref OperationParameter.NodeParser parser) { keyType key; if (HashCodeKey <keyType> .Get(ref parser, out key) && parser.LoadValueData() && parser.IsEnd && parser.ValueData.Type == ValueData.Data <valueType> .DataType) { valueType value = ValueData.Data <valueType> .GetData(ref parser.ValueData); heap.Push(key, ref value); parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnType = ReturnType.ValueDataLoadError; } }
/// <summary> /// 清除数据位 /// </summary> /// <param name="parser">参数解析</param> private void clear(ref OperationParameter.NodeParser parser) { BitmapIndex index = new BitmapIndex(Maps, ref parser); if (index.Map != null) { if (index.IsOperationClear()) { parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnParameterSet(false); } } }
/// <summary> /// 删除数据 /// </summary> /// <param name="parser"></param> private void remove(ref OperationParameter.NodeParser parser) { HashCodeKey <keyType> key; if (HashCodeKey <keyType> .Get(ref parser, out key)) { if (fragmentDictionary.Remove(key)) { parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnParameterSet(false); } } }
/// <summary> /// 删除数据 /// </summary> /// <param name="parser"></param> private void remove(ref OperationParameter.NodeParser parser) { HashCodeKey <valueType> key; if (HashCodeKey <valueType> .Get(ref parser, out key)) { System.Collections.Generic.HashSet <HashCodeKey <valueType> > hashSet = hashSets[key.HashCode & 0xff]; if (hashSet != null && hashSet.Remove(key)) { --count; parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnParameterSet(false); } } }
/// <summary> /// 删除数据 /// </summary> /// <param name="parser"></param> private void remove(ref OperationParameter.NodeParser parser) { HashCodeKey <keyType> key; if (HashCodeKey <keyType> .Get(ref parser, out key)) { System.Collections.Generic.Dictionary <HashCodeKey <keyType>, valueType> dictionary = dictionarys[key.HashCode & 0xff]; if (dictionary != null && dictionary.Remove(key)) { --count; parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnParameterSet(false); } } }
/// <summary> /// 后置插入数据 /// </summary> /// <param name="parser"></param> private void insertAfter(ref OperationParameter.NodeParser parser) { int index = parser.GetValueData(int.MinValue); LinkNode <valueType> node = getNode(index); if (node != null) { if (parser.LoadValueData() && parser.IsEnd && parser.ValueData.Type == ValueData.Data <valueType> .DataType) { LinkNode <valueType> newNode = new LinkNode <valueType>(node, node.Next, ValueData.Data <valueType> .GetData(ref parser.ValueData)); if (node.InsertAfter(newNode)) { end = newNode; } ++count; parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnType = ReturnType.ValueDataLoadError; } } else if ((count | (index ^ -1)) == 0) { if (parser.LoadValueData() && parser.IsEnd && parser.ValueData.Type == ValueData.Data <valueType> .DataType) { setHeadEnd(ref parser, ValueData.Data <valueType> .GetData(ref parser.ValueData)); } else { parser.ReturnParameter.ReturnType = ReturnType.ValueDataLoadError; } } else { parser.ReturnParameter.ReturnType = ReturnType.LinkIndexOutOfRange; } }
/// <summary> /// 设置数据 /// </summary> /// <param name="parser"></param> private void setValue(ref OperationParameter.NodeParser parser) { HashCodeKey <keyType> key; if (HashCodeKey <keyType> .Get(ref parser, out key) && parser.LoadValueData() && parser.IsEnd && parser.ValueData.Type == ValueData.Data <valueType> .DataType) { valueType value = ValueData.Data <valueType> .GetData(ref parser.ValueData); System.Collections.Generic.Dictionary <HashCodeKey <keyType>, valueType> dictionary = dictionarys[key.HashCode & 0xff]; if (dictionary == null) { dictionarys[key.HashCode & 0xff] = dictionary = AutoCSer.DictionaryCreator <HashCodeKey <keyType> > .Create <valueType>(); } int count = dictionary.Count; dictionary[key] = value; this.count += dictionary.Count - count; parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnType = ReturnType.ValueDataLoadError; } }
/// <summary> /// 设置数据 /// </summary> /// <param name="parser"></param> private void setValue(ref OperationParameter.NodeParser parser) { int indexParameter = parser.GetValueData(-1); if (indexParameter >= 0 && parser.LoadValueData() && parser.IsEnd) { if (parser.ValueData.Type == ValueData.Data <valueType> .DataType) { valueType value = ValueData.Data <valueType> .GetData(ref parser.ValueData); int arrayIndex = indexParameter >> FragmentArray.ArrayShift; if (arrayIndex >= arrays.Length) { valueType[][] newArrays = arrays.copyNew(arrayIndex + 1, arrays.Length); for (int newIndex = arrays.Length; newIndex != newArrays.Length; newArrays[newIndex++] = new valueType[FragmentArray.ArraySize]) { ; } arrays = newArrays; } arrays[arrayIndex][indexParameter & FragmentArray.ArraySizeAnd] = value; if (indexParameter >= count) { count = indexParameter + 1; } parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnType = ReturnType.ValueDataLoadError; } } else { parser.ReturnParameter.ReturnType = ReturnType.ArrayIndexOutOfRange; } }
/// <summary> /// 设置数据 /// </summary> /// <param name="parser"></param> private void setValue(ref OperationParameter.NodeParser parser) { HashCodeKey <valueType> key; if (HashCodeKey <valueType> .Get(ref parser, out key)) { System.Collections.Generic.HashSet <HashCodeKey <valueType> > hashSet = hashSets[key.HashCode & 0xff]; if (hashSet == null) { hashSets[key.HashCode & 0xff] = hashSet = AutoCSer.HashSetCreator <HashCodeKey <valueType> > .Create(); } int count = hashSet.Count; hashSet.Add(key); if (hashSet.Count != count) { ++this.count; parser.SetOperationReturnParameter(); } else { parser.ReturnParameter.ReturnParameterSet(true); } } }
/// <summary> /// 添加第一个节点 /// </summary> /// <param name="parser"></param> /// <param name="value"></param> private void setHeadEnd(ref OperationParameter.NodeParser parser, valueType value) { head = end = new LinkNode <valueType>(value); count = 1; parser.SetOperationReturnParameter(); }