added task state flag
parent
27969c3c27
commit
0bd455dd97
|
@ -89,6 +89,9 @@ void Plan::get_task(Task & result, std::string provided_name, bool verbose)
|
|||
}
|
||||
|
||||
/// Plan::load_definitions - Load the units corresponding to each task in plan from the given Suite.
|
||||
///
|
||||
/// \param unit_definitions - The Suite to load definitions from.
|
||||
/// \param verbose - Whether to print verbose information to STDOUT.
|
||||
void Plan::load_definitions( Suite unit_definitions, bool verbose )
|
||||
{
|
||||
// placeholder Unit
|
||||
|
|
|
@ -7,7 +7,13 @@ class Task_InvalidDataStructure: public std::runtime_error { public:
|
|||
|
||||
/// Task::Task() - Constructor for the Task class. The Task is the building block of a Plan indicating of which Unit to
|
||||
/// execute, and its dependencies on other units to have already been completed successfully.
|
||||
Task::Task() {}
|
||||
Task::Task() {
|
||||
// it hasn't executed yet.
|
||||
this->complete = false;
|
||||
|
||||
// it hasn't been matched with a definition yet.
|
||||
this->defined = false;
|
||||
}
|
||||
|
||||
/// Task::load_root() - loads json values to private members
|
||||
///
|
||||
|
@ -56,4 +62,15 @@ void Task::load_definition( Unit selected_unit, bool verbose )
|
|||
{
|
||||
std::cout << "Loaded definition \"" << selected_unit.get_name() << "\" for task \"" << this->get_name() << "\"." << std::endl;
|
||||
}
|
||||
this->defined = true;
|
||||
}
|
||||
|
||||
/// Task::is_complete - Indicator if the task executed successfully.
|
||||
bool Task::is_complete() {
|
||||
return this->complete;
|
||||
}
|
||||
|
||||
/// Task::has_definition - Indicator if the task has attached its definition from a Suite.
|
||||
bool Task::has_definition() {
|
||||
return this->defined;
|
||||
}
|
|
@ -21,6 +21,9 @@ class Task
|
|||
// the status of this task
|
||||
bool complete;
|
||||
|
||||
// the readiness of this task to execute
|
||||
bool defined;
|
||||
|
||||
public:
|
||||
// constructor
|
||||
Task();
|
||||
|
@ -32,6 +35,7 @@ class Task
|
|||
void load_definition( Unit definition, bool verbose );
|
||||
|
||||
bool is_complete();
|
||||
bool has_definition();
|
||||
|
||||
// fetch the name of a task
|
||||
std::string get_name();
|
||||
|
|
Loading…
Reference in New Issue