Search Results for

    Show / Hide Table of Contents

    Class MessageDomain

    The time domain the message is operating in.

    Inheritance
    Object
    MessageDomain
    Namespace: Agents.Net
    Assembly: Agents.Net.dll
    Syntax
    public class MessageDomain : IEquatable<MessageDomain>
    Remarks

    Each message operates in a specific message domain. Usually that is the DefaultMessageDomain. But there are situations where it is necessary to specify new domains for a message. Some of these situations are:

    • when message are executed explicitly in parallel with OnMessages(IReadOnlyCollection<Message>) in order to aggregate them again
    • when a sequential cycle of recurring message chains is executed in order to identify the start of the cycle when the next cycle starts
    • to separate message produced in a specific chain (e.g. UIEvent) from other messages

    Given is the following example:

     ---------------         ------------
    | DefaultDomain | ----> | SubDomain1 |
     ---------------  |      ------------
    T1 Message1       |      T1 Message2
                      |      T2 Message4
                      |
                      |      ------------
                      ----> | SubDomain2 |
                             ------------
                             T2 Message3
                             T2 Message5
    Message2 and Message4 should never be used in SubDomain2 as well as Message3 and Message5 should never be used in SubDomain1. But Message1 is accessible from all domains. The MessageCollector<T1, T2> implements these rules.

    New messages inherit the domain for their predecessors. That means if there is a new message based on the messages Message1 and Message4 it is automatically in the SubDomain1 as long as that domain is still active. Trying to create a new message based on the messages Message2 and Message3 will result in an exception as these are sibling domains which cannot interfere with each other.

    Properties

    | Improve this Doc View Source

    Children

    The child domains that were created in this domain.

    Declaration
    public IReadOnlyCollection<MessageDomain> Children { get; }
    Property Value
    Type Description
    IReadOnlyCollection<MessageDomain>
    | Improve this Doc View Source

    DefaultMessageDomain

    The default message domain for all new messages.

    Declaration
    public static MessageDomain DefaultMessageDomain { get; }
    Property Value
    Type Description
    MessageDomain
    | Improve this Doc View Source

    IsTerminated

    If set to true, shows that the domain was terminated.

    Declaration
    public bool IsTerminated { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Parent

    The parent domain.

    Declaration
    public MessageDomain Parent { get; }
    Property Value
    Type Description
    MessageDomain
    | Improve this Doc View Source

    Root

    The first message of the domain.

    Declaration
    public Message Root { get; }
    Property Value
    Type Description
    Message
    | Improve this Doc View Source

    SiblingDomainRootMessages

    The root messages of all message domains that were created together with this domain.

    Declaration
    public IReadOnlyCollection<Message> SiblingDomainRootMessages { get; }
    Property Value
    Type Description
    IReadOnlyCollection<Message>
    Remarks

    There can be more sibling domains active. This will only contain all sibling domains that were created with the CreateNewDomainsFor(IReadOnlyCollection<Message>) method.

    Methods

    | Improve this Doc View Source

    CreateNewDomainsFor(Message)

    Create a new domain for the newDomainRootMessage.

    Declaration
    public static void CreateNewDomainsFor(Message newDomainRootMessage)
    Parameters
    Type Name Description
    Message newDomainRootMessage

    The first message in the new domain.

    | Improve this Doc View Source

    CreateNewDomainsFor(IReadOnlyCollection<Message>)

    Create a new domain for each of the newDomainRootMessages.

    Declaration
    public static void CreateNewDomainsFor(IReadOnlyCollection<Message> newDomainRootMessages)
    Parameters
    Type Name Description
    IReadOnlyCollection<Message> newDomainRootMessages

    The first messages in the new domains.

    | Improve this Doc View Source

    Equals(MessageDomain)

    Declaration
    public bool Equals(MessageDomain other)
    Parameters
    Type Name Description
    MessageDomain other
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    Int32
    | Improve this Doc View Source

    TerminateDomainsOf(Message)

    Sets the domain of domainMessage to inactive.

    Declaration
    public static void TerminateDomainsOf(Message domainMessage)
    Parameters
    Type Name Description
    Message domainMessage

    The message which provides the terminated domain.

    | Improve this Doc View Source

    TerminateDomainsOf(IReadOnlyCollection<Message>)

    Sets the domain of all domainMessages to inactive.

    Declaration
    public static void TerminateDomainsOf(IReadOnlyCollection<Message> domainMessages)
    Parameters
    Type Name Description
    IReadOnlyCollection<Message> domainMessages

    The messages which provides the terminated domains.

    Operators

    | Improve this Doc View Source

    Equality(MessageDomain, MessageDomain)

    Checks whether both domains are equal.

    Declaration
    public static bool operator ==(MessageDomain left, MessageDomain right)
    Parameters
    Type Name Description
    MessageDomain left

    The first domain.

    MessageDomain right

    The second domain.

    Returns
    Type Description
    Boolean

    true, if the domains are equal; otherwise false.

    | Improve this Doc View Source

    Inequality(MessageDomain, MessageDomain)

    Checks whether both domains are not equal.

    Declaration
    public static bool operator !=(MessageDomain left, MessageDomain right)
    Parameters
    Type Name Description
    MessageDomain left

    The first domain.

    MessageDomain right

    The second domain.

    Returns
    Type Description
    Boolean

    true, if the domains are not equal; otherwise false.

    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright Tobias Wilker and contributors