task/plan work

master
Chris Punches 2017-06-25 14:07:10 -04:00
parent 6fc300a98e
commit 03ff5150ac
3 changed files with 9 additions and 8 deletions

View File

@ -6,7 +6,6 @@
#include "JSON_Loader.h" #include "JSON_Loader.h"
#include "Task.h" #include "Task.h"
class Plan: public JSON_Loader class Plan: public JSON_Loader
{ {
private: private:
@ -26,10 +25,10 @@ class Plan: public JSON_Loader
void get_task( Task & result, int index, bool verbose ); void get_task( Task & result, int index, bool verbose );
// load unit definitions from a provided suite and import them into individual tasks // 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 );
// fetch a corresponding Unit to a Task // fetch a corresponding Unit to a Task
// void get_definition_from_task(Unit & result, Task input, bool verbose ); void get_definition_from_task(Unit & result, Task input, bool verbose );
}; };
#endif //FTESTS_PLAN_H #endif //FTESTS_PLAN_H

View File

@ -9,7 +9,11 @@ class Task_InvalidDataStructure: public std::runtime_error { public:
/// execute, and its dependencies on other units to have already been completed successfully. /// execute, and its dependencies on other units to have already been completed successfully.
Task::Task() {} Task::Task() {}
int Task::load_root(Json::Value loader_root) /// Task::load_root() - loads json values to private members
///
/// \param loader_root
/// \return
void Task::load_root(Json::Value loader_root)
{ {
if ( loader_root.isMember("name") ) if ( loader_root.isMember("name") )
{ {
@ -18,10 +22,8 @@ int Task::load_root(Json::Value loader_root)
throw Task_InvalidDataStructure(); throw Task_InvalidDataStructure();
} }
this->dependencies = loader_root.get("depends on", "");
// this->dependencies = loader_root.get("depends on", "");
//this->has_succeeded = false; //this->has_succeeded = false;
} }
std::string Task::get_name() std::string Task::get_name()

View File

@ -26,7 +26,7 @@ class Task
Task(); Task();
// load a json::value into task members (second stage deserialization) // load a json::value into task members (second stage deserialization)
int load_root( Json::Value loader_root ); void load_root( Json::Value loader_root );
// register a dependency // register a dependency
void add_dependency( std::string dependency_name ); void add_dependency( std::string dependency_name );