public RuntimeSortHierarchyObj(IHierarchyObj outerHierarchy, int depth) { this.m_hierarchyRoot = outerHierarchy.HierarchyRoot; this.m_odpContext = this.m_hierarchyRoot.Value().OdpContext; List <int> sortFilterInfoIndices = this.m_hierarchyRoot.Value().SortFilterInfoIndices; int num = outerHierarchy.ExpressionIndex + 1; if (sortFilterInfoIndices == null || num >= sortFilterInfoIndices.Count) { RuntimeDataTablixGroupRootObjReference runtimeDataTablixGroupRootObjReference = this.m_hierarchyRoot as RuntimeDataTablixGroupRootObjReference; if ((BaseReference)null != (object)runtimeDataTablixGroupRootObjReference) { using (runtimeDataTablixGroupRootObjReference.PinValue()) { RuntimeDataTablixGroupRootObj runtimeDataTablixGroupRootObj = runtimeDataTablixGroupRootObjReference.Value(); this.m_dataHolder = (IReference <ISortDataHolder>)runtimeDataTablixGroupRootObj.CreateGroupLeaf(); if (!runtimeDataTablixGroupRootObj.HasParent) { runtimeDataTablixGroupRootObj.AddChildWithNoParent((RuntimeGroupLeafObjReference)this.m_dataHolder); } } } else { this.m_dataRowHolder = new RuntimeSortDataHolder(); } } else { this.m_sortHierarchyStruct = new SortHierarchyStructure(this, num, this.m_odpContext.RuntimeSortFilterInfo, sortFilterInfoIndices); } }
public void NextRow(object keyValue, IHierarchyObj owner) { try { BTreeNodeValue value = default(BTreeNodeValue); int num = default(int); int childIndex = default(int); if (!this.m_root.SearchAndInsert(keyValue, this.m_nodes, owner, out value, out num, out childIndex)) { int count = this.m_nodes.Count; this.m_nodes.Add(this.m_root); this.m_root = new BTreeNode(owner); this.m_root.SetFirstChild(this.m_nodes, count); this.m_root.Tuples.Add(new BTreeNodeTuple(value, childIndex), this.m_nodes); } } catch (ReportProcessingException_SpatialTypeComparisonError) { throw new ReportProcessingException(owner.RegisterComparisonError("SortExpression")); } catch (ReportProcessingException_ComparisonError) { throw new ReportProcessingException(owner.RegisterComparisonError("SortExpression")); } }
public void AddSortInfo(IReference <IHierarchyObj> owner, int sortInfoIndex, IReference <RuntimeSortFilterEventInfo> sortInfo) { IInScopeEventSource eventSource = sortInfo.Value().EventSource; if (eventSource.UserSort.SortExpressionScope != null || owner.Value().IsDetail) { if (eventSource.UserSort.SortExpressionScope == null) { this.AddSortInfoIndex(sortInfoIndex, sortInfo); } if (this.m_sortTree == null) { IHierarchyObj hierarchyObj = owner.Value(); this.m_sortTree = new BTree(hierarchyObj, hierarchyObj.OdpContext, hierarchyObj.Depth + 1); } } if (eventSource.UserSort.SortExpressionScope != null) { if (this.m_targetForNonDetailSort == null) { this.m_targetForNonDetailSort = new Hashtable(); } this.m_targetForNonDetailSort.Add(sortInfoIndex, null); } else { if (this.m_targetForDetailSort == null) { this.m_targetForDetailSort = new Hashtable(); } this.m_targetForDetailSort.Add(sortInfoIndex, null); } }
public BTreeNode(IHierarchyObj owner) { this.m_tuples = new BTreeNodeTupleList(3); BTreeNodeTuple tuple = new BTreeNodeTuple(this.CreateBTreeNode(null, owner), -1); this.m_tuples.Add(tuple, null); }
internal BTreeNode(IHierarchyObj owner) { m_tuples = new BTreeNodeTupleList(3); BTreeNodeTuple tuple = new BTreeNodeTuple(CreateBTreeNode(null, owner), -1); m_tuples.Add(tuple, null); }
public BTreeNodeHierarchyObj(object key, IHierarchyObj owner) { this.m_key = key; if (key != null) { this.m_hierarchyNode = owner.CreateHierarchyObjForSortTree(); this.m_hierarchyNode.NextRow(owner); } }
internal BTreeNodeHierarchyObj(object key, IHierarchyObj owner) { m_key = key; if (key != null) { m_hierarchyNode = owner.CreateHierarchyObjForSortTree(); m_hierarchyNode.NextRow(owner); } }
void IHierarchyObj.NextRow(IHierarchyObj owner) { if (m_dataRowHolder != null) { m_dataRowHolder.NextRow(owner.OdpContext, owner.Depth); return; } object keyValue = ((IDataRowSortOwner)m_hierarchyRoot.Value()).EvaluateDataRowSortExpression(m_sortExpression); m_sortTree.NextRow(keyValue, this); }
void IHierarchyObj.NextRow(IHierarchyObj owner) { if (this.m_dataRowHolder != null) { this.m_dataRowHolder.NextRow(owner.OdpContext, owner.Depth); } else { IDataRowSortOwner dataRowSortOwner = (IDataRowSortOwner)this.m_hierarchyRoot.Value(); object keyValue = dataRowSortOwner.EvaluateDataRowSortExpression(this.m_sortExpression); this.m_sortTree.NextRow(keyValue, this); } }
internal RuntimeDataRowSortHierarchyObj(IHierarchyObj outerHierarchy, int depth) { m_hierarchyRoot = outerHierarchy.HierarchyRoot; int num = outerHierarchy.ExpressionIndex + 1; Microsoft.ReportingServices.ReportIntermediateFormat.Sorting sortingDef = ((IDataRowSortOwner)m_hierarchyRoot.Value()).SortingDef; if (sortingDef.SortExpressions == null || num >= sortingDef.SortExpressions.Count) { m_dataRowHolder = new RuntimeSortDataHolder(); return; } m_sortExpression = new RuntimeExpressionInfo(sortingDef.SortExpressions, sortingDef.ExprHost, sortingDef.SortDirections, num); m_sortTree = new BTree(this, OdpContext, depth); }
public void ProcessUserSortForTarget(ObjectModelImpl reportObjectModel, AspNetCore.ReportingServices.RdlExpressions.ReportRuntime reportRuntime, IReference <IHierarchyObj> target, ref ScalableList <DataFieldRow> dataRows, bool targetForNonDetailSort) { using (target.PinValue()) { IHierarchyObj hierarchyObj = target.Value(); if (targetForNonDetailSort && dataRows != null && 0 < dataRows.Count) { IReference <RuntimeSortFilterEventInfo> reference = null; try { List <int> sortFilterInfoIndices = hierarchyObj.SortFilterInfoIndices; Global.Tracer.Assert(null != hierarchyObj.SortTree, "(null != targetObj.SortTree)"); if (sortFilterInfoIndices != null) { reference = this.m_runtimeSortFilterInfo[sortFilterInfoIndices[0]]; } RuntimeSortFilterEventInfo runtimeSortFilterEventInfo = null; if (reference != null) { reference.PinValue(); runtimeSortFilterEventInfo = reference.Value(); } for (int i = 0; i < dataRows.Count; i++) { dataRows[i].SetFields(reportObjectModel.FieldsImpl); object keyValue = DBNull.Value; if (runtimeSortFilterEventInfo != null) { keyValue = runtimeSortFilterEventInfo.GetSortOrder(reportRuntime); } hierarchyObj.SortTree.NextRow(keyValue, hierarchyObj); } } finally { if (reference != null) { reference.UnPinValue(); } } if (dataRows != null) { dataRows.Dispose(); } dataRows = null; } hierarchyObj.MarkSortInfoProcessed(this.m_runtimeSortFilterInfo); } }
public RuntimeDataRowSortHierarchyObj(IHierarchyObj outerHierarchy, int depth) { this.m_hierarchyRoot = outerHierarchy.HierarchyRoot; int num = outerHierarchy.ExpressionIndex + 1; IDataRowSortOwner dataRowSortOwner = (IDataRowSortOwner)this.m_hierarchyRoot.Value(); AspNetCore.ReportingServices.ReportIntermediateFormat.Sorting sortingDef = dataRowSortOwner.SortingDef; if (sortingDef.SortExpressions == null || num >= sortingDef.SortExpressions.Count) { this.m_dataRowHolder = new RuntimeSortDataHolder(); } else { this.m_sortExpression = new RuntimeExpressionInfo(sortingDef.SortExpressions, sortingDef.ExprHost, sortingDef.SortDirections, num); this.m_sortTree = new BTree(this, this.OdpContext, depth); } }
public bool SearchAndInsert(object keyValue, ScalableList <BTreeNode> nodes, IHierarchyObj owner, out BTreeNodeValue newSiblingValue, out int newSiblingIndex, out int globalNewSiblingIndex) { int num = -1; int i; for (i = 1; i < this.m_tuples.Count; i++) { BTreeNodeTuple bTreeNodeTuple = this.m_tuples[i]; num = bTreeNodeTuple.Value.CompareTo(keyValue, owner.OdpContext); if (num >= 0) { break; } } if (num == 0) { this.m_tuples[i].Value.AddRow(owner); } else { int childIndex = this.m_tuples[i - 1].ChildIndex; if (childIndex == -1) { return(this.InsertBTreeNode(nodes, this.CreateBTreeNode(keyValue, owner), i, -1, owner, out newSiblingValue, out newSiblingIndex, out globalNewSiblingIndex)); } BTreeNode bTreeNode = default(BTreeNode); using (nodes.GetAndPin(childIndex, out bTreeNode)) { BTreeNodeValue nodeValueToInsert = default(BTreeNodeValue); int nodeIndexToInsert = default(int); int globalNodeIndexToInsert = default(int); if (!bTreeNode.SearchAndInsert(keyValue, nodes, owner, out nodeValueToInsert, out nodeIndexToInsert, out globalNodeIndexToInsert)) { return(this.InsertBTreeNode(nodes, nodeValueToInsert, nodeIndexToInsert, globalNodeIndexToInsert, owner, out newSiblingValue, out newSiblingIndex, out globalNewSiblingIndex)); } } } newSiblingValue = null; newSiblingIndex = -1; globalNewSiblingIndex = -1; return(true); }
public override void Deserialize(IntermediateFormatReader reader) { reader.RegisterDeclaration(BTreeNodeHierarchyObj.m_declaration); while (reader.NextMember()) { switch (reader.CurrentMember.MemberName) { case MemberName.Key: this.m_key = reader.ReadVariant(); break; case MemberName.HierarchyNode: this.m_hierarchyNode = (IHierarchyObj)reader.ReadRIFObject(); break; default: Global.Tracer.Assert(false); break; } } }
internal void NextRow(object keyValue, IHierarchyObj owner) { try { if (!m_root.SearchAndInsert(keyValue, m_nodes, owner, out BTreeNodeValue newSiblingValue, out int _, out int globalNewSiblingIndex)) { int count = m_nodes.Count; m_nodes.Add(m_root); m_root = new BTreeNode(owner); m_root.SetFirstChild(m_nodes, count); m_root.Tuples.Add(new BTreeNodeTuple(newSiblingValue, globalNewSiblingIndex), m_nodes); } } catch (ReportProcessingException_SpatialTypeComparisonError) { throw new ReportProcessingException(owner.RegisterComparisonError("SortExpression")); } catch (ReportProcessingException_ComparisonError) { throw new ReportProcessingException(owner.RegisterComparisonError("SortExpression")); } }
void IHierarchyObj.NextRow(IHierarchyObj owner) { if (this.m_dataHolder != null) { using (this.m_dataHolder.PinValue()) { this.m_dataHolder.Value().NextRow(); } } else if (this.m_sortHierarchyStruct != null) { IReference <RuntimeSortFilterEventInfo> sortInfo = this.m_sortHierarchyStruct.SortInfo; object sortOrder = default(object); using (sortInfo.PinValue()) { sortOrder = sortInfo.Value().GetSortOrder(this.m_odpContext.ReportRuntime); } this.m_sortHierarchyStruct.SortTree.NextRow(sortOrder, this); } else if (this.m_dataRowHolder != null) { this.m_dataRowHolder.NextRow(this.m_odpContext, this.Depth + 1); } }
private bool InsertBTreeNode(ScalableList <BTreeNode> nodes, BTreeNodeValue nodeValueToInsert, int nodeIndexToInsert, int globalNodeIndexToInsert, IHierarchyObj owner, out BTreeNodeValue newSiblingValue, out int newSiblingIndex, out int globalNewSibingIndex) { if (3 > m_tuples.Count) { m_tuples.Insert(nodeIndexToInsert, new BTreeNodeTuple(nodeValueToInsert, globalNodeIndexToInsert), nodes); newSiblingValue = null; newSiblingIndex = -1; globalNewSibingIndex = -1; return(true); } int num = 2; BTreeNode bTreeNode = new BTreeNode(owner); BTreeNodeValue bTreeNodeValue; if (num < nodeIndexToInsert) { bTreeNodeValue = m_tuples[num].Value; bTreeNode.SetFirstChild(nodes, m_tuples[num].ChildIndex); for (int i = num + 1; i < ((m_tuples.Count <= nodeIndexToInsert) ? m_tuples.Count : nodeIndexToInsert); i++) { bTreeNode.m_tuples.Add(m_tuples[i], nodes); } bTreeNode.m_tuples.Add(new BTreeNodeTuple(nodeValueToInsert, globalNodeIndexToInsert), nodes); for (int j = nodeIndexToInsert; j < m_tuples.Count; j++) { bTreeNode.m_tuples.Add(m_tuples[j], nodes); } int count = m_tuples.Count; for (int k = num; k < count; k++) { m_tuples.RemoveAtEnd(); } } else if (num > nodeIndexToInsert) { bTreeNodeValue = m_tuples[num - 1].Value; bTreeNode.SetFirstChild(nodes, m_tuples[num - 1].ChildIndex); for (int l = num; l < m_tuples.Count; l++) { bTreeNode.m_tuples.Add(m_tuples[l], nodes); } int count2 = m_tuples.Count; for (int m = num - 1; m < count2; m++) { m_tuples.RemoveAtEnd(); } m_tuples.Insert(nodeIndexToInsert, new BTreeNodeTuple(nodeValueToInsert, globalNodeIndexToInsert), nodes); } else { bTreeNodeValue = nodeValueToInsert; bTreeNode.SetFirstChild(nodes, globalNodeIndexToInsert); for (int n = num; n < m_tuples.Count; n++) { bTreeNode.m_tuples.Add(m_tuples[n], nodes); } int count3 = m_tuples.Count; for (int num2 = num; num2 < count3; num2++) { m_tuples.RemoveAtEnd(); } } newSiblingValue = bTreeNodeValue; newSiblingIndex = m_indexInParent + 1; globalNewSibingIndex = nodes.Count; nodes.Add(bTreeNode); return(false); }
internal bool SearchAndInsert(object keyValue, ScalableList <BTreeNode> nodes, IHierarchyObj owner, out BTreeNodeValue newSiblingValue, out int newSiblingIndex, out int globalNewSiblingIndex) { int num = -1; int i; for (i = 1; i < m_tuples.Count; i++) { num = m_tuples[i].Value.CompareTo(keyValue, owner.OdpContext); if (num >= 0) { break; } } if (num == 0) { m_tuples[i].Value.AddRow(owner); } else { int childIndex = m_tuples[i - 1].ChildIndex; if (childIndex == -1) { return(InsertBTreeNode(nodes, CreateBTreeNode(keyValue, owner), i, -1, owner, out newSiblingValue, out newSiblingIndex, out globalNewSiblingIndex)); } BTreeNode item; using (nodes.GetAndPin(childIndex, out item)) { if (!item.SearchAndInsert(keyValue, nodes, owner, out BTreeNodeValue newSiblingValue2, out int newSiblingIndex2, out int globalNewSiblingIndex2)) { return(InsertBTreeNode(nodes, newSiblingValue2, newSiblingIndex2, globalNewSiblingIndex2, owner, out newSiblingValue, out newSiblingIndex, out globalNewSiblingIndex)); } } } newSiblingValue = null; newSiblingIndex = -1; globalNewSiblingIndex = -1; return(true); }
public SortHierarchyStructure(IHierarchyObj owner, int sortIndex, List <IReference <RuntimeSortFilterEventInfo> > sortInfoList, List <int> sortInfoIndices) { this.SortIndex = sortIndex; this.SortInfo = sortInfoList[sortInfoIndices[sortIndex]]; this.SortTree = new BTree(owner, owner.OdpContext, owner.Depth); }
internal abstract void AddRow(IHierarchyObj ownerRef);
void IHierarchyObj.NextRow(IHierarchyObj owner) { NextRow(); }
internal BTree(IHierarchyObj owner, OnDemandProcessingContext odpContext, int level) { m_nodes = new ScalableList <BTreeNode>(level, odpContext.TablixProcessingScalabilityCache); m_root = new BTreeNode(owner); }
private BTreeNodeValue CreateBTreeNode(object key, IHierarchyObj owner) { return(new BTreeNodeHierarchyObj(key, owner)); }
public override void AddRow(IHierarchyObj owner) { this.m_hierarchyNode.NextRow(owner); }
internal override void AddRow(IHierarchyObj owner) { m_hierarchyNode.NextRow(owner); }
private void Traverse(DataFieldRow dataRow, ProcessingStages operation, DataRowSortOwnerTraversalContext context, IHierarchyObj owner) { dataRow.SetFields(owner.OdpContext.ReportObjectModel.FieldsImpl); if (operation == ProcessingStages.UserSortFilter) { owner.ReadRow(); } else { context.SortOwner.PostDataRowSortNextRow(); } }
public abstract void AddRow(IHierarchyObj ownerRef);
void IHierarchyObj.NextRow(IHierarchyObj owner) { Global.Tracer.Assert(condition: false); }
public void Traverse(ProcessingStages operation, ITraversalContext traversalContext, IHierarchyObj owner) { Global.Tracer.Assert(ProcessingStages.UserSortFilter == operation || owner.InDataRowSortPhase, "Invalid call to RuntimeSortDataHolder.Traverse. Must be in UserSortFilter stage or InDataRowSortPhase"); if (this.m_firstRow != null) { DataRowSortOwnerTraversalContext context = traversalContext as DataRowSortOwnerTraversalContext; this.Traverse(this.m_firstRow, operation, context, owner); if (this.m_dataRows != null) { for (int i = 0; i < this.m_dataRows.Count; i++) { this.Traverse(this.m_dataRows[i], operation, context, owner); } } } }