Class SpinnakerRequestReadData

java.lang.Object
uk.ac.manchester.spinnaker.messages.eieio.EIEIOCommandMessage
uk.ac.manchester.spinnaker.messages.eieio.SpinnakerRequestReadData
All Implemented Interfaces:
HasChipLocation, HasCoreLocation, EIEIOMessage<EIEIOCommandMessage.Header>, SerializableMessage

public class SpinnakerRequestReadData
extends EIEIOCommandMessage
implements HasCoreLocation
Message used in the context of the buffering output mechanism which is sent from the SpiNNaker system to the host computer to signal that some data is available to be read.
  • Constructor Details

    • SpinnakerRequestReadData

      public SpinnakerRequestReadData​(HasCoreLocation core, int sequenceNum, int numRequests, int[] channel, int[] regionID, int[] startAddress, int[] spaceRead)
      Create a message instance.
      Parameters:
      core - The core talked about.
      sequenceNum - The message sequence number.
      numRequests - The expected number of requests.
      channel - The channel IDs.
      regionID - The region IDs.
      startAddress - The start addresses to read from.
      spaceRead - The number of bytes to read from each.
      Throws:
      IllegalArgumentException - if the number of channels, regionIDs, addresses and sizes don't match the number of requests.
    • SpinnakerRequestReadData

      public SpinnakerRequestReadData​(HasCoreLocation core, int sequenceNum, int channel, int regionID, int startAddress, int spaceRead)
      Create a message instance about a single move.
      Parameters:
      core - The core talked about.
      sequenceNum - The message sequence number.
      channel - The channel ID.
      regionID - The region ID.
      startAddress - The start address to read from.
      spaceRead - The number of bytes to read.
  • Method Details

    • getX

      public int getX()
      Specified by:
      getX in interface HasChipLocation
    • getY

      public int getY()
      Specified by:
      getY in interface HasChipLocation
    • getP

      public int getP()
      Specified by:
      getP in interface HasCoreLocation
    • getNumRequests

      public int getNumRequests()
      Returns:
      The number of requests in the message.
    • getSequenceNumber

      public int getSequenceNumber()
      Returns:
      The sequence number of the message.
    • getChannel

      public int getChannel​(int ackID)
      Get the channel ID.
      Parameters:
      ackID - Which acknowledgement.
      Returns:
      The channel ID.
    • getRegionID

      public int getRegionID​(int ackID)
      Get the region ID.
      Parameters:
      ackID - Which acknowledgement.
      Returns:
      The region ID.
    • getStartAddress

      public int getStartAddress​(int ackID)
      Get the start addresses to read from.
      Parameters:
      ackID - Which acknowledgement.
      Returns:
      The start addresses to read from.
    • getSpaceRead

      public int getSpaceRead​(int ackID)
      Get the number of bytes to read.
      Parameters:
      ackID - Which acknowledgement.
      Returns:
      The number of bytes to read.
    • addToBuffer

      public void addToBuffer​(ByteBuffer buffer)
      Description copied from interface: SerializableMessage
      Writes this message into the given buffer as a contiguous range of bytes. This is so that a message can be sent. Implementors may assume that the buffer has been configured to be little-endian and that its position is at the point where they should begin writing. Once it has finished, the position should be immediately after the last byte written by this method.

      Calling this method should not update the internal state of the message. It should be possible to add the message to multiple buffers without special precautions by the caller.

      Specified by:
      addToBuffer in interface SerializableMessage
      Overrides:
      addToBuffer in class EIEIOCommandMessage
      Parameters:
      buffer - The buffer to write into.