/* ----------------------------------------------------------------------------
 * This file was automatically generated by SWIG (http://www.swig.org).
 * Version 2.0.0
 *
 * Do not make changes to this file unless you know what you are doing--modify
 * the SWIG interface file instead.
 * ----------------------------------------------------------------------------- */

package de.blichmann.idajava.natives;

public class relobj_t extends bytevec_t {
  private long swigCPtr;

  public relobj_t(long cPtr, boolean cMemoryOwn) {
    super(IdaJavaJNI.relobj_t_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

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

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        IdaJavaJNI.delete_relobj_t(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public void setBase(long value) {
    IdaJavaJNI.relobj_t_base_set(swigCPtr, this, value);
  }

  public long getBase() {
    return IdaJavaJNI.relobj_t_base_get(swigCPtr, this);
  }

  public void setRi(reloc_info_t value) {
    IdaJavaJNI.relobj_t_ri_set(swigCPtr, this, reloc_info_t.getCPtr(value), value);
  }

  public reloc_info_t getRi() {
    long cPtr = IdaJavaJNI.relobj_t_ri_get(swigCPtr, this);
    return (cPtr == 0) ? null : new reloc_info_t(cPtr, false);
  }

  public relobj_t() {
    this(IdaJavaJNI.new_relobj_t(), true);
  }

  public boolean relocate(long ea, boolean mf) {
    return IdaJavaJNI.relobj_t_relocate(swigCPtr, this, ea, mf);
  }

}
