/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include <list>
+
+#include <xbt/base.h>
+#include <xbt/dynar.h>
+#include <xbt/signal.hpp>
+
+#include <simgrid/forward.h>
+#include <simgrid/s4u/host.hpp>
+
+#include "surf/datatypes.h"
#include "surf_interface.hpp"
#include "maxmin_private.hpp"
+#include "trace_mgr.hpp"
#ifndef SURF_CPU_INTERFACE_HPP_
#define SURF_CPU_INTERFACE_HPP_
class CpuModel;
class Cpu;
class CpuAction;
-class CpuPlugin;
-
-/*************
- * Callbacks *
- *************/
-XBT_PUBLIC(std::list<Cpu*>) getActionCpus(CpuAction *action);
-
-/*********
- * Model *
- *********/
+class CpuPlugin;// FIXME:DEADCODE
/** @ingroup SURF_cpu_interface
* @brief SURF cpu model interface class
**********/
/** @ingroup SURF_cpu_interface
- * @brief SURF Cpu action interface class
- * @details A CpuAction represent the execution of code on a Cpu
+ * @brief A CpuAction represents the execution of code on one or several Cpus
*/
XBT_PUBLIC_CLASS CpuAction : public simgrid::surf::Action {
friend XBT_PUBLIC(Cpu*) getActionCpu(CpuAction *action);
public:
-/** @brief Callbacks handler which emit the callbacks after CpuAction State changed *
- * @details Callback functions have the following signature: `void(CpuAction *action, e_surf_action_state_t previous)`
- */
- static simgrid::xbt::signal<void(simgrid::surf::CpuAction*, e_surf_action_state_t)> onStateChange;
+ /** @brief Callbacks handler which emit the callbacks after CpuAction State changed *
+ * @details Callback functions have the following signature: `void(CpuAction *action, simgrid::surf::Action::State previous)`
+ */
+ static simgrid::xbt::signal<void(simgrid::surf::CpuAction*, simgrid::surf::Action::State)> onStateChange;
- /** @brief CpuAction constructor */
CpuAction(simgrid::surf::Model *model, double cost, bool failed)
- : Action(model, cost, failed) {} //FIXME:DEADCODE?
-
- /** @brief CpuAction constructor */
+ : Action(model, cost, failed) {} //FIXME:DEADCODE?
CpuAction(simgrid::surf::Model *model, double cost, bool failed, lmm_variable_t var)
- : Action(model, cost, failed, var) {}
+ : Action(model, cost, failed, var) {}
- /**
- * @brief Set the affinity of the current CpuAction
- * @details [TODO]
- */
+ /** @brief Set the affinity of the current CpuAction */
virtual void setAffinity(Cpu *cpu, unsigned long mask);
- void setState(e_surf_action_state_t state);
-
- void updateRemainingLazy(double now);
+ void setState(simgrid::surf::Action::State state) override;
+ void updateRemainingLazy(double now) override;
+ std::list<Cpu*> cpus();
};
}