#if defined (_MSC_VER) && (_MSC_VER >= 1000) #pragma once #endif #ifndef _INC_SCHEDULEDRIVEN #define _INC_SCHEDULEDRIVEN #include "ControlCenter.h" #include "stdafx.h" namespace mial{ #define MAXCOMMANDLENGTH 200 //! ControlCenter that reads the schedule and peforms the listed behaviors sequentially. /*! A derived class of the ControlCenter ABC, it provides a schedule driven form of control wherein the deformable organisms proceeds sequentially through the actions listed in a file. One could also pipe the command prompt into the deformable organism instead and illicit direct sequential control over each behavior. */ template class Ctrl_ScheduleDriven : public ControlCenter { public: //Smartpointers typedef Ctrl_ScheduleDriven Self; typedef itk::SmartPointer Pointer; typedef itk::SmartPointer ConstPointer; typedef itk::WeakPointer ConstWeakPointer; itkNewMacro(Self); //! Decide the next behavior by reading the next line of the schedule file. virtual bool decideNextBehavior(); //! Set the schedule to be used. /*! \param n The name of the schedule to be used. */ virtual bool setSchedule(std::string n){ scName = n; return false;}; // inline //! This class runs everything via streams std::stringstream behaviorToRunStream; private: //! The name of schedule file. std::string scName; //! State variable bool setup; //! The file stream std::ifstream in; protected: //!Default constructor Ctrl_ScheduleDriven(); }; }//end mial #include "Ctrl_ScheduleDriven.cxx" #endif /* _INC_SCHEDULEDRIVEN*/