lookup active task by workunit

svn path=/trunk/boinc/; revision=590
This commit is contained in:
Eric Heien 2002-11-09 01:15:38 +00:00
parent 2080130c67
commit b2f149c0fd
2 changed files with 12 additions and 0 deletions

View File

@ -534,6 +534,16 @@ FILE_INFO* CLIENT_STATE::lookup_file_info(PROJECT* p, char* name) {
return 0;
}
// Find the active task for a given workunit
//
ACTIVE_TASK* CLIENT_STATE::lookup_active_task_by_workunit(WORKUNIT* wup)
{
for(int i = 0; i < active_tasks.active_tasks.size(); i ++) {
if(active_tasks.active_tasks[i]->wup == wup) return active_tasks.active_tasks[i];
}
return NULL;
}
// functions to create links between state objects
// (which, in their XML form, reference one another by name)
//
@ -920,3 +930,4 @@ int CLIENT_STATE::report_project_error( RESULT &res, int err_num, char *err_msg
return 0;
}

View File

@ -137,6 +137,7 @@ public:
RESULT* lookup_result(PROJECT*, char*);
WORKUNIT* lookup_workunit(PROJECT*, char*);
APP_VERSION* lookup_app_version(APP*, int);
ACTIVE_TASK* lookup_active_task_by_workunit(WORKUNIT*);
};
extern CLIENT_STATE gstate;