From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- docs/doxygen/nel/command_8h.html | 283 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 283 insertions(+) create mode 100644 docs/doxygen/nel/command_8h.html (limited to 'docs/doxygen/nel/command_8h.html') diff --git a/docs/doxygen/nel/command_8h.html b/docs/doxygen/nel/command_8h.html new file mode 100644 index 00000000..f85606a0 --- /dev/null +++ b/docs/doxygen/nel/command_8h.html @@ -0,0 +1,283 @@ + + + + nevrax.org : docs + + + + + + + + + + + + + + +
# Home   # nevrax.com   
+ + + + +
Nevrax
+ + + + + + + + + + +
+ + +
+ Nevrax.org
+ + + + + + + +
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
+
+ + +
+ + +
+Docs + +
+  + + + + + +
Documentation 
+ +
+Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  
+

command.h File Reference

Management of runtime command line processing. +More... +

+#include "nel/misc/types_nl.h"
+#include <string>
+#include <map>
+#include <vector>
+#include <sstream>
+#include <istream>
+#include "nel/misc/stream.h"
+#include "nel/misc/log.h"
+ +

+Go to the source code of this file. + + + + + + + + + +

Namespaces

namespace  NLMISC

Defines

#define NLMISC_COMMAND(__name, __help, __args)
 Create a function that can be call in realtime. More...

#define NLMISC_VARIABLE(__type, __var, __help)   NLMISC::CVariable<__type> __var##Instance(#__var, __help " (" #__type ")", &__var)
 Add a variable that can be modify in realtime. More...

#define NLMISC_DYNVARIABLE(__type, __name, __help)
 Add a variable that can be modify in realtime. More...

+


Detailed Description

+Management of runtime command line processing. +

+

+Id:
+ command.h,v 1.17 2002/11/29 10:07:54 lecroart Exp
+

+ +

+Definition in file command.h.


Define Documentation

+

+ + + + +
+ + + + + + + + + + + + + +
#define NLMISC_COMMAND__name,
__help,
__args   +
+
+ + + + + +
+   + + +

+Value:

struct __name##Class: public NLMISC::ICommand \
+{ \
+        __name##Class() : NLMISC::ICommand(#__name,__help,__args) { } \
+        virtual bool execute(const std::vector<std::string> &args, NLMISC::CLog &log); \
+}; \
+__name##Class __name##Instance; \
+bool __name##Class::execute(const std::vector<std::string> &args, NLMISC::CLog &log)
Create a function that can be call in realtime. +

+Example:

        // I want to create a function that compute the square of the parameter and display the result
+        NLMISC_COMMAND(square,"display the square of the parameter","<value>")
+        {
+                // check args, if there s not the right number of parameter, return bad
+                if(args.size() != 1) return false;
+                // get the value
+                uint32 val = atoi(args[0].c_str());
+                // display the result on the displayer
+                log.displayNL("The square of %d is %d", val, val*val);
+                return true;
+        }
+
+

+Please use the same casing than for the function (first letter in lower case and after each word first letter in upper case) ie: myFunction, step, orderByName, lookAtThis +

+

+Author:
+Vianney Lecroart , Nevrax France
+Date:
+2001
+

+Definition at line 71 of file command.h.

+

+ + + + +
+ + + + + + + + + + + + + +
#define NLMISC_DYNVARIABLE__type,
__name,
__help   +
+
+ + + + + +
+   + + +

+Add a variable that can be modify in realtime. +

+The code profide the way to access to the variable in the read and write access (depending of the get boolean value) +

+Example:

        // a function to read the variable
+        uint8 getVar() { return ...; }
+
+        // a function to write the variable
+        void setVar(uint8 val) { ...=val; }
+
+        // I want to look and change the variable in realtime:
+        NLMISC_DYNVARIABLE(uint8, FooBar, "this is a dummy variable")
+        {
+                // read or write the variable
+                if (get)
+                        *pointer = getVar();
+                else
+                        setVar(*pointer);
+        }
+
+

+Please use the same casing than for the variable (first letter of each word in upper case) ie: MyVariable, NetSpeedLoop, Time +

+

+Author:
+Vianney Lecroart , Nevrax France
+Date:
+2001
+

+Definition at line 136 of file command.h.

+

+ + + + +
+ + + + + + + + + + + + + +
#define NLMISC_VARIABLE__type,
__var,
__help      NLMISC::CVariable<__type> __var##Instance(#__var, __help " (" #__type ")", &__var) +
+
+ + + + + +
+   + + +

+Add a variable that can be modify in realtime. +

+The variable must be global. If you must acces the variable with function, use NLMISC_DYNVARIABLE +

+Example:

        // I want to look and change the variable 'foobar' in realtime, so, first i create it:
+        uint8 foobar;
+        // and then, I add it
+        NLMISC_VARIABLE(uint8, FooBar, "this is a dummy variable");
+
+

+Please use the same casing than for the variable (first letter of each word in upper case) ie: MyVariable, NetSpeedLoop, Time +

+

+Author:
+Vianney Lecroart , Nevrax France
+Date:
+2001
+

+Definition at line 101 of file command.h.

+ + + +
                                                                                                                                                                    +

+ + -- cgit v1.2.1