Interface DeviceContext<DataType>

Type Parameters:
DataType - Type of data which can be transferred from/to this device
All Superinterfaces:
Context

public interface DeviceContext<DataType> extends Context
Device context of the device plugin. If the device supports more functionality, it can be extended. Device plugins can have multiple device contexts. Plugins which need the specific device contexts should declare a dependency on the device plugin.
  • Method Details

    • readData

      DataType readData()
      Read data from the device.

      From the CPU point of view, this should be an implementation of the "IN" operation. The device should return one elementary unit (e.g. byte) of its input data. I/O operations are considered as events that occurred onto this device.

      Returns:
      elementary data read from device
      Throws:
      RuntimeException - if something goes wrong
    • writeData

      void writeData(DataType value)
      Writes/sends data to the device.

      From the CPU point of view, this is what the "OUT" instruction should use. The device should accept one elementary unit (e.g. a byte) of the output data. I/O operations are considered as events that occurred within this device.

      Parameters:
      value - data to be written to the device
      Throws:
      RuntimeException - if something goes wrong
    • getDataType

      Class<DataType> getDataType()
      Get the type of transferred data.
      Returns:
      type of transferred data