/* ###
 * IP: Apache License 2.0 with LLVM Exceptions
 */
/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (https://www.swig.org).
 * Version 4.1.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 SBScriptObject {
  private transient long swigCPtr;
  protected transient boolean swigCMemOwn;

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

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

  protected static long swigRelease(SBScriptObject obj) {
    long ptr = 0;
    if (obj != null) {
      if (!obj.swigCMemOwn)
        throw new RuntimeException("Cannot release ownership as memory is not owned");
      ptr = obj.swigCPtr;
      obj.swigCMemOwn = false;
      obj.delete();
    }
    return ptr;
  }

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

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

  public SBScriptObject(SWIGTYPE_p_void ptr, ScriptLanguage lang) {
    this(lldbJNI.new_SBScriptObject__SWIG_0(SWIGTYPE_p_void.getCPtr(ptr), lang.swigValue()), true);
  }

  public SBScriptObject(SBScriptObject rhs) {
    this(lldbJNI.new_SBScriptObject__SWIG_1(SBScriptObject.getCPtr(rhs), rhs), true);
  }

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

  public SWIGTYPE_p_void GetPointer() {
    long cPtr = lldbJNI.SBScriptObject_GetPointer(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_void(cPtr, false);
  }

  public ScriptLanguage GetLanguage() {
    return ScriptLanguage.swigToEnum(lldbJNI.SBScriptObject_GetLanguage(swigCPtr, this));
  }

}
