Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
b5572a836a9980460002da22e77ff9fb2b274036
[simgrid.git] / src / bindings / java / org / simgrid / surf / CpuModel.java
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 2.0.11
4  *
5  * Do not make changes to this file unless you know what you are doing--modify
6  * the SWIG interface file instead.
7  * ----------------------------------------------------------------------------- */
8
9 package org.simgrid.surf;
10
11 /**
12   * The generic model for the Cpu component
13   * @see Cpu
14   * @see CpuAction
15   */
16 public class CpuModel extends Model {
17   private long swigCPtr;
18
19   protected CpuModel(long cPtr, boolean cMemoryOwn) {
20     super(SurfJNI.CpuModel_SWIGUpcast(cPtr), cMemoryOwn);
21     swigCPtr = cPtr;
22   }
23
24   protected static long getCPtr(CpuModel obj) {
25     return (obj == null) ? 0 : obj.swigCPtr;
26   }
27
28   protected void finalize() {
29     delete();
30   }
31
32   public synchronized void delete() {
33     if (swigCPtr != 0) {
34       if (swigCMemOwn) {
35         swigCMemOwn = false;
36         SurfJNI.delete_CpuModel(swigCPtr);
37       }
38       swigCPtr = 0;
39     }
40     super.delete();
41   }
42
43   protected void swigDirectorDisconnect() {
44     swigCMemOwn = false;
45     delete();
46   }
47
48   public void swigReleaseOwnership() {
49     swigCMemOwn = false;
50     SurfJNI.CpuModel_change_ownership(this, swigCPtr, false);
51   }
52
53   public void swigTakeOwnership() {
54     swigCMemOwn = true;
55     SurfJNI.CpuModel_change_ownership(this, swigCPtr, true);
56   }
57
58   
59   /**
60     * CpuModel constructon
61     * @param name The name of the cpumodel
62     */
63   public CpuModel(String name) {
64     this(SurfJNI.new_CpuModel(name), true);
65     SurfJNI.CpuModel_director_connect(this, swigCPtr, swigCMemOwn, true);
66   }
67
68   
69   /**
70     * Create a new Cpu
71     *
72     * @param name
73     * @param power_peak
74     * @param pstate
75     * @param power_scale
76     * @param power_trace
77     * @param core
78     * @param state_initial
79     * @param state_trace
80     * @param cpu_properties
81     * @return The new Cpu
82     * @see Cpu
83     */
84   public Cpu createCpu(String name, double[] power_peak, int pstate, double power_scale, TmgrTrace power_trace, int core, ResourceState state_initial, TmgrTrace state_trace, XbtDict cpu_properties) {
85   long cPtr = SurfJNI.CpuModel_createCpu(swigCPtr, this, name, power_peak, pstate, power_scale, TmgrTrace.getCPtr(power_trace), power_trace, core, state_initial.swigValue(), TmgrTrace.getCPtr(state_trace), state_trace, XbtDict.getCPtr(cpu_properties), cpu_properties);
86   return (Cpu)Surf.getCpuDirector(cPtr);
87 }
88
89 }