1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
5 * Do not make changes to this file unless you know what you are doing--modify
6 * the SWIG interface file instead.
7 * ----------------------------------------------------------------------------- */
9 package org.simgrid.surf;
12 * An cpu action created by a Cpu
16 public class CpuAction extends Action {
17 private long swigCPtr;
19 protected CpuAction(long cPtr, boolean cMemoryOwn) {
20 super(SurfJNI.CpuAction_SWIGUpcast(cPtr), cMemoryOwn);
24 protected static long getCPtr(CpuAction obj) {
25 return (obj == null) ? 0 : obj.swigCPtr;
28 protected void finalize() {
32 public synchronized void delete() {
36 SurfJNI.delete_CpuAction(swigCPtr);
43 protected void swigDirectorDisconnect() {
48 public void swigReleaseOwnership() {
50 SurfJNI.CpuAction_change_ownership(this, swigCPtr, false);
53 public void swigTakeOwnership() {
55 SurfJNI.CpuAction_change_ownership(this, swigCPtr, true);
60 * CpuAction constructor
61 * @param model The model associated
62 * @param cost The cost of the action (e.g., flops, bytes)
63 * @param failed If the action has failed
65 public CpuAction(Model model, double cost, boolean failed) {
66 this(SurfJNI.new_CpuAction(Model.getCPtr(model), model, cost, failed), true);
67 SurfJNI.CpuAction_director_connect(this, swigCPtr, swigCMemOwn, true);
72 * @return The associated cpu
75 long cPtr = SurfJNI.CpuAction_getCpu(swigCPtr, this);
76 return (Cpu)Surf.getCpuDirector(cPtr);