* Callbacks *
*************/
-std::list<Cpu*> getActionCpus(CpuAction *action) {
- std::list<Cpu*> retlist;
- lmm_system_t sys = action->getModel()->getMaxminSystem();
- int llen = lmm_get_number_of_cnst_from_var(sys, action->getVariable());
-
- for(int i = 0; i<llen; i++) {
- retlist.push_back( (Cpu*)(lmm_constraint_id( lmm_get_cnst_from_var(sys, action->getVariable(), i) )) );
- }
- return retlist;
-}
-
simgrid::xbt::signal<void(CpuAction*, e_surf_action_state_t, e_surf_action_state_t)> cpuActionStateChangedCallbacks;
/*********
Action::setState(state);
onStateChange(this, previous);
}
+std::list<Cpu*> CpuAction::cpus() {
+ std::list<Cpu*> retlist;
+ lmm_system_t sys = getModel()->getMaxminSystem();
+ int llen = lmm_get_number_of_cnst_from_var(sys, getVariable());
+
+ for(int i = 0; i<llen; i++)
+ retlist.push_back( (Cpu*)(lmm_constraint_id( lmm_get_cnst_from_var(sys, getVariable(), i) )) );
+
+ return retlist;
+}
}
}
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
void setState(e_surf_action_state_t state);
void updateRemainingLazy(double now);
+ std::list<Cpu*> cpus();
+
};
}
* unlimited.
* @return The action representing the communication
*/
- virtual Action *communicate(NetCard *src, NetCard *dst,
- double size, double rate)=0;
+ virtual Action *communicate(NetCard *src, NetCard *dst, double size, double rate)=0;
/** @brief Function pointer to the function to use to solve the lmm_system_t
*
}
static void onActionStateChange(simgrid::surf::CpuAction *action, e_surf_action_state_t previous) {
- std::list<simgrid::surf::Cpu*> cpus = getActionCpus(action);
- for(simgrid::surf::Cpu* cpu : cpus) {
+ for(simgrid::surf::Cpu* cpu : action->cpus()) {
const char *name = cpu->getName();
sg_host_t sghost = sg_host_by_name(name);
if(sghost == NULL)