Ejemplo n.º 1
0
 public Node(NodeIdentifier id, NodePosition position, NodeQueue queue, NodePortSet ports)
 {
     Id       = id ?? throw new ArgumentNullException(nameof(id));
     Position = position ?? throw new ArgumentNullException(nameof(position));
     Queue    = queue ?? throw new ArgumentNullException(nameof(queue));
     Ports    = ports ?? throw new ArgumentNullException(nameof(ports));
 }
Ejemplo n.º 2
0
 public PortAssigned(NodeIdentifier nodeId, PortDirection port, LinkIdentifier linkId, ConnectionDirection direction)
 {
     NodeId    = nodeId ?? throw new System.ArgumentNullException(nameof(nodeId));
     Port      = port;
     LinkId    = linkId ?? throw new System.ArgumentNullException(nameof(linkId));
     Direction = direction;
 }
Ejemplo n.º 3
0
 public LinkNodes(NodeIdentifier source, PortDirection sourcePort, NodeIdentifier sink, PortDirection sinkPort, LinkAttributes attributes)
 {
     Source     = source ?? throw new System.ArgumentNullException(nameof(source));
     SourcePort = sourcePort;
     Sink       = sink ?? throw new System.ArgumentNullException(nameof(sink));
     SinkPort   = sinkPort;
     Attributes = attributes;
 }
Ejemplo n.º 4
0
 public Link(LinkIdentifier id, NodeIdentifier source, NodeIdentifier sink, LinkAttributes attributes, ImmutableList <PacketIdentifier> content)
 {
     Id         = id ?? throw new ArgumentNullException(nameof(id));
     Source     = source ?? throw new ArgumentNullException(nameof(source));
     Sink       = sink ?? throw new ArgumentNullException(nameof(sink));
     Attributes = attributes ?? throw new ArgumentNullException(nameof(attributes));
     Content    = content ?? throw new ArgumentNullException(nameof(content));
 }
Ejemplo n.º 5
0
        private void RecordDequeueAndTransmit(NodeIdentifier nodeId, PacketIdentifier packetId, LinkIdentifier linkId)
        {
            Record(new NetworkEvent.PacketDequeued(nodeId));

            Record(new NetworkEvent.PacketTransmissionStarted(packetId, linkId));
        }
Ejemplo n.º 6
0
 public Consumer(NodeIdentifier id, NodePosition position, NodeQueue queue, NodePortSet ports) : base(id, position, queue, ports)
 {
 }
Ejemplo n.º 7
0
 public Gateway(NodeIdentifier id, NodePosition position, NodeQueue queue, NodePortSet ports) : base(id, position, queue, ports)
 {
 }
Ejemplo n.º 8
0
 public PacketTypeDirectionChanged(NodeIdentifier nodeId, PacketType packetType, PortDirection port)
 {
     NodeId     = nodeId ?? throw new System.ArgumentNullException(nameof(nodeId));
     PacketType = packetType;
     Port       = port;
 }
Ejemplo n.º 9
0
 public PacketDequeued(NodeIdentifier nodeId)
 {
     NodeId = nodeId ?? throw new System.ArgumentNullException(nameof(nodeId));
 }
Ejemplo n.º 10
0
 public PacketEnqueued(PacketIdentifier packetId, NodeIdentifier nodeId)
 {
     PacketId = packetId ?? throw new System.ArgumentNullException(nameof(packetId));
     NodeId   = nodeId ?? throw new System.ArgumentNullException(nameof(nodeId));
 }
Ejemplo n.º 11
0
        private void EnqueuePacked(PacketIdentifier packetId, NodeIdentifier nodeId)
        {
            var node = _nodes[nodeId];

            _nodes[node.Id] = node.With(queue: q => q.Enqueue(packetId));
        }
Ejemplo n.º 12
0
        private void DequeuePacket(NodeIdentifier nodeId)
        {
            var node = _nodes[nodeId];

            _nodes[node.Id] = node.With(queue: q => q.Dequeue());
        }
Ejemplo n.º 13
0
 public Router(NodeIdentifier id, NodePosition position, NodeQueue queue, NodePortSet ports, RouterState state) : base(id, position, queue, ports)
 {
     State = state ?? throw new ArgumentNullException(nameof(state));
 }
Ejemplo n.º 14
0
 public AddConsumerNode(NodeIdentifier nodeId, NodePosition position, int capacity)
 {
     NodeId   = nodeId ?? throw new System.ArgumentNullException(nameof(nodeId));
     Position = position ?? throw new System.ArgumentNullException(nameof(position));
     Capacity = capacity;
 }
Ejemplo n.º 15
0
 public ProcessNodeQueue(NodeIdentifier nodeId)
 {
     NodeId = nodeId ?? throw new System.ArgumentNullException(nameof(nodeId));
 }
Ejemplo n.º 16
0
 public IncrementPacketTypeDirection(NodeIdentifier nodeId, PacketType packetType)
 {
     NodeId     = nodeId ?? throw new System.ArgumentNullException(nameof(nodeId));
     PacketType = packetType;
 }
Ejemplo n.º 17
0
 public AddPacket(PacketIdentifier packedId, PacketType type, NodeIdentifier node)
 {
     PackedId = packedId ?? throw new System.ArgumentNullException(nameof(packedId));
     Type     = type;
     NodeId   = node ?? throw new System.ArgumentNullException(nameof(node));
 }