#ifndef _Ctrl_ScheduleDriven_txx #define _Ctrl_ScheduleDriven_txx #include "Ctrl_ScheduleDriven.h" using namespace mial; //{ template Ctrl_ScheduleDriven::Ctrl_ScheduleDriven() :ControlCenter() { //scName = n; //Make the base class stream pointer point to the runStream this->setBehaviorToRunStream(&behaviorToRunStream); setup = false; } template bool Ctrl_ScheduleDriven::decideNextBehavior() { //Clear the current arg stream behaviorToRunStream.str(std::string()); //Clear any errors behaviorToRunStream.clear(); //Read next command from file if(!setup) { in.open(scName.c_str()); setup = true; } std::string cmd; std::string name; if(!in.is_open()) { this->behaviorToRun = NULL; return false; } else { if(!in.eof()) { in >> name; getline(in,cmd,'\n'); this->behaviorToRun = this->findBehavior(name); behaviorToRunStream << cmd; std::cout << cmd; std::cout << behaviorToRunStream.str(); } else { in.close(); this->behaviorToRun = NULL; } //Put the stream in the args //behaviorToRunArgs = (void *)&behaviorToRunStream; return true; } } //}//end mial #endif