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

package org.simgrid.surf;

public class Plugin {
  private long swigCPtr;
  protected boolean swigCMemOwn;

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

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

  protected void finalize() {
    delete();
  }

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

  protected void swigDirectorDisconnect() {
    swigCMemOwn = false;
    delete();
  }

  public void swigReleaseOwnership() {
    swigCMemOwn = false;
    SurfJNI.Plugin_change_ownership(this, swigCPtr, false);
  }

  public void swigTakeOwnership() {
    swigCMemOwn = true;
    SurfJNI.Plugin_change_ownership(this, swigCPtr, true);
  }

  public void activateCpuCreatedCallback() {
    SurfJNI.Plugin_activateCpuCreatedCallback(swigCPtr, this);
  }

  public void cpuCreatedCallback(Cpu cpu) {
    if (getClass() == Plugin.class) SurfJNI.Plugin_cpuCreatedCallback(swigCPtr, this, Cpu.getCPtr(cpu), cpu); else SurfJNI.Plugin_cpuCreatedCallbackSwigExplicitPlugin(swigCPtr, this, Cpu.getCPtr(cpu), cpu);
  }

  public void activateCpuDestructedCallback() {
    SurfJNI.Plugin_activateCpuDestructedCallback(swigCPtr, this);
  }

  public void cpuDestructedCallback(Cpu cpu) {
    if (getClass() == Plugin.class) SurfJNI.Plugin_cpuDestructedCallback(swigCPtr, this, Cpu.getCPtr(cpu), cpu); else SurfJNI.Plugin_cpuDestructedCallbackSwigExplicitPlugin(swigCPtr, this, Cpu.getCPtr(cpu), cpu);
  }

  public void activateCpuStateChangedCallback() {
    SurfJNI.Plugin_activateCpuStateChangedCallback(swigCPtr, this);
  }

  public void cpuStateChangedCallback(Cpu cpu, ResourceState arg1, ResourceState arg2) {
    if (getClass() == Plugin.class) SurfJNI.Plugin_cpuStateChangedCallback(swigCPtr, this, Cpu.getCPtr(cpu), cpu, arg1.swigValue(), arg2.swigValue()); else SurfJNI.Plugin_cpuStateChangedCallbackSwigExplicitPlugin(swigCPtr, this, Cpu.getCPtr(cpu), cpu, arg1.swigValue(), arg2.swigValue());
  }

  public void activateCpuActionStateChangedCallback() {
    SurfJNI.Plugin_activateCpuActionStateChangedCallback(swigCPtr, this);
  }

  public void cpuActionStateChangedCallback(CpuAction action, ActionState arg1, ActionState arg2) {
    if (getClass() == Plugin.class) SurfJNI.Plugin_cpuActionStateChangedCallback(swigCPtr, this, CpuAction.getCPtr(action), action, arg1.swigValue(), arg2.swigValue()); else SurfJNI.Plugin_cpuActionStateChangedCallbackSwigExplicitPlugin(swigCPtr, this, CpuAction.getCPtr(action), action, arg1.swigValue(), arg2.swigValue());
  }

  public void activateNetworkLinkCreatedCallback() {
    SurfJNI.Plugin_activateNetworkLinkCreatedCallback(swigCPtr, this);
  }

  public void networkLinkCreatedCallback(NetworkLink link) {
    if (getClass() == Plugin.class) SurfJNI.Plugin_networkLinkCreatedCallback(swigCPtr, this, NetworkLink.getCPtr(link), link); else SurfJNI.Plugin_networkLinkCreatedCallbackSwigExplicitPlugin(swigCPtr, this, NetworkLink.getCPtr(link), link);
  }

  public void activateNetworkLinkDestructedCallback() {
    SurfJNI.Plugin_activateNetworkLinkDestructedCallback(swigCPtr, this);
  }

  public void networkLinkDestructedCallback(NetworkLink link) {
    if (getClass() == Plugin.class) SurfJNI.Plugin_networkLinkDestructedCallback(swigCPtr, this, NetworkLink.getCPtr(link), link); else SurfJNI.Plugin_networkLinkDestructedCallbackSwigExplicitPlugin(swigCPtr, this, NetworkLink.getCPtr(link), link);
  }

  public void activateNetworkLinkStateChangedCallback() {
    SurfJNI.Plugin_activateNetworkLinkStateChangedCallback(swigCPtr, this);
  }

  public void networkLinkStateChangedCallback(NetworkLink link, ResourceState arg1, ResourceState arg2) {
    if (getClass() == Plugin.class) SurfJNI.Plugin_networkLinkStateChangedCallback(swigCPtr, this, NetworkLink.getCPtr(link), link, arg1.swigValue(), arg2.swigValue()); else SurfJNI.Plugin_networkLinkStateChangedCallbackSwigExplicitPlugin(swigCPtr, this, NetworkLink.getCPtr(link), link, arg1.swigValue(), arg2.swigValue());
  }

  public void activateNetworkActionStateChangedCallback() {
    SurfJNI.Plugin_activateNetworkActionStateChangedCallback(swigCPtr, this);
  }

  public void networkActionStateChangedCallback(NetworkAction action, ActionState old, ActionState cur) {
    if (getClass() == Plugin.class) SurfJNI.Plugin_networkActionStateChangedCallback(swigCPtr, this, NetworkAction.getCPtr(action), action, old.swigValue(), cur.swigValue()); else SurfJNI.Plugin_networkActionStateChangedCallbackSwigExplicitPlugin(swigCPtr, this, NetworkAction.getCPtr(action), action, old.swigValue(), cur.swigValue());
  }

  public void activateNetworkCommunicateCallback() {
    SurfJNI.Plugin_activateNetworkCommunicateCallback(swigCPtr, this);
  }

  public void networkCommunicateCallback(NetworkAction action, RoutingEdge src, RoutingEdge dst, double size, double rate) {
    if (getClass() == Plugin.class) SurfJNI.Plugin_networkCommunicateCallback(swigCPtr, this, NetworkAction.getCPtr(action), action, RoutingEdge.getCPtr(src), src, RoutingEdge.getCPtr(dst), dst, size, rate); else SurfJNI.Plugin_networkCommunicateCallbackSwigExplicitPlugin(swigCPtr, this, NetworkAction.getCPtr(action), action, RoutingEdge.getCPtr(src), src, RoutingEdge.getCPtr(dst), dst, size, rate);
  }

  public Plugin() {
    this(SurfJNI.new_Plugin(), true);
    SurfJNI.Plugin_director_connect(this, swigCPtr, swigCMemOwn, true);
  }

}
