From 257fa70ab80653b27b12b27cadf82468f29f62e9 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 10 Mar 2018 18:30:12 +0100 Subject: [PATCH] consistency between Action::ActionLmmList and Action::ActionList --- src/kernel/lmm/maxmin.cpp | 2 +- src/surf/surf_interface.hpp | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/kernel/lmm/maxmin.cpp b/src/kernel/lmm/maxmin.cpp index e859c9e717..876d72d480 100644 --- a/src/kernel/lmm/maxmin.cpp +++ b/src/kernel/lmm/maxmin.cpp @@ -536,7 +536,7 @@ template void System::solve(CnstList& cnst_list) elem.make_active(); simgrid::surf::Action* action = static_cast(elem.variable->id); - if (keep_track && not action->is_linked()) + if (keep_track && not action->isLinkedModifiedSet()) keep_track->push_back(*action); } } diff --git a/src/surf/surf_interface.hpp b/src/surf/surf_interface.hpp index 2d69895982..6f6cdce401 100644 --- a/src/surf/surf_interface.hpp +++ b/src/surf/surf_interface.hpp @@ -97,6 +97,11 @@ typedef boost::heap::pairing_heap modifiedSetHook_; /* Used by the lazy update to list the actions to track */ + bool isLinkedModifiedSet() const { return modifiedSetHook_.is_linked(); } + + typedef boost::intrusive::member_hook, &Action::modifiedSetHook_> + ActionLmmOptions; + typedef boost::intrusive::list ActionLmmList; boost::intrusive::list_member_hook<> stateSetHook_; typedef boost::intrusive::member_hook, &Action::stateSetHook_> @@ -268,18 +273,14 @@ public: double getLastValue() const { return lastValue_; } void setLastValue(double val) { lastValue_ = val; } Action::Type getType() const { return type_; } - bool is_linked() const { return modifiedSetHook_.is_linked(); } protected: Action::SuspendStates suspended_ = Action::SuspendStates::not_suspended; }; typedef Action::ActionList ActionList; - -typedef boost::intrusive::member_hook, &Action::modifiedSetHook_> - ActionLmmOptions; -typedef boost::intrusive::list ActionLmmList; -typedef ActionLmmList* ActionLmmListPtr; +typedef Action::ActionLmmList ActionLmmList; +typedef Action::ActionLmmList* ActionLmmListPtr; /********* * Model * -- 2.20.1