- TODO and FIXME reduced to 38

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@941 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
elvez 2006-08-25 22:43:04 +00:00
parent 57059b647b
commit 696c513ed2
13 changed files with 13 additions and 106 deletions

View file

@ -22,30 +22,14 @@
#include "cpu_policy_manager.hh"
#include "cpu_policies_gatekeeper.hh"
CPUPolicyManager*
CPUPolicyManager::_registered = NULL;
CPUPolicyManager::CPUPolicyManager()
{
//FIXME remove this when get_registered_manager is dropped
_registered = this;
CPUPoliciesGatekeeper::get_instance().register_manager(this);
}
CPUPolicyManager::~CPUPolicyManager()
{
// This check is necessary:
//FIXME remove this when get_registered_manager is dropped
if (_registered == this) _registered = NULL;
CPUPoliciesGatekeeper::get_instance().unregister_manager(this);
}
CPUPolicyManager&
CPUPolicyManager::get_registered_manager()
{
return *_registered;
}

View file

@ -51,14 +51,6 @@ namespace sgpem
virtual ~CPUPolicyManager() = 0;
/**
Gets THE policy (the only today) used.
Next versions will implement some other kind.
\return A reference to the policy.
FIXME deprecated
*/
//virtual CPUPolicy& get_policy() = 0;
/**
Init (or reset if yet initialized) the manager.
FIXME deprecated
@ -67,21 +59,10 @@ namespace sgpem
virtual const std::vector<CPUPolicy*>& get_avail_policies() = 0;
/** \brief Get the registered manager instance
* FIXME deprecated
*
* \return The registered policy manager instance.
*/
static CPUPolicyManager& get_registered_manager();
protected:
virtual void collect_policies() = 0;
std::vector<CPUPolicy*> _policies;
private:
/** A pointer to the registered instance */
static CPUPolicyManager* _registered;
};
} //~ namespace sgpem

View file

@ -101,8 +101,6 @@ DynamicProcess::get_state() const
{
state thread_state = (*seq)->get_state();
// TODO Is this OK? Must be tested...
switch(thread_state)
{
case state_running: // (a)
@ -145,7 +143,6 @@ DynamicProcess::get_state() const
void
DynamicProcess::serialize(SerializeVisitor& translator) const
{
// translator.from_process(*_core);
translator.from_process(*this);
}

View file

@ -108,19 +108,15 @@ ResourcePoliciesGatekeeper::deactivate_policies(const ResourcePolicyManager& man
for (AvailableIt avail_it = policies.begin(); avail_it != policies.end(); ++avail_it)
{
// TODO isn't there a way to write more compact code by using
// library utilities?
for (PolicyIterator it = _active_policies.begin(); it != _active_policies.end();)
{
// FIXME Is this necessary? It just came across my mind the idea that
// incrementing an invalid iterator might be unsafe...
PolicyIterator next = it;
++next;
// NOTE we use postfix ++ because I'm not sure if it's
// safe to increment an invalid iterator (set::erase() makes the iterator
// invalid)
if (it->second == *avail_it)
_active_policies.erase(it);
it = next;
_active_policies.erase(it++);
else
++it;
}
} //~ for(avail_it)
}

View file

@ -229,10 +229,6 @@ TextSimulation::get_parameter(CommandParameter<T>& parameter)
T value;
// FIXME semi-hack, it's a bit overkill to tokenize the string
// to find if it's only composed of white spaces...
// Indedeed there's a pro: by using extensively tokenize() we are more sure
// it's correct ;-)
if (tokenize(input).size() > 0)
{
try
@ -285,17 +281,12 @@ namespace sgpem
buf = readline();
// FIXME semi-hack, it's a bit overkill to tokenize the string
// to find if it's only composed of white spaces...
// Indedeed there's a pro: by using extensively tokenize() we are more sure
// it's correct ;-)
Tokens tokens = tokenize(buf);
if (tokens.size() == 0 && parameter.required)
p_stderr(_("ERROR: This is a mandatory atribute; you MUST provide a valid value!\n"));
else
{
// FIXME should we assign the entire line here or just a token?
parameter.value = buf;
loop = false;
}
@ -324,10 +315,6 @@ namespace sgpem
ustring str = readline();
// FIXME semi-hack, it's a bit overkill to tokenize the string
// to find if it's only composed of white spaces...
// Indedeed there's a pro: by using extensively tokenize() we are more sure
// it's correct ;-)
Tokens tokens = tokenize(str);
if (tokens.size() != 0)