| Rev | Line | |
|---|
| [48b662] | 1 | /**
|
|---|
| 2 | * @file com_execute_full_cycle_loop.cpp
|
|---|
| 3 | * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
|
|---|
| 4 | * @date Mon Apr 18 12:35:37 2011
|
|---|
| 5 | *
|
|---|
| 6 | * @brief Executes a set of cycles. foo_INIT and foo_FINALIZE
|
|---|
| 7 | * get executed once and foo_LOOP in a loop.
|
|---|
| 8 | *
|
|---|
| 9 | */
|
|---|
| 10 |
|
|---|
| 11 | #ifdef HAVE_CONFIG_H
|
|---|
| 12 | #include <config.h>
|
|---|
| 13 | #endif
|
|---|
| 14 |
|
|---|
| 15 | #include "base/command.hpp"
|
|---|
| 16 | #include "base/command_list.hpp"
|
|---|
| 17 |
|
|---|
| 18 | using namespace VMG;
|
|---|
| 19 |
|
|---|
| 20 | class VMGCommandExecuteFullCycleLoop : public Command
|
|---|
| 21 | {
|
|---|
| 22 | public:
|
|---|
| 23 | Request Run(Command::argument_vector arguments)
|
|---|
| 24 | {
|
|---|
| 25 | std::string str_init = arguments[0] + "_INIT";
|
|---|
| 26 | std::string str_loop = arguments[0] + "_LOOP";
|
|---|
| 27 | std::string str_finalize = arguments[0] + "_FINALIZE";
|
|---|
| 28 |
|
|---|
| 29 | MG::GetFactory().GetObject(str_init)->Cast<CommandList>()->ExecuteList();
|
|---|
| 30 |
|
|---|
| 31 | while (MG::GetFactory().GetObject(str_loop)->Cast<CommandList>()->ExecuteList() == Continue);
|
|---|
| 32 |
|
|---|
| 33 | MG::GetFactory().GetObject(str_finalize)->Cast<CommandList>()->ExecuteList();
|
|---|
| 34 |
|
|---|
| 35 | return Continue;
|
|---|
| 36 | }
|
|---|
| 37 |
|
|---|
| 38 | static const char* Name() {return "ExecuteFullCycleLoop";}
|
|---|
| 39 | static int Arguments() {return 1;}
|
|---|
| 40 | };
|
|---|
| 41 |
|
|---|
| 42 | CREATE_INITIALIZER(VMGCommandExecuteFullCycleLoop);
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.