Interface ByteClockedSignalSource

All Superinterfaces:
AbstractClockedSignalSource, AbstractSignalSource, ByteSignalSource, ByteSupplier, Component, Process
All Known Implementing Classes:
ByteClockedSignalSource.AbstractRandom, ByteDelay, ByteMultiDelay, ByteProcessMux, ByteSaH, ByteStoredSignalSource

@Generated(generator="eu.bandm.tools.expander", version="1.3.1", timestamp="2026-10-23T14:02:06") public interface ByteClockedSignalSource extends ByteSignalSource, AbstractClockedSignalSource
Interface of a signal source of primitive type byte whose observable state is driven by a clock.

This interface excludes signal sources whose state changes asynchronously, but is neutral with respect to whether values are computed on the fly when demanded, or stored when available and then just retrieved.

The operation of the driving clock works as specified by the Process superinterface. For example, a main loop may use the following pattern:

 RealtimeContext rc = ...;
 ByteClockedSignalSource c = ...;
 c.setRealtimeContext(rc);
 c.init();
 while (...) {
   c.step();
   byte v = c.getAsByte();
   ...
 }
 

Every iteration of the main loop increases the clock index of the component c. The behavior of instances of this interface is typically specified in terms of the current clock index.

See Also:
  • Method Details

    • after

      default ByteClockedSignalSource after(Process... slaves)
    • during

      default ByteClockedSignalSource during(Register outer)
    • adHoc

      static ByteClockedSignalSource adHoc(byte... elems)
      Returns a new signal source that produces the given values, one per clock tick.

      After the given values are exhausted, that is after as many clock ticks as there are elements in the array, the default value of the element type is held indefinitely.

      At clock index n, this.getAsByte() == (n < elems.length ? elems[n] : (byte)0) holds.

      Parameters:
      elems - the array of values to produce
    • cycle

      static ByteClockedSignalSource cycle(byte... elems)
      Returns a new signal source that produces the given values repeatedly, one per clock tick.

      When the given values are exhausted the iteration starts over.

      At clock index n, this.getAsByte() == elems[n % elems.length] holds.

      Parameters:
      elems - the array of values to produce
    • count

      static ByteClockedSignalSource count(byte from)
      Returns a new signal source whose value increases by one at every clock tick.

      Initialization resets the value to the given initial value.

      At clock index n, this.getAsByte() == from + n holds.

      Parameters:
      from - the value at the first clock tick after initialization
    • countdown

      static ByteClockedSignalSource countdown(byte from)
      Returns a new signal source whose value decreases by one at every clock tick. The value stops at zero, and does not decrease further to become negative.

      Initialization resets the value to the given initial value.

      At clock index n, this.getAsByte() == Math.max(from - n, 0) holds.

      Parameters:
      from - the value at the first clock tick after initialization
      Throws:
      IllegalArgumentException - if from is negative
    • dt

    • random

      @Undocumented static ByteClockedSignalSource random(long seed)
    • random

    • random

    • drain

      default void drain(RealtimeContext rc, byte[] buffer)
      Write elements from this signal source to a buffer.

      Invoking this method as drain(rc, b) is equivalent to invoking drain(rc, b, 0, b.length).

      Parameters:
      rc - the realtime context
      buffer - the buffer to write to
      See Also:
    • drain

      default void drain(RealtimeContext rc, byte[] buffer, int offset, int length)
      Write elements from this signal source to a buffer.

      This method first invokes Process.setRealtimeContext(RealtimeContext) and Process.init() to put this signal source in a deterministic initial state. Then it iterates Process.step() and ByteSignalSource.getAsByte() in turn to obtain successive values to write into the buffer.

      Invalid uses that would cause write access outside the bounds of the buffer are detected late; all preceding valid effects occur before an exception is thrown.

      Parameters:
      rc - the realtime context
      buffer - the buffer to write to
      offset - the first index to write to
      length - the number of values to write
      Throws:
      NullPointerException - is buffer is null
      IllegalArgumentException - if length is negative
      ArrayIndexOutOfBoundsException - if offset < 0 or offset + length > buffer.length