You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
eglib
external
ikvm-native
libgc
llvm
m4
man
mcs
build
class
Accessibility
Commons.Xml.Relaxng
Cscompmgd
CustomMarshalers
Facades
I18N
IBM.Data.DB2
ICSharpCode.SharpZipLib
Microsoft.Build
Microsoft.Build.Engine
Microsoft.Build.Framework
Microsoft.Build.Tasks
Microsoft.Build.Utilities
Microsoft.CSharp
Microsoft.NuGet.Build.Tasks
Microsoft.VisualC
Microsoft.Web.Infrastructure
MicrosoftAjaxLibrary
Mono.Btls.Interface
Mono.C5
Mono.CSharp
Mono.Cairo
Mono.Cecil
Mono.Cecil.Mdb
Mono.CodeContracts
Mono.CompilerServices.SymbolWriter
Mono.Data.Sqlite
Mono.Data.Tds
Mono.Debugger.Soft
Mono.Dynamic.Interpreter
Mono.Http
Mono.Management
Mono.Messaging
Mono.Messaging.RabbitMQ
Mono.Options
Mono.Parallel
Mono.Posix
Mono.Security
Mono.Security.Win32
Mono.Simd
Mono.Tasklets
Mono.WebBrowser
Mono.XBuild.Tasks
Novell.Directory.Ldap
PEAPI
RabbitMQ.Client
SMDiagnostics
System
System.ComponentModel.Composition.4.5
System.ComponentModel.DataAnnotations
System.Configuration
System.Configuration.Install
System.Core
System.Data
System.Data.DataSetExtensions
System.Data.Entity
System.Data.Linq
System.Data.OracleClient
System.Data.Services
System.Data.Services.Client
System.Deployment
System.Design
System.DirectoryServices
System.DirectoryServices.Protocols
System.Drawing
System.Drawing.Design
System.Dynamic
System.EnterpriseServices
System.IO.Compression
System.IO.Compression.FileSystem
System.IdentityModel
System.IdentityModel.Selectors
System.Json
System.Json.Microsoft
System.Management
System.Messaging
System.Net
System.Net.Http
System.Net.Http.Formatting
System.Net.Http.WebRequest
System.Net.Http.WinHttpHandler
System.Numerics
System.Numerics.Vectors
System.Reactive.Core
System.Reactive.Debugger
System.Reactive.Experimental
System.Reactive.Interfaces
System.Reactive.Linq
System.Reactive.Observable.Aliases
System.Reactive.PlatformServices
System.Reactive.Providers
System.Reactive.Runtime.Remoting
System.Reactive.Windows.Forms
System.Reactive.Windows.Threading
System.Reflection.Context
System.Reflection.DispatchProxy
System.Runtime.Caching
System.Runtime.DurableInstancing
System.Runtime.InteropServices.RuntimeInformation
System.Runtime.Remoting
System.Runtime.Serialization
System.Runtime.Serialization.Formatters.Soap
System.Security
System.ServiceModel
System.ServiceModel.Activation
System.ServiceModel.Discovery
System.ServiceModel.Internals
System.ServiceModel.Routing
System.ServiceModel.Web
System.ServiceProcess
System.Threading.Tasks.Dataflow
Assembly
CoreFxSources
Base
DataflowBlock.cs.REMOVED.git-id
DataflowBlockOptions.cs
DataflowLinkOptions.cs
DataflowMessageHeader.cs
DataflowMessageStatus.cs
IDataflowBlock.cs
IPropagatorBlock.cs
IReceivableSourceBlock.cs
ISourceBlock.cs
ITargetBlock.cs
Blocks
Internal
Test
Makefile
README.md
SR.cs
System.Threading.Tasks.Dataflow.dll.sources
System.Threading.Tasks.Dataflow_test.dll.sources
System.Transactions
System.Web
System.Web.Abstractions
System.Web.ApplicationServices
System.Web.DynamicData
System.Web.Extensions
System.Web.Extensions.Design
System.Web.Http
System.Web.Http.SelfHost
System.Web.Http.WebHost
System.Web.Mobile
System.Web.Mvc3
System.Web.Razor
System.Web.RegularExpressions
System.Web.Routing
System.Web.Services
System.Web.WebPages
System.Web.WebPages.Deployment
System.Web.WebPages.Razor
System.Windows
System.Windows.Forms
System.Windows.Forms.DataVisualization
System.Workflow.Activities
System.Workflow.ComponentModel
System.Workflow.Runtime
System.XML
System.Xaml
System.Xml.Linq
System.Xml.Serialization
System.Xml.XPath.XmlDocument
SystemWebTestShim
WebMatrix.Data
WindowsBase
aot-compiler
corlib
dlr
doc
legacy
lib
monodoc
notes
reference-assemblies
referencesource
test-helpers
LICENSE
Makefile
README
ecma.pub
mono.pub
mono.snk
msfinal.pub
reactive.pub
silverlight.pub
winfx.pub
winfx3.pub
docs
errors
ilasm
jay
mcs
nunit24
tests
tools
AUTHORS
COPYING
INSTALL.txt
Makefile
MonoIcon.png
README
ScalableMonoIcon.svg
mkinstalldirs
winexe.in
mono
msvc
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
93 lines
4.5 KiB
C#
93 lines
4.5 KiB
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
// =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
|
|
//
|
|
// DataflowMessageHeader.cs
|
|
//
|
|
//
|
|
// A container of data attributes passed between dataflow blocks.
|
|
//
|
|
// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|
|
|
|
using System.Diagnostics;
|
|
using System.Diagnostics.Contracts;
|
|
using System.Threading.Tasks.Dataflow.Internal;
|
|
|
|
namespace System.Threading.Tasks.Dataflow
|
|
{
|
|
/// <summary>Provides a container of data attributes for passing between dataflow blocks.</summary>
|
|
[DebuggerDisplay("Id = {Id}")]
|
|
public struct DataflowMessageHeader : IEquatable<DataflowMessageHeader>
|
|
{
|
|
/// <summary>The message ID. Needs to be unique within the source.</summary>
|
|
private readonly long _id;
|
|
|
|
/// <summary>Initializes the <see cref="DataflowMessageHeader"/> with the specified attributes.</summary>
|
|
/// <param name="id">The ID of the message. Must be unique within the originating source block. Need not be globally unique.</param>
|
|
public DataflowMessageHeader(Int64 id)
|
|
{
|
|
if (id == default(long)) throw new ArgumentException(SR.Argument_InvalidMessageId, "id");
|
|
Contract.EndContractBlock();
|
|
|
|
_id = id;
|
|
}
|
|
|
|
/// <summary>Gets the validity of the message.</summary>
|
|
/// <returns>True if the ID of the message is different from 0. False if the ID of the message is 0</returns>
|
|
public Boolean IsValid { get { return _id != default(long); } }
|
|
|
|
/// <summary>Gets the ID of the message within the source.</summary>
|
|
/// <returns>The ID contained in the <see cref="DataflowMessageHeader"/> instance.</returns>
|
|
public Int64 Id { get { return _id; } }
|
|
|
|
// These overrides are required by the FX API Guidelines.
|
|
// NOTE: When these overrides are present, the compiler doesn't complain about statements
|
|
// like 'if (struct == null) ...' which will result in incorrect behavior at runtime.
|
|
// The product code should not use them. Instead, it should compare the Id properties.
|
|
// To verify that, every once in a while, comment out this region and build the product.
|
|
#region Comparison Operators
|
|
/// <summary>Checks two <see cref="DataflowMessageHeader"/> instances for equality by ID without boxing.</summary>
|
|
/// <param name="other">Another <see cref="DataflowMessageHeader"/> instance.</param>
|
|
/// <returns>True if the instances are equal. False otherwise.</returns>
|
|
public bool Equals(DataflowMessageHeader other)
|
|
{
|
|
return this == other;
|
|
}
|
|
|
|
/// <summary>Checks boxed <see cref="DataflowMessageHeader"/> instances for equality by ID.</summary>
|
|
/// <param name="obj">A boxed <see cref="DataflowMessageHeader"/> instance.</param>
|
|
/// <returns>True if the instances are equal. False otherwise.</returns>
|
|
public override bool Equals(object obj)
|
|
{
|
|
return obj is DataflowMessageHeader && this == (DataflowMessageHeader)obj;
|
|
}
|
|
|
|
/// <summary>Generates a hash code for the <see cref="DataflowMessageHeader"/> instance.</summary>
|
|
/// <returns>Hash code.</returns>
|
|
public override int GetHashCode()
|
|
{
|
|
return (int)Id;
|
|
}
|
|
|
|
/// <summary>Checks two <see cref="DataflowMessageHeader"/> instances for equality by ID.</summary>
|
|
/// <param name="left">A <see cref="DataflowMessageHeader"/> instance.</param>
|
|
/// <param name="right">A <see cref="DataflowMessageHeader"/> instance.</param>
|
|
/// <returns>True if the instances are equal. False otherwise.</returns>
|
|
public static bool operator ==(DataflowMessageHeader left, DataflowMessageHeader right)
|
|
{
|
|
return left.Id == right.Id;
|
|
}
|
|
|
|
/// <summary>Checks two <see cref="DataflowMessageHeader"/> instances for non-equality by ID.</summary>
|
|
/// <param name="left">A <see cref="DataflowMessageHeader"/> instance.</param>
|
|
/// <param name="right">A <see cref="DataflowMessageHeader"/> instance.</param>
|
|
/// <returns>True if the instances are not equal. False otherwise.</returns>
|
|
public static bool operator !=(DataflowMessageHeader left, DataflowMessageHeader right)
|
|
{
|
|
return left.Id != right.Id;
|
|
}
|
|
#endregion
|
|
}
|
|
}
|