plan header reworked

master
Chris Punches 2017-06-23 16:02:19 -04:00
parent 9c1580ad95
commit 24ab0f396f
4 changed files with 16 additions and 11 deletions

View File

@ -17,7 +17,7 @@ int main( )
Suite available_definitions; Suite available_definitions;
available_definitions.load_units_file( definitions_file, verbose ); available_definitions.load_units_file( definitions_file, verbose );
// Plan plan = Plan( plan_file ); Plan plan;
/* for ( int i = 0; i < plan.num_tasks(); ++i ) /* for ( int i = 0; i < plan.num_tasks(); ++i )
{ {

View File

@ -1,5 +1,5 @@
#include "Plan.h" #include "Plan.h"
/*
int Plan::num_tasks() int Plan::num_tasks()
// returns the number of tasks in a Plan // returns the number of tasks in a Plan
{ {
@ -13,10 +13,10 @@ Task Plan::get_task(int index)
} }
Task Plan::get_task(std::string provided_name) Task Plan::get_task(std::string provided_name)
* returns a task from a Plan object by name /* returns a task from a Plan object by name
* this will need reworked. maybe should return int, populate a pointer. * this will need reworked. maybe should return int, populate a pointer.
* error handling is the concern here. * error handling is the concern here.
*/
{ {
Task * returnable; Task * returnable;
bool foundMatch = false; bool foundMatch = false;
@ -41,9 +41,8 @@ Task Plan::get_task(std::string provided_name)
} }
Plan::Plan( std::string filename ): JSON_Loader() Plan::Plan( std::string filename ): JSON_Loader()
Plan loads a file and deserializes the Unit JSON object to Task types as a vector member // Plan loads a file and deserializes the Unit JSON object to Task types as a vector member
* Plan { vector<Task> } // Plan { vector<Task> }
{ {
// plan always loads from file // plan always loads from file
this->load_json_file( filename ); this->load_json_file( filename );

View File

@ -10,12 +10,18 @@
class Plan: public JSON_Loader class Plan: public JSON_Loader
{ {
private: private:
// storage for the tasks that make up the plan
std::vector<Task> tasks; std::vector<Task> tasks;
public: public:
Plan( std::string filename ); Plan();
Task get_task(std::string provided_name);
Task get_task(int index); void load_plan_file( std::string filename, bool verbose );
void get_task(Task & result, std::string provided_name, bool verbose);
void get_task(Task & result, int index. bool verbose);
int num_tasks(); int num_tasks();
}; };

View File

@ -6,7 +6,7 @@
#include "JSON_Loader.h" #include "JSON_Loader.h"
#include "Suite.h" #include "Suite.h"
//#include "Plan.h" #include "Plan.h"
#include "Conf.h" #include "Conf.h"
#endif //FTESTS_LOADERS_H #endif //FTESTS_LOADERS_H