Skip to content

Commit

Permalink
Removing side effects from Kernel::getPortsToTrigger() in tres_base (…
Browse files Browse the repository at this point in the history
…adding a specific function to be explicitly called for clearing the _task_to_trigger vector)
  • Loading branch information
Matteo Morelli committed Aug 21, 2015
1 parent cf2bc17 commit f6b2561
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
10 changes: 6 additions & 4 deletions base/include/tres/Kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,15 @@ namespace tres

/**
* \brief Return the a vector of block's ports to trigger in S/R implementation
*
* \note This function has side-effects, since the list of tasks scheduled for
* a new job execution (\ref _tasks_to_trigger, see below) gets cleared once the
* port indices are computed
*/
std::vector<int> getPortsToTrigger();

/**
* \brief Clear the list of tasks scheduled for a new job execution
* (\ref _tasks_to_trigger, see below)
*/
void clearPortsToTrigger();

/**
* \brief Get the job status for a given task
*/
Expand Down
7 changes: 6 additions & 1 deletion base/src/Kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,15 @@ namespace tres
{
_ports.push_back(_task_port_map[*task]);
}
_tasks_to_trigger.clear();
//_tasks_to_trigger.clear();
return _ports;
}

void Kernel::clearPortsToTrigger()
{
_tasks_to_trigger.clear();
}

int Kernel::getFlag(const std::string& task)
{
return _jobs_status[task];
Expand Down

0 comments on commit f6b2561

Please sign in to comment.