/** * @file com_execute_full_cycle_loop.cpp * @author Julian Iseringhausen * @date Mon Apr 18 12:35:37 2011 * * @brief Executes a set of cycles. foo_INIT and foo_FINALIZE * get executed once and foo_LOOP in a loop. * */ #ifdef HAVE_CONFIG_H #include #endif #include "base/command.hpp" #include "base/command_list.hpp" using namespace VMG; class VMGCommandExecuteFullCycleLoop : public Command { public: Request Run(Command::argument_vector arguments) { std::string str_init = arguments[0] + "_INIT"; std::string str_loop = arguments[0] + "_LOOP"; std::string str_finalize = arguments[0] + "_FINALIZE"; MG::GetFactory().GetObject(str_init)->Cast()->ExecuteList(); while (MG::GetFactory().GetObject(str_loop)->Cast()->ExecuteList() == Continue); MG::GetFactory().GetObject(str_finalize)->Cast()->ExecuteList(); return Continue; } static const char* Name() {return "ExecuteFullCycleLoop";} static int Arguments() {return 1;} }; CREATE_INITIALIZER(VMGCommandExecuteFullCycleLoop);