X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=simgear%2Fmisc%2Fcommands.hxx;h=288f82553e7443b34170d474b075c52ab19887ca;hb=5bab565cfe4c30d6cf08ecaba50af74d5e4f0c98;hp=6cfc53810e1d82840878141ef7cb303bbec64e5e;hpb=3980f08cc556865eadc94f854b08753aacb8f15d;p=simgear.git
diff --git a/simgear/misc/commands.hxx b/simgear/misc/commands.hxx
index 6cfc5381..288f8255 100644
--- a/simgear/misc/commands.hxx
+++ b/simgear/misc/commands.hxx
@@ -11,26 +11,68 @@
#define __COMMANDS_HXX
-#include
There are convenience methods for invoking a command function * with no arguments or with a single, primitive argument.
@@ -44,7 +86,8 @@ public: /** * Type for a command function. */ - typedef bool (*command_t) (const SGPropertyNode * arg); + typedef bool (*command_t) (const SGPropertyNode * arg, + SGCommandState ** state); /** @@ -103,104 +146,106 @@ public: * @return true if the command is present and executes successfully, * false otherwise. */ - virtual bool execute (const string &name, const SGPropertyNode * arg) const; - - - /** - * Execute a command with no argument. - * - * The command function will receive a pointer to a property node - * with no value and no children. - * - * @param name The name of the command. - * @return true if the command is present and executes successfully, - * false otherwise. - */ - virtual bool execute (const string &name) const; - - - /** - * Execute a command with a single bool argument. - * - * The command function will receive a pointer to a property node - * with a bool value and no children. - * - * @param name The name of the command. - * @param arg The bool argument to the command. - * @return true if the command is present and executes successfully, - * false otherwise. - */ - virtual bool execute (const string &name, bool arg) const; - - - /** - * Execute a command with a single int argument. - * - * The command function will receive a pointer to a property node - * with a int value and no children. - * - * @param name The name of the command. - * @param arg The int argument to the command. - * @return true if the command is present and executes successfully, - * false otherwise. - */ - virtual bool execute (const string &name, int arg) const; - - - /** - * Execute a command with a single long argument. - * - * The command function will receive a pointer to a property node - * with a long value and no children. - * - * @param name The name of the command. - * @param arg The long argument to the command. - * @return true if the command is present and executes successfully, - * false otherwise. - */ - virtual bool execute (const string &name, long arg) const; - - - /** - * Execute a command with a single float argument. - * - * The command function will receive a pointer to a property node - * with a float value and no children. - * - * @param name The name of the command. - * @param arg The float argument to the command. - * @return true if the command is present and executes successfully, - * false otherwise. - */ - virtual bool execute (const string &name, float arg) const; - - - /** - * Execute a command with a single double argument. - * - * The command function will receive a pointer to a property node - * with a double value and no children. - * - * @param name The name of the command. - * @param arg The double argument to the command. - * @return true if the command is present and executes successfully, - * false otherwise. - */ - virtual bool execute (const string &name, double arg) const; - - - /** - * Execute a command with a single string argument. - * - * The command function will receive a pointer to a property node - * with a string value and no children. - * - * @param name The name of the command. - * @param arg The string argument to the command. - * @return true if the command is present and executes successfully, - * false otherwise. - */ - virtual bool execute (const string &name, string arg) const; + virtual bool execute (const string &name, + const SGPropertyNode * arg, + SGCommandState ** state) const; + + +// /** +// * Execute a command with no argument. +// * +// * The command function will receive a pointer to a property node +// * with no value and no children. +// * +// * @param name The name of the command. +// * @return true if the command is present and executes successfully, +// * false otherwise. +// */ +// virtual bool execute (const string &name) const; + + +// /** +// * Execute a command with a single bool argument. +// * +// * The command function will receive a pointer to a property node +// * with a bool value and no children. +// * +// * @param name The name of the command. +// * @param arg The bool argument to the command. +// * @return true if the command is present and executes successfully, +// * false otherwise. +// */ +// virtual bool execute (const string &name, bool arg) const; + + +// /** +// * Execute a command with a single int argument. +// * +// * The command function will receive a pointer to a property node +// * with a int value and no children. +// * +// * @param name The name of the command. +// * @param arg The int argument to the command. +// * @return true if the command is present and executes successfully, +// * false otherwise. +// */ +// virtual bool execute (const string &name, int arg) const; + + +// /** +// * Execute a command with a single long argument. +// * +// * The command function will receive a pointer to a property node +// * with a long value and no children. +// * +// * @param name The name of the command. +// * @param arg The long argument to the command. +// * @return true if the command is present and executes successfully, +// * false otherwise. +// */ +// virtual bool execute (const string &name, long arg) const; + + +// /** +// * Execute a command with a single float argument. +// * +// * The command function will receive a pointer to a property node +// * with a float value and no children. +// * +// * @param name The name of the command. +// * @param arg The float argument to the command. +// * @return true if the command is present and executes successfully, +// * false otherwise. +// */ +// virtual bool execute (const string &name, float arg) const; + + +// /** +// * Execute a command with a single double argument. +// * +// * The command function will receive a pointer to a property node +// * with a double value and no children. +// * +// * @param name The name of the command. +// * @param arg The double argument to the command. +// * @return true if the command is present and executes successfully, +// * false otherwise. +// */ +// virtual bool execute (const string &name, double arg) const; + + +// /** +// * Execute a command with a single string argument. +// * +// * The command function will receive a pointer to a property node +// * with a string value and no children. +// * +// * @param name The name of the command. +// * @param arg The string argument to the command. +// * @return true if the command is present and executes successfully, +// * false otherwise. +// */ +// virtual bool execute (const string &name, string arg) const; private: @@ -210,6 +255,6 @@ private: }; -#endif __COMMANDS_HXX +#endif // __COMMANDS_HXX // end of commands.hxx