All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nvidia.spark.rapids.format.BufferTransferResponse Maven / Gradle / Ivy

The newest version!
// automatically generated by the FlatBuffers compiler, do not modify

package com.nvidia.spark.rapids.format;

import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;

@SuppressWarnings("unused")
public final class BufferTransferResponse extends Table {
  public static BufferTransferResponse getRootAsBufferTransferResponse(ByteBuffer _bb) { return getRootAsBufferTransferResponse(_bb, new BufferTransferResponse()); }
  public static BufferTransferResponse getRootAsBufferTransferResponse(ByteBuffer _bb, BufferTransferResponse obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
  public void __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; vtable_start = bb_pos - bb.getInt(bb_pos); vtable_size = bb.getShort(vtable_start); }
  public BufferTransferResponse __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }

  /**
   * ID of the requested buffer
   */
  public int bufferId() { int o = __offset(4); return o != 0 ? bb.getInt(o + bb_pos) : 0; }
  public boolean mutateBufferId(int buffer_id) { int o = __offset(4); if (o != 0) { bb.putInt(o + bb_pos, buffer_id); return true; } else { return false; } }
  /**
   * state of the transfer
   */
  public byte state() { int o = __offset(6); return o != 0 ? bb.get(o + bb_pos) : 0; }
  public boolean mutateState(byte state) { int o = __offset(6); if (o != 0) { bb.put(o + bb_pos, state); return true; } else { return false; } }
  /**
   * new metadata for the buffer if state is BUFFER_META_UPDATED
   */
  public BufferMeta bufferMeta() { return bufferMeta(new BufferMeta()); }
  public BufferMeta bufferMeta(BufferMeta obj) { int o = __offset(8); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }

  public static int createBufferTransferResponse(FlatBufferBuilder builder,
      int buffer_id,
      byte state,
      int buffer_metaOffset) {
    builder.startObject(3);
    BufferTransferResponse.addBufferMeta(builder, buffer_metaOffset);
    BufferTransferResponse.addBufferId(builder, buffer_id);
    BufferTransferResponse.addState(builder, state);
    return BufferTransferResponse.endBufferTransferResponse(builder);
  }

  public static void startBufferTransferResponse(FlatBufferBuilder builder) { builder.startObject(3); }
  public static void addBufferId(FlatBufferBuilder builder, int bufferId) { builder.addInt(0, bufferId, 0); }
  public static void addState(FlatBufferBuilder builder, byte state) { builder.addByte(1, state, 0); }
  public static void addBufferMeta(FlatBufferBuilder builder, int bufferMetaOffset) { builder.addOffset(2, bufferMetaOffset, 0); }
  public static int endBufferTransferResponse(FlatBufferBuilder builder) {
    int o = builder.endObject();
    return o;
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy