Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Linq / Parallel / QueryOperators / Options / OrderingQueryOperator.cs / 1305376 / OrderingQueryOperator.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // OrderingQueryOperator.cs // //[....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections.Generic; using System.Threading; namespace System.Linq.Parallel { ////// Represents operators AsOrdered and AsUnordered. In the current implementation, it /// simply turns on preservation globally in the query. /// ///internal sealed class OrderingQueryOperator : QueryOperator { // Turns on order (AsOrdered) or turns off order (AsUnordered) private bool m_orderOn; private QueryOperator m_child; private OrdinalIndexState m_ordinalIndexState; public OrderingQueryOperator(QueryOperator child, bool orderOn) : base(orderOn, child.SpecifiedQuerySettings) { m_child = child; m_ordinalIndexState = m_child.OrdinalIndexState; m_orderOn = orderOn; } internal override QueryResults Open(QuerySettings settings, bool preferStriping) { return m_child.Open(settings, preferStriping); } internal override IEnumerator GetEnumerator(ParallelMergeOptions? mergeOptions, bool suppressOrderPreservation) { ScanQueryOperator childAsScan = m_child as ScanQueryOperator ; if (childAsScan != null) { return childAsScan.Data.GetEnumerator(); } return base.GetEnumerator(mergeOptions, suppressOrderPreservation); } //---------------------------------------------------------------------------------------- // Returns an enumerable that represents the query executing sequentially. // internal override IEnumerable AsSequentialQuery(CancellationToken token) { return m_child.AsSequentialQuery(token); } //--------------------------------------------------------------------------------------- // Whether this operator performs a premature merge. // internal override bool LimitsParallelism { get { return m_child.LimitsParallelism; } } internal override OrdinalIndexState OrdinalIndexState { get { return m_ordinalIndexState; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // OrderingQueryOperator.cs // // [....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections.Generic; using System.Threading; namespace System.Linq.Parallel { ////// Represents operators AsOrdered and AsUnordered. In the current implementation, it /// simply turns on preservation globally in the query. /// ///internal sealed class OrderingQueryOperator : QueryOperator { // Turns on order (AsOrdered) or turns off order (AsUnordered) private bool m_orderOn; private QueryOperator m_child; private OrdinalIndexState m_ordinalIndexState; public OrderingQueryOperator(QueryOperator child, bool orderOn) : base(orderOn, child.SpecifiedQuerySettings) { m_child = child; m_ordinalIndexState = m_child.OrdinalIndexState; m_orderOn = orderOn; } internal override QueryResults Open(QuerySettings settings, bool preferStriping) { return m_child.Open(settings, preferStriping); } internal override IEnumerator GetEnumerator(ParallelMergeOptions? mergeOptions, bool suppressOrderPreservation) { ScanQueryOperator childAsScan = m_child as ScanQueryOperator ; if (childAsScan != null) { return childAsScan.Data.GetEnumerator(); } return base.GetEnumerator(mergeOptions, suppressOrderPreservation); } //---------------------------------------------------------------------------------------- // Returns an enumerable that represents the query executing sequentially. // internal override IEnumerable AsSequentialQuery(CancellationToken token) { return m_child.AsSequentialQuery(token); } //--------------------------------------------------------------------------------------- // Whether this operator performs a premature merge. // internal override bool LimitsParallelism { get { return m_child.LimitsParallelism; } } internal override OrdinalIndexState OrdinalIndexState { get { return m_ordinalIndexState; } } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- WizardStepCollectionEditor.cs
- WaitForChangedResult.cs
- XmlLanguageConverter.cs
- ColorComboBox.cs
- MenuItem.cs
- MemberDescriptor.cs
- ByteConverter.cs
- M3DUtil.cs
- TypeElement.cs
- HtmlInputRadioButton.cs
- NamespaceInfo.cs
- ReversePositionQuery.cs
- ShaderRenderModeValidation.cs
- CustomUserNameSecurityTokenAuthenticator.cs
- Timeline.cs
- SendingRequestEventArgs.cs
- ProcessProtocolHandler.cs
- UserPersonalizationStateInfo.cs
- OleDbParameter.cs
- ToolStripComboBox.cs
- CounterSetInstance.cs
- ValidatorUtils.cs
- UIElementCollection.cs
- AQNBuilder.cs
- Stack.cs
- SelectionItemProviderWrapper.cs
- TextFindEngine.cs
- IndexedString.cs
- Point3DAnimation.cs
- PowerStatus.cs
- FileDataSourceCache.cs
- ValueChangedEventManager.cs
- HtmlWindow.cs
- ItemCheckedEvent.cs
- JavascriptXmlWriterWrapper.cs
- ProfilePropertyNameValidator.cs
- Misc.cs
- TerminateSequence.cs
- TextDecorations.cs
- RectangleGeometry.cs
- XmlNavigatorStack.cs
- ToolStripManager.cs
- CompareValidator.cs
- Bits.cs
- AttributedMetaModel.cs
- EventLog.cs
- BevelBitmapEffect.cs
- SessionPageStatePersister.cs
- NavigationPropertyEmitter.cs
- QueryContinueDragEvent.cs
- PolyQuadraticBezierSegment.cs
- PersonalizationProviderHelper.cs
- DurableInstanceContextProvider.cs
- MeasureItemEvent.cs
- PanningMessageFilter.cs
- WorkflowServiceAttributesTypeConverter.cs
- EntityDataSourceEntityTypeFilterItem.cs
- AffineTransform3D.cs
- ToolBarOverflowPanel.cs
- ReservationNotFoundException.cs
- PrintDocument.cs
- Table.cs
- SizeKeyFrameCollection.cs
- PassportAuthenticationEventArgs.cs
- SpeechSeg.cs
- Model3DGroup.cs
- SafeMemoryMappedViewHandle.cs
- ListViewUpdatedEventArgs.cs
- MsmqTransportSecurityElement.cs
- SqlServices.cs
- OleDbParameterCollection.cs
- DataGridViewDataErrorEventArgs.cs
- RenderOptions.cs
- XmlObjectSerializer.cs
- PingReply.cs
- DiffuseMaterial.cs
- TreeNodeConverter.cs
- MemoryFailPoint.cs
- StylusPointCollection.cs
- ValidatingPropertiesEventArgs.cs
- SequenceDesigner.cs
- FrameworkPropertyMetadata.cs
- KeyboardInputProviderAcquireFocusEventArgs.cs
- EdgeProfileValidation.cs
- VisualTreeUtils.cs
- CalendarDay.cs
- OptimisticConcurrencyException.cs
- WebResourceAttribute.cs
- ConfigurationLocationCollection.cs
- XmlHierarchicalEnumerable.cs
- BindingContext.cs
- ActivityWithResultConverter.cs
- PagesChangedEventArgs.cs
- DefaultValidator.cs
- PointCollectionConverter.cs
- EntityDataSourceQueryBuilder.cs
- SerialPort.cs
- XmlSignatureManifest.cs
- ParallelDesigner.cs
- LogAppendAsyncResult.cs