Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / Core / System / Linq / Parallel / Merging / MergeEnumerator.cs / 1305376 / MergeEnumerator.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // MergeEnumerator.cs // //[....] // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System.Collections; using System.Collections.Generic; using System.Diagnostics.Contracts; namespace System.Linq.Parallel { ////// Convenience class used by enumerators that merge many partitions into one. /// ///internal abstract class MergeEnumerator : IEnumerator { protected QueryTaskGroupState m_taskGroupState; //------------------------------------------------------------------------------------ // Initializes a new enumerator with the specified group state. // protected MergeEnumerator(QueryTaskGroupState taskGroupState) { Contract.Assert(taskGroupState != null); m_taskGroupState = taskGroupState; } //----------------------------------------------------------------------------------- // Abstract members of IEnumerator that must be implemented by concrete subclasses. // public abstract TInputOutput Current { get; } public abstract bool MoveNext(); //----------------------------------------------------------------------------------- // Straightforward IEnumerator methods. So subclasses needn't bother. // object IEnumerator.Current { get { return ((IEnumerator )this).Current; } } public virtual void Reset() { // (intentionally left blank) } //----------------------------------------------------------------------------------- // If the enumerator is disposed of before the query finishes, we need to ensure // we properly tear down the query such that exceptions are not lost. // public virtual void Dispose() { // If the enumerator is being disposed of before the query has finished, // we will wait for the query to finish. Cancellation should have already // been initiated, so we just need to ensure exceptions are propagated. if (!m_taskGroupState.IsAlreadyEnded) { Contract.Assert(m_taskGroupState.CancellationState.TopLevelDisposedFlag.Value); m_taskGroupState.QueryEnd(true); } } } } // 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
- PointLightBase.cs
- WsdlBuildProvider.cs
- SQLMoney.cs
- GetMemberBinder.cs
- FactoryGenerator.cs
- SectionVisual.cs
- MtomMessageEncodingElement.cs
- WmiInstallComponent.cs
- XsltSettings.cs
- Overlapped.cs
- Utils.cs
- CompoundFileStreamReference.cs
- ClientBuildManagerTypeDescriptionProviderBridge.cs
- TransactedBatchingBehavior.cs
- GridItemCollection.cs
- ModuleElement.cs
- MatrixValueSerializer.cs
- ApplicationBuildProvider.cs
- RepeaterDesigner.cs
- WebPartRestoreVerb.cs
- UiaCoreApi.cs
- ListViewDesigner.cs
- NonBatchDirectoryCompiler.cs
- AttributeProviderAttribute.cs
- DataGridLinkButton.cs
- OperationAbortedException.cs
- DataGridViewCellMouseEventArgs.cs
- PtsHelper.cs
- HttpRequest.cs
- ColorMap.cs
- HttpListenerResponse.cs
- ManagedWndProcTracker.cs
- BeginEvent.cs
- ServiceHttpModule.cs
- ProjectionPruner.cs
- SessionState.cs
- TypeNameConverter.cs
- ListViewDataItem.cs
- FileBasedResourceGroveler.cs
- RichTextBox.cs
- ArgumentException.cs
- StateMachineSubscription.cs
- HttpInputStream.cs
- FrameworkRichTextComposition.cs
- SamlDoNotCacheCondition.cs
- UseAttributeSetsAction.cs
- ResourceDisplayNameAttribute.cs
- CodeComment.cs
- SqlFormatter.cs
- ToolStripItem.cs
- Queue.cs
- ControlCommandSet.cs
- XmlDocumentFragment.cs
- FixedSOMPageElement.cs
- BaseCollection.cs
- InvalidOleVariantTypeException.cs
- MappedMetaModel.cs
- NativeRecognizer.cs
- DataServiceResponse.cs
- BinaryConverter.cs
- BitArray.cs
- GuidelineSet.cs
- UndoEngine.cs
- ListMarkerLine.cs
- SourceFilter.cs
- CategoryNameCollection.cs
- ScriptControlManager.cs
- Mappings.cs
- TextFindEngine.cs
- ILGenerator.cs
- BamlBinaryWriter.cs
- RawContentTypeMapper.cs
- odbcmetadatacolumnnames.cs
- SafeNativeMethods.cs
- TimeoutException.cs
- NonVisualControlAttribute.cs
- WebSysDisplayNameAttribute.cs
- XPathChildIterator.cs
- DiscoveryClientOutputChannel.cs
- QilInvoke.cs
- IntSumAggregationOperator.cs
- TransferMode.cs
- XmlSchemaExternal.cs
- WebPartDeleteVerb.cs
- Number.cs
- FacetDescriptionElement.cs
- ColorPalette.cs
- ParallelDesigner.xaml.cs
- LoadItemsEventArgs.cs
- PropertyInformationCollection.cs
- ConditionalDesigner.cs
- BridgeDataRecord.cs
- EntityParameterCollection.cs
- WorkflowApplicationCompletedEventArgs.cs
- RegistryKey.cs
- ChannelSettingsElement.cs
- HttpContext.cs
- BufferBuilder.cs
- CharKeyFrameCollection.cs
- Authorization.cs