CpuL07::CpuL07(CpuL07Model *model, simgrid::s4u::Host *host, xbt_dynar_t speedPerPstate, int core)
: Cpu(model, host, speedPerPstate, core)
{
- p_constraint = lmm_constraint_new(model->getMaxminSystem(), this, xbt_dynar_get_as(speedPerPstate,0,double));
+ constraint_ = lmm_constraint_new(model->getMaxminSystem(), this, xbt_dynar_get_as(speedPerPstate,0,double));
}
CpuL07::~CpuL07()
{}
Resource::Resource(Model *model, const char *name, lmm_constraint_t constraint, int initiallyOn)
- : p_name(xbt_strdup(name))
- , p_model(model)
- , m_isOn(initiallyOn)
- , p_constraint(constraint)
+ : name_(xbt_strdup(name))
+ , model_(model)
+ , isOn_(initiallyOn)
+ , constraint_(constraint)
{}
Resource::Resource(Model *model, const char *name, int initiallyOn)
- : p_name(xbt_strdup(name))
- , p_model(model)
- , m_isOn(initiallyOn)
+ : name_(xbt_strdup(name))
+ , model_(model)
+ , isOn_(initiallyOn)
{}
Resource::~Resource() {
- xbt_free((void*)p_name);
+ xbt_free((void*)name_);
}
bool Resource::isOn() {
- return m_isOn;
+ return isOn_;
}
bool Resource::isOff() {
- return ! m_isOn;
+ return ! isOn_;
}
void Resource::turnOn()
{
- if (!m_isOn) {
- m_isOn = true;
+ if (!isOn_) {
+ isOn_ = true;
}
}
void Resource::turnOff()
{
- if (m_isOn) {
- m_isOn = false;
+ if (isOn_) {
+ isOn_ = false;
}
}
Model *Resource::getModel() const {
- return p_model;
+ return model_;
}
const char *Resource::getName() const {
- return p_name;
+ return name_;
}
bool Resource::operator==(const Resource &other) const {
- return strcmp(p_name, other.p_name);
+ return strcmp(name_, other.name_);
}
lmm_constraint_t Resource::getConstraint() {
- return p_constraint;
+ return constraint_;
}
}
virtual void turnOff();
private:
- const char *p_name;
- Model *p_model;
- bool m_isOn;
+ const char *name_;
+ Model *model_;
+ bool isOn_;
public: /* LMM */
/** @brief Get the lmm constraint associated to this Resource if it is part of a LMM component (or null if none) */
lmm_constraint_t getConstraint();
protected:
- lmm_constraint_t p_constraint = nullptr;
+ lmm_constraint_t constraint_ = nullptr;
};
}