Class TaskState<T extends Serializable>

java.lang.Object
org.episteme.core.distributed.TaskState<T>
Type Parameters:
T - the type of the high-precision (REAL) state
All Implemented Interfaces:
Serializable

public class TaskState<T extends Serializable> extends Object implements Serializable
Manages data state across different precision modes (FLOAT, DOUBLE, REAL).

This class ensures that modifications in one precision mode are correctly propagated to others when needed, while minimizing expensive conversions.

See Also:
  • Constructor Details

  • Method Details

    • syncTo

      public void syncTo(TaskRegistry.PrecisionMode target)
      Synchronizes all buffers to the target mode.
      Parameters:
      target - the mode that needs to be up-to-date
    • syncFrom

      public void syncFrom(TaskRegistry.PrecisionMode mode)
      Marks the current buffer as the new authority and syncs back to Real. Call this after manual modifications to a primitive buffer.
      Parameters:
      mode - the mode that was modified
    • getReal

      public T getReal()
    • getDouble

      public double[] getDouble()
    • getFloat

      public float[] getFloat()
    • setReal

      public void setReal(T state)
    • setDouble

      public void setDouble(double[] buffer)
    • setFloat

      public void setFloat(float[] buffer)