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.
-
Nested Class Summary
Nested classes/interfaces inherited from class uk.ac.manchester.spinnaker.messages.eieio.EIEIOCommandMessage
EIEIOCommandMessage.Header
-
Constructor Summary
Constructors Constructor Description SpinnakerRequestReadData(HasCoreLocation core, int sequenceNum, int numRequests, int[] channel, int[] regionID, int[] startAddress, int[] spaceRead)
Create a message instance.SpinnakerRequestReadData(HasCoreLocation core, int sequenceNum, int channel, int regionID, int startAddress, int spaceRead)
Create a message instance about a single move. -
Method Summary
Modifier and Type Method Description void
addToBuffer(ByteBuffer buffer)
Writes this message into the given buffer as a contiguous range of bytes.int
getChannel(int ackID)
Get the channel ID.int
getNumRequests()
int
getP()
int
getRegionID(int ackID)
Get the region ID.int
getSequenceNumber()
int
getSpaceRead(int ackID)
Get the number of bytes to read.int
getStartAddress(int ackID)
Get the start addresses to read from.int
getX()
int
getY()
Methods inherited from class uk.ac.manchester.spinnaker.messages.eieio.EIEIOCommandMessage
getHeader, minPacketLength
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface uk.ac.manchester.spinnaker.machine.HasChipLocation
asChipLocation, getScampCore, onSameChipAs
Methods inherited from interface uk.ac.manchester.spinnaker.machine.HasCoreLocation
asCoreLocation, onSameCoreAs
-
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 interfaceHasChipLocation
-
getY
public int getY()- Specified by:
getY
in interfaceHasChipLocation
-
getP
public int getP()- Specified by:
getP
in interfaceHasCoreLocation
-
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
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 interfaceSerializableMessage
- Overrides:
addToBuffer
in classEIEIOCommandMessage
- Parameters:
buffer
- The buffer to write into.
-