-
- /**
- * CpuAction constructor
- * @param model The model associated
- * @param cost The cost of the action (e.g., flops, bytes)
- * @param failed If the action has failed
- */
public CpuAction(Model model, double cost, boolean failed) {
this(SurfJNI.new_CpuAction(Model.getCPtr(model), model, cost, failed), true);
SurfJNI.CpuAction_director_connect(this, swigCPtr, swigCMemOwn, true);
}
public CpuAction(Model model, double cost, boolean failed) {
this(SurfJNI.new_CpuAction(Model.getCPtr(model), model, cost, failed), true);
SurfJNI.CpuAction_director_connect(this, swigCPtr, swigCMemOwn, true);
}
- long cPtr = SurfJNI.CpuAction_getCpu(swigCPtr, this);
- return (Cpu)Surf.getCpuDirector(cPtr);
-}
+ long cPtr = SurfJNI.CpuAction_getCpu(swigCPtr, this);
+ return (cPtr == 0) ? null : new Cpu(cPtr, false);
+ }