Code:
/ 4.0 / 4.0 / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / clr / src / BCL / System / Collections / Concurrent / Partitioner.cs / 1305376 / Partitioner.cs
// ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // Partitioner.cs // //[....] // // Represents a particular way of splitting a collection into multiple partitions. // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System; using System.Collections.Generic; using System.Security.Permissions; using System.Threading; namespace System.Collections.Concurrent { ////// Represents a particular manner of splitting a data source into multiple partitions. /// ///Type of the elements in the collection. ////// [HostProtection(Synchronization = true, ExternalThreading = true)] public abstract class Partitioner/// Inheritors of ///must adhere to the following rules: /// ///
///- ///
should throw a /// if the requested partition count is less than or /// equal to zero. - ///
should always return a number of enumerables equal to the requested /// partition count. If the partitioner runs out of data and cannot create as many partitions as /// requested, an empty enumerator should be returned for each of the remaining partitions. If this rule /// is not followed, consumers of the implementation may throw a . - ///
and /// should never return null. If null is returned, a consumer of the implementation may throw a /// . - ///
and should always return /// partitions that can fully and uniquely enumerate the input data source. All of the data and only the /// data contained in the input source should be enumerated, with no duplication that was not already in /// the input, unless specifically required by the particular partitioner's design. If this is not /// followed, the output ordering may be scrambled. { /// /// Partitions the underlying collection into the given number of partitions. /// /// The number of partitions to create. ///A list containing public abstract IListenumerators. > GetPartitions(int partitionCount); /// /// Gets whether additional partitions can be created dynamically. /// ////// true if the ///can create partitions dynamically as they are /// requested; false if the can only allocate /// partitions statically. /// /// public virtual bool SupportsDynamicPartitions { get { return false; } } ////// If a derived class does not override and implement ///, /// should return false. The value of should not vary over the lifetime of this instance. /// /// Creates an object that can partition the underlying collection into a variable number of /// partitions. /// ////// ////// The returned object implements the ///interface. Calling GetEnumerator on the /// object creates another partition over the sequence. ////// The ///method is only supported if the /// property returns true. /// An object that can create partitions over the underlying data source. ///Dynamic partitioning is not supported by this /// partitioner. public virtual IEnumerableGetDynamicPartitions() { throw new NotSupportedException(Environment.GetResourceString("Partitioner_DynamicPartitionsNotSupported")); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // ==++== // // Copyright (c) Microsoft Corporation. All rights reserved. // // ==--== // =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ // // Partitioner.cs // // [....] // // Represents a particular way of splitting a collection into multiple partitions. // // =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- using System; using System.Collections.Generic; using System.Security.Permissions; using System.Threading; namespace System.Collections.Concurrent { ////// Represents a particular manner of splitting a data source into multiple partitions. /// ///Type of the elements in the collection. ////// [HostProtection(Synchronization = true, ExternalThreading = true)] public abstract class Partitioner/// Inheritors of ///must adhere to the following rules: /// ///
///- ///
should throw a /// if the requested partition count is less than or /// equal to zero. - ///
should always return a number of enumerables equal to the requested /// partition count. If the partitioner runs out of data and cannot create as many partitions as /// requested, an empty enumerator should be returned for each of the remaining partitions. If this rule /// is not followed, consumers of the implementation may throw a . - ///
and /// should never return null. If null is returned, a consumer of the implementation may throw a /// . - ///
and should always return /// partitions that can fully and uniquely enumerate the input data source. All of the data and only the /// data contained in the input source should be enumerated, with no duplication that was not already in /// the input, unless specifically required by the particular partitioner's design. If this is not /// followed, the output ordering may be scrambled. { /// /// Partitions the underlying collection into the given number of partitions. /// /// The number of partitions to create. ///A list containing public abstract IListenumerators. > GetPartitions(int partitionCount); /// /// Gets whether additional partitions can be created dynamically. /// ////// true if the ///can create partitions dynamically as they are /// requested; false if the can only allocate /// partitions statically. /// /// public virtual bool SupportsDynamicPartitions { get { return false; } } ////// If a derived class does not override and implement ///, /// should return false. The value of should not vary over the lifetime of this instance. /// /// Creates an object that can partition the underlying collection into a variable number of /// partitions. /// ////// ////// The returned object implements the ///interface. Calling GetEnumerator on the /// object creates another partition over the sequence. ////// The ///method is only supported if the /// property returns true. /// An object that can create partitions over the underlying data source. ///Dynamic partitioning is not supported by this /// partitioner. public virtual IEnumerableGetDynamicPartitions() { throw new NotSupportedException(Environment.GetResourceString("Partitioner_DynamicPartitionsNotSupported")); } } } // 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
- PropertyChangingEventArgs.cs
- SpecialNameAttribute.cs
- TagPrefixInfo.cs
- XmlnsCompatibleWithAttribute.cs
- XPathDescendantIterator.cs
- WorkItem.cs
- PointAnimationClockResource.cs
- DataContractSerializerServiceBehavior.cs
- DataGridViewAutoSizeColumnModeEventArgs.cs
- DeadCharTextComposition.cs
- CommentEmitter.cs
- EventHandlersStore.cs
- XPathPatternParser.cs
- ObjectConverter.cs
- UserControlParser.cs
- GridViewRowPresenter.cs
- PersistNameAttribute.cs
- basevalidator.cs
- LongPath.cs
- InstanceDataCollection.cs
- HtmlTableRowCollection.cs
- ListViewItemCollectionEditor.cs
- Privilege.cs
- BinaryUtilClasses.cs
- DataGridViewAddColumnDialog.cs
- KeyProperty.cs
- PathData.cs
- ObjectItemLoadingSessionData.cs
- LinkedResource.cs
- NoneExcludedImageIndexConverter.cs
- SelectionItemPattern.cs
- securitycriticaldataformultiplegetandset.cs
- BitmapPalettes.cs
- TextSelectionHighlightLayer.cs
- HtmlButton.cs
- ListBindingConverter.cs
- DebuggerAttributes.cs
- Thumb.cs
- HotCommands.cs
- XmlDocument.cs
- PenThreadPool.cs
- SqlPersistenceWorkflowInstanceDescription.cs
- FixedDocumentPaginator.cs
- TextViewSelectionProcessor.cs
- ScrollViewerAutomationPeer.cs
- RadioButtonAutomationPeer.cs
- Site.cs
- PathSegmentCollection.cs
- OdbcUtils.cs
- NativeRecognizer.cs
- WorkflowQueuingService.cs
- SQLStringStorage.cs
- NameObjectCollectionBase.cs
- WorkflowServiceHostFactory.cs
- InfocardInteractiveChannelInitializer.cs
- mongolianshape.cs
- WorkflowApplicationCompletedEventArgs.cs
- MsmqDiagnostics.cs
- ExceptionHandlers.cs
- ImageDrawing.cs
- ZoomPercentageConverter.cs
- GeometryCombineModeValidation.cs
- QuaternionRotation3D.cs
- PropertyBuilder.cs
- CheckBoxBaseAdapter.cs
- BindingMAnagerBase.cs
- TaiwanLunisolarCalendar.cs
- FlowLayoutSettings.cs
- HttpListener.cs
- PackageDigitalSignature.cs
- RegisteredHiddenField.cs
- ImageButton.cs
- RequestCacheEntry.cs
- UserControlParser.cs
- NamedElement.cs
- AtomMaterializer.cs
- DataGridViewToolTip.cs
- ScrollProperties.cs
- SizeChangedInfo.cs
- MenuItemBinding.cs
- HttpContext.cs
- ZipIOCentralDirectoryFileHeader.cs
- RandomNumberGenerator.cs
- SQLUtility.cs
- FrugalList.cs
- ViewBox.cs
- SingleSelectRootGridEntry.cs
- InProcStateClientManager.cs
- PackWebRequest.cs
- WindowsListViewSubItem.cs
- RTLAwareMessageBox.cs
- CrossSiteScriptingValidation.cs
- SubclassTypeValidator.cs
- DataGridViewCellLinkedList.cs
- RIPEMD160.cs
- WindowsGraphics2.cs
- ScriptingSectionGroup.cs
- WebPermission.cs
- Brush.cs
- TypeLoadException.cs