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
- AxisAngleRotation3D.cs
- NativeMethods.cs
- DbProviderFactoriesConfigurationHandler.cs
- DBCommand.cs
- ConfigurationValidatorBase.cs
- HttpResponseHeader.cs
- TypefaceMap.cs
- RuntimeWrappedException.cs
- ValidateNames.cs
- ConfigViewGenerator.cs
- SoapRpcMethodAttribute.cs
- ByteStorage.cs
- DataServiceQuery.cs
- XmlIlVisitor.cs
- FillErrorEventArgs.cs
- ItemMap.cs
- HttpProfileBase.cs
- ThaiBuddhistCalendar.cs
- wmiprovider.cs
- StatusBar.cs
- ConnectionProviderAttribute.cs
- HostingEnvironmentSection.cs
- ListViewItem.cs
- DisplayNameAttribute.cs
- ConfigUtil.cs
- AccessControlList.cs
- WSDualHttpBinding.cs
- NameValueConfigurationElement.cs
- SqlConnectionPoolProviderInfo.cs
- XmlElementList.cs
- HitTestDrawingContextWalker.cs
- cookieexception.cs
- __Filters.cs
- ZipFileInfoCollection.cs
- TraceContextEventArgs.cs
- EncodingTable.cs
- GridProviderWrapper.cs
- EllipticalNodeOperations.cs
- ImageClickEventArgs.cs
- ProfileSettingsCollection.cs
- Button.cs
- FormatControl.cs
- MarkupExtensionReturnTypeAttribute.cs
- QueryOperatorEnumerator.cs
- AffineTransform3D.cs
- GenericTextProperties.cs
- CustomDictionarySources.cs
- Rights.cs
- ProfileGroupSettings.cs
- WaveHeader.cs
- GestureRecognizer.cs
- Timer.cs
- DrawingContextWalker.cs
- ToolConsole.cs
- ExecutionContext.cs
- LZCodec.cs
- X509SecurityTokenProvider.cs
- RoleManagerSection.cs
- ConfigXmlSignificantWhitespace.cs
- DesignerDataConnection.cs
- HelpEvent.cs
- SafeUserTokenHandle.cs
- ComponentCommands.cs
- DiscriminatorMap.cs
- ListBindingHelper.cs
- StructuredType.cs
- BindingElementExtensionElement.cs
- NamespaceEmitter.cs
- Serializer.cs
- Point.cs
- XmlSchemaExternal.cs
- DiscoveryMessageSequenceGenerator.cs
- Base64Encoder.cs
- UriTemplateVariablePathSegment.cs
- SettingsPropertyCollection.cs
- ConnectionPoolManager.cs
- ProcessManager.cs
- MSAAEventDispatcher.cs
- TextAnchor.cs
- SizeConverter.cs
- StaticResourceExtension.cs
- Operator.cs
- X509Certificate2Collection.cs
- WmpBitmapDecoder.cs
- DataPagerFieldCollection.cs
- DataGridRowClipboardEventArgs.cs
- SignatureDescription.cs
- ConnectionPoint.cs
- LinqDataSourceHelper.cs
- PersistenceTypeAttribute.cs
- PropertyChangedEventManager.cs
- FormViewDeleteEventArgs.cs
- ConstructorBuilder.cs
- _UriTypeConverter.cs
- ListBoxAutomationPeer.cs
- SqlDependency.cs
- ConstantCheck.cs
- ComponentChangingEvent.cs
- PointLight.cs
- AxDesigner.cs