/* ###
 * IP: Apache License 2.0 with LLVM Exceptions
 */
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 4.0.1
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package SWIG;

public class SBCommunication {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

  protected SBCommunication(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  protected static long getCPtr(SBCommunication obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  @SuppressWarnings("deprecation")
  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        lldbJNI.delete_SBCommunication(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public SBCommunication() {
    this(lldbJNI.new_SBCommunication__SWIG_0(), true);
  }

  public SBCommunication(String broadcaster_name) {
    this(lldbJNI.new_SBCommunication__SWIG_1(broadcaster_name), true);
  }

  public boolean IsValid() {
    return lldbJNI.SBCommunication_IsValid(swigCPtr, this);
  }

  public SBBroadcaster GetBroadcaster() {
    return new SBBroadcaster(lldbJNI.SBCommunication_GetBroadcaster(swigCPtr, this), true);
  }

  public static String GetBroadcasterClass() {
    return lldbJNI.SBCommunication_GetBroadcasterClass();
  }

  public ConnectionStatus AdoptFileDesriptor(int fd, boolean owns_fd) {
    return ConnectionStatus.swigToEnum(lldbJNI.SBCommunication_AdoptFileDesriptor(swigCPtr, this, fd, owns_fd));
  }

  public ConnectionStatus Connect(String url) {
    return ConnectionStatus.swigToEnum(lldbJNI.SBCommunication_Connect(swigCPtr, this, url));
  }

  public ConnectionStatus Disconnect() {
    return ConnectionStatus.swigToEnum(lldbJNI.SBCommunication_Disconnect(swigCPtr, this));
  }

  public boolean IsConnected() {
    return lldbJNI.SBCommunication_IsConnected(swigCPtr, this);
  }

  public boolean GetCloseOnEOF() {
    return lldbJNI.SBCommunication_GetCloseOnEOF(swigCPtr, this);
  }

  public void SetCloseOnEOF(boolean b) {
    lldbJNI.SBCommunication_SetCloseOnEOF(swigCPtr, this, b);
  }

  public long Read(SWIGTYPE_p_void dst, long dst_len, long timeout_usec, SWIGTYPE_p_lldb__ConnectionStatus status) {
    return lldbJNI.SBCommunication_Read(swigCPtr, this, SWIGTYPE_p_void.getCPtr(dst), dst_len, timeout_usec, SWIGTYPE_p_lldb__ConnectionStatus.getCPtr(status));
  }

  public long Write(SWIGTYPE_p_void src, long src_len, SWIGTYPE_p_lldb__ConnectionStatus status) {
    return lldbJNI.SBCommunication_Write(swigCPtr, this, SWIGTYPE_p_void.getCPtr(src), src_len, SWIGTYPE_p_lldb__ConnectionStatus.getCPtr(status));
  }

  public boolean ReadThreadStart() {
    return lldbJNI.SBCommunication_ReadThreadStart(swigCPtr, this);
  }

  public boolean ReadThreadStop() {
    return lldbJNI.SBCommunication_ReadThreadStop(swigCPtr, this);
  }

  public boolean ReadThreadIsRunning() {
    return lldbJNI.SBCommunication_ReadThreadIsRunning(swigCPtr, this);
  }

  public boolean SetReadThreadBytesReceivedCallback(SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void callback, SWIGTYPE_p_void callback_baton) {
    return lldbJNI.SBCommunication_SetReadThreadBytesReceivedCallback(swigCPtr, this, SWIGTYPE_p_f_p_void_p_q_const__void_size_t__void.getCPtr(callback), SWIGTYPE_p_void.getCPtr(callback_baton));
  }

  public final static int eBroadcastBitDisconnected = lldbJNI.SBCommunication_eBroadcastBitDisconnected_get();
  public final static int eBroadcastBitReadThreadGotBytes = lldbJNI.SBCommunication_eBroadcastBitReadThreadGotBytes_get();
  public final static int eBroadcastBitReadThreadDidExit = lldbJNI.SBCommunication_eBroadcastBitReadThreadDidExit_get();
  public final static int eBroadcastBitReadThreadShouldExit = lldbJNI.SBCommunication_eBroadcastBitReadThreadShouldExit_get();
  public final static int eBroadcastBitPacketAvailable = lldbJNI.SBCommunication_eBroadcastBitPacketAvailable_get();
  public final static int eAllEventBits = lldbJNI.SBCommunication_eAllEventBits_get();

}
