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
- HttpRawResponse.cs
- NumericUpDownAcceleration.cs
- SerializationTrace.cs
- DataGridViewRowErrorTextNeededEventArgs.cs
- SecUtil.cs
- TreeViewItemAutomationPeer.cs
- ClientTargetCollection.cs
- DataGridViewCellToolTipTextNeededEventArgs.cs
- WsdlServiceChannelBuilder.cs
- DBCSCodePageEncoding.cs
- ResourceAssociationSetEnd.cs
- MD5.cs
- LineServicesRun.cs
- TreeIterator.cs
- ReadOnlyDictionary.cs
- DbProviderServices.cs
- RectAnimation.cs
- SystemIcmpV4Statistics.cs
- ProxyHwnd.cs
- EmptyControlCollection.cs
- BackgroundFormatInfo.cs
- ContentElementAutomationPeer.cs
- PublishLicense.cs
- WindowsFormsLinkLabel.cs
- DbProviderServices.cs
- QueryHandler.cs
- NamedPermissionSet.cs
- GeometryModel3D.cs
- XsltSettings.cs
- SortDescriptionCollection.cs
- SystemWebCachingSectionGroup.cs
- AuthenticatingEventArgs.cs
- rsa.cs
- WebPartZoneBaseDesigner.cs
- TreeViewItemAutomationPeer.cs
- VectorAnimation.cs
- HashMembershipCondition.cs
- TdsParserSafeHandles.cs
- TextEffectCollection.cs
- RadioButtonFlatAdapter.cs
- Attributes.cs
- FontStyle.cs
- FileDetails.cs
- versioninfo.cs
- UseAttributeSetsAction.cs
- GeneralTransform2DTo3D.cs
- RuntimeTrackingProfile.cs
- Screen.cs
- TextServicesLoader.cs
- ParameterBuilder.cs
- recordstatefactory.cs
- ProxyWebPart.cs
- Lasso.cs
- SiteMapNodeCollection.cs
- WindowsRegion.cs
- UTF8Encoding.cs
- NullableDecimalSumAggregationOperator.cs
- CfgRule.cs
- VirtualPathUtility.cs
- FilteredDataSetHelper.cs
- BitmapImage.cs
- CodeLabeledStatement.cs
- IIS7WorkerRequest.cs
- Rectangle.cs
- DefaultTraceListener.cs
- SHA1Managed.cs
- CodeStatementCollection.cs
- ActivityBindForm.cs
- MachineKeySection.cs
- DBPropSet.cs
- EqualityComparer.cs
- TypeNameParser.cs
- FixUp.cs
- SystemMulticastIPAddressInformation.cs
- EndOfStreamException.cs
- AndCondition.cs
- ImageKeyConverter.cs
- filewebresponse.cs
- PermissionSet.cs
- VisualBrush.cs
- DurableInstanceContextProvider.cs
- ToolStripPanelDesigner.cs
- Effect.cs
- LeafCellTreeNode.cs
- PieceDirectory.cs
- Selector.cs
- DNS.cs
- ExceptionHandlersDesigner.cs
- XmlUtf8RawTextWriter.cs
- VisualStyleTypesAndProperties.cs
- LoadRetryAsyncResult.cs
- SoapIgnoreAttribute.cs
- ImageCodecInfo.cs
- IsolationInterop.cs
- NgenServicingAttributes.cs
- RijndaelManagedTransform.cs
- Point3DCollection.cs
- IndexingContentUnit.cs
- RtfToken.cs
- HtmlMeta.cs