Definition in file variable.h.
#include "nel/misc/types_nl.h"
#include "nel/misc/command.h"
#include "nel/misc/value_smoother.h"
Go to the source code of this file.
Namespaces | |
namespace | NLMISC |
Defines | |
#define | NLMISC_DYNVARIABLE(__type, __name, __help) |
#define | NLMISC_VARIABLE(__type, __var, __help) NLMISC::CVariablePtr<__type> __var##Instance(#__var, __help " (" #__type ")", &__var) |
|
Value: class __name##Class : public NLMISC::IVariable \ { \ public: \ __name##Class () : IVariable(#__name, __help) { } \ \ virtual void fromString(const std::string &val, bool human=false) \ { \ /*std::stringstream ss (val);*/ \ __type p; \ /*ss >> p;*/ \ NLMISC::fromString(val, p) ; \ ptr (&p, false, human); \ } \ \ virtual std::string toString(bool human) const \ { \ __type p; \ ptr (&p, true, human); \ /*std::stringstream ss;*/ \ /*ss << p;*/ \ /*return ss.str();*/ \ return NLMISC::toString(p); \ } \ \ void ptr(__type *pointer, bool get, bool human) const; \ }; \ __name##Class __name##Instance; \ void __name##Class::ptr(__type *pointer, bool get, bool human) const get boolean value)Example:
Please use the same casing than for the variable (first letter of each word in upper case) ie: MyVariable, NetSpeedLoop, Time
Definition at line 99 of file variable.h. |
|
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:
Please use the same casing than for the variable (first letter of each word in upper case) ie: MyVariable, NetSpeedLoop, Time
Definition at line 64 of file variable.h. |