| Rev | Line | |
|---|
| [48b662] | 1 | /**
|
|---|
| 2 | * @file command_list.hpp
|
|---|
| 3 | * @author Julian Iseringhausen <isering@ins.uni-bonn.de>
|
|---|
| 4 | * @date Tue Apr 5 20:28:02 2011
|
|---|
| [dfed1c] | 5 | *
|
|---|
| [48b662] | 6 | * @brief This class holds a list of commands. These commands
|
|---|
| 7 | * can be executed by calling ExecuteList.
|
|---|
| [dfed1c] | 8 | *
|
|---|
| [48b662] | 9 | */
|
|---|
| 10 |
|
|---|
| 11 | #ifndef COMMAND_LIST_HPP_
|
|---|
| 12 | #define COMMAND_LIST_HPP_
|
|---|
| 13 |
|
|---|
| 14 | #include <list>
|
|---|
| 15 | #include <string>
|
|---|
| 16 | #include <vector>
|
|---|
| 17 |
|
|---|
| 18 | #include "base/defs.hpp"
|
|---|
| 19 | #include "base/object.hpp"
|
|---|
| 20 |
|
|---|
| 21 | namespace VMG
|
|---|
| 22 | {
|
|---|
| 23 |
|
|---|
| 24 | class Command;
|
|---|
| 25 |
|
|---|
| 26 | class CommandList : public Object
|
|---|
| 27 | {
|
|---|
| 28 | public:
|
|---|
| 29 | typedef std::list< std::pair<std::string, std::vector<std::string> > >::iterator iterator;
|
|---|
| 30 |
|
|---|
| 31 | Request ExecuteList(); ///< Execute all commands in this list.
|
|---|
| 32 |
|
|---|
| 33 | void AddCommand(std::string command, std::string arguments = ""); ///< Add a command to the back of the list.
|
|---|
| 34 | void DeleteCommand(const CommandList::iterator& iter); ///< Remove a command from the list.
|
|---|
| 35 |
|
|---|
| 36 | void Print(); ///< Print all commands in list.
|
|---|
| 37 |
|
|---|
| 38 | void Clear(); ///< Remove all commands from list.
|
|---|
| 39 |
|
|---|
| 40 | private:
|
|---|
| 41 | std::list< std::pair<std::string, std::vector< std::string> > > commands;
|
|---|
| 42 | };
|
|---|
| 43 |
|
|---|
| 44 | }
|
|---|
| 45 |
|
|---|
| 46 | #endif /* COMMAND_LIST_HPP_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.