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
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
ConstructorsConstructorDescriptionSpinnakerRequestReadData(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 TypeMethodDescriptionvoidaddToBuffer(ByteBuffer buffer) Writes this message into the given buffer as a contiguous range of bytes.intgetChannel(int ackID) Get the channel ID.intintgetP()intgetRegionID(int ackID) Get the region ID.intintgetSpaceRead(int ackID) Get the number of bytes to read.intgetStartAddress(int ackID) Get the start addresses to read from.intgetX()intgetY()Methods inherited from class uk.ac.manchester.spinnaker.messages.eieio.EIEIOCommandMessage
getHeader, minPacketLengthMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface uk.ac.manchester.spinnaker.machine.HasChipLocation
asChipLocation, getScampCore, onSameChipAsMethods 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:
getXin interfaceHasChipLocation
-
getY
public int getY()- Specified by:
getYin interfaceHasChipLocation
-
getP
public int getP()- Specified by:
getPin 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:SerializableMessageWrites 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:
addToBufferin interfaceSerializableMessage- Overrides:
addToBufferin classEIEIOCommandMessage- Parameters:
buffer- The buffer to write into.
-