+private:
+ template<typename T>
+ class CommandFunction: public Command
+ {
+ private:
+ typedef void (T::*Func)(const std::string &);
+
+ T *obj;
+ Func func;
+ public:
+ CommandFunction(T *o, Func f): obj(o), func(f) { }
+
+ virtual void execute(const std::string &a)
+ { (obj->*func)(a); }
+ };
+
+ class CommandAlias: public Command
+ {
+ private:
+ Command *target;
+
+ public:
+ CommandAlias(Command *);
+
+ const Command *get_target() const { return target; }
+
+ virtual void execute(const std::string &);
+ };
+
+ typedef std::map<std::string, Command *> CommandMap;