- Give code a round of indentation. Thank astyle, not me.
git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@837 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
parent
aaf8e068d3
commit
d3c7b46853
108 changed files with 3196 additions and 3180 deletions
|
@ -55,7 +55,7 @@ CPUPoliciesGatekeeper::register_manager(CPUPolicyManager* manager)
|
|||
|
||||
ManagerIterator end = _registered.end();
|
||||
|
||||
if(find(_registered.begin(), end, manager) == end)
|
||||
if (find(_registered.begin(), end, manager) == end)
|
||||
_registered.push_back(manager);
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ CPUPoliciesGatekeeper::unregister_manager(CPUPolicyManager* manager)
|
|||
ManagerIterator end = _registered.end();
|
||||
ManagerIterator pos = find(_registered.begin(), end, manager);
|
||||
|
||||
if(pos != end)
|
||||
if (pos != end)
|
||||
{
|
||||
deactivate_policies(*pos);
|
||||
_registered.erase(pos);
|
||||
|
@ -81,7 +81,7 @@ CPUPoliciesGatekeeper::get_current_policy(History* history) throw(runtime_error)
|
|||
|
||||
ActiveIterator policy = _active_policies.find(history);
|
||||
|
||||
if(policy == _active_policies.end())
|
||||
if (policy == _active_policies.end())
|
||||
throw runtime_error("No active policy associated with this "
|
||||
"history is available.");
|
||||
|
||||
|
@ -96,10 +96,10 @@ CPUPoliciesGatekeeper::activate_policy(History *history, CPUPolicy* policy)
|
|||
ActiveIterator end = _active_policies.end();
|
||||
ActiveIterator pos = _active_policies.find(history);
|
||||
|
||||
if(pos != end && pos->second != policy)
|
||||
if (pos != end && pos->second != policy)
|
||||
_active_policies[history]->deactivate();
|
||||
|
||||
if(pos == end || pos->second != policy)
|
||||
if (pos == end || pos->second != policy)
|
||||
{
|
||||
_active_policies[history] = policy;
|
||||
_active_policies[history]->activate();
|
||||
|
@ -119,23 +119,23 @@ CPUPoliciesGatekeeper::deactivate_policies(CPUPolicyManager* manager)
|
|||
CPUPolicyIterator avail_it = avail_policies.begin();
|
||||
CPUPolicyIterator avail_end = avail_policies.end();
|
||||
|
||||
for(; avail_it != avail_end; ++avail_it)
|
||||
for (; avail_it != avail_end; ++avail_it)
|
||||
{
|
||||
// TODO isn't there a way to write more compact code by using
|
||||
// library utilities?
|
||||
ActiveIterator act_it = _active_policies.begin();
|
||||
|
||||
while(act_it != _active_policies.end())
|
||||
{
|
||||
if(act_it->second == *avail_it)
|
||||
{
|
||||
ActiveIterator removable = act_it++;
|
||||
removable->second->deactivate();
|
||||
_active_policies.erase(removable);
|
||||
}
|
||||
else
|
||||
act_it++;
|
||||
}
|
||||
while (act_it != _active_policies.end())
|
||||
{
|
||||
if (act_it->second == *avail_it)
|
||||
{
|
||||
ActiveIterator removable = act_it++;
|
||||
removable->second->deactivate();
|
||||
_active_policies.erase(removable);
|
||||
}
|
||||
else
|
||||
act_it++;
|
||||
}
|
||||
} //~ for(avail_it)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue