impl all units loading in plan -- working
This commit is contained in:
@@ -86,4 +86,21 @@ void Plan::get_task(Task & result, std::string provided_name, bool verbose)
|
||||
std::cerr << "Task name \"" << provided_name << "\" was referenced but not defined!" << std::endl;
|
||||
throw Plan_InvalidTaskName();
|
||||
}
|
||||
}
|
||||
|
||||
/// Plan::load_definitions - Load the units corresponding to each task in plan from the given Suite.
|
||||
void Plan::load_definitions( Suite unit_definitions, bool verbose )
|
||||
{
|
||||
// placeholder Unit
|
||||
Unit tmp_U;
|
||||
|
||||
// for every task in the plan:
|
||||
for (int i = 0; i < this->tasks.size(); i++ )
|
||||
{
|
||||
// load the tmp_U corresponding to that task name
|
||||
unit_definitions.get_unit( tmp_U, this->tasks[i].get_name() );
|
||||
|
||||
// then have that task attach a copy of tmp_U
|
||||
this->tasks[i].load_definition( tmp_U, verbose );
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ class Plan: public JSON_Loader
|
||||
void get_task( Task & result, int index, bool verbose );
|
||||
|
||||
// load unit definitions from a provided suite and import them into individual tasks
|
||||
void load_definitions( Suite unit_definitions );
|
||||
void load_definitions( Suite unit_definitions, bool verbose );
|
||||
|
||||
// fetch a corresponding Unit to a Task
|
||||
void get_definition_from_task(Unit & result, Task input, bool verbose );
|
||||
|
||||
Reference in New Issue
Block a user