FlightGear next
|
#include <NasalSys.hxx>
Inherits SGSubsystem.
Public Member Functions | |
FGNasalSys () | |
virtual | ~FGNasalSys () |
void | init () override |
void | shutdown () override |
void | update (double dt) override |
bool | loadModule (SGPath file, const char *moduleName) |
bool | parseAndRun (const std::string &source) |
bool | parseAndRunWithOutput (const std::string &source, std::string &output, std::string &errors) |
void | setTimer (naContext c, int argc, naRef *args) |
naRef | setListener (naContext c, int argc, naRef *args) |
naRef | removeListener (naContext c, int argc, naRef *args) |
naRef | cmdArgGhost () |
void | setCmdArg (SGPropertyNode *aNode) |
naRef | wrappedPropsNode (SGPropertyNode *aProps) |
create Nasal props.Node for an SGPropertyNode* This is the actual ghost, wrapped in a Nasal sugar class. | |
virtual bool | handleCommand (const char *moduleName, const char *fileName, const char *src, const SGPropertyNode *arg=0, SGPropertyNode *root=0) |
virtual bool | handleCommand (const SGPropertyNode *arg, SGPropertyNode *root) |
bool | createModule (const char *moduleName, const char *fileName, const char *src, int len, const SGPropertyNode *cmdarg=0, int argc=0, naRef *args=0) |
void | deleteModule (const char *moduleName) |
naRef | getModule (const std::string &moduleName) const |
naRef | getModule (const char *moduleName) |
bool | addCommand (naRef func, const std::string &name) |
bool | removeCommand (const std::string &name) |
void | hashset (naRef hash, const char *key, naRef val) |
Set member of specified hash to given value. | |
void | globalsSet (const char *key, naRef val) |
Set member of globals hash to given value. | |
naRef | call (naRef code, int argc, naRef *args, naRef locals) |
naRef | callWithContext (naContext ctx, naRef code, int argc, naRef *args, naRef locals) |
naRef | callMethod (naRef code, naRef self, int argc, naRef *args, naRef locals) |
naRef | callMethodWithContext (naContext ctx, naRef code, naRef self, int argc, naRef *args, naRef locals) |
naRef | propNodeGhost (SGPropertyNode *handle) |
void | registerToLoad (FGNasalModelData *data) |
void | registerToUnload (FGNasalModelData *data) |
naRef | nasalGlobals () const |
nasal::Hash | getGlobals () const |
int | gcSave (naRef r) |
void | gcRelease (int key) |
bool | checkIOrules () |
Check if IOrules correctly work to limit access from Nasal scripts to the file system. | |
simgear::BufferedLogCallback * | log () const |
retrive the associated log object, for displaying log output somewhere (a UI, presumably) | |
string_list | getAndClearErrorList () |
bool | reloadModuleFromFile (const std::string &moduleName) |
Static Public Member Functions | |
static const char * | staticSubsystemClassId () |
static naRef | getPropertyValue (naContext c, SGPropertyNode *node) |
Convert the value of an SGPropertyNode to its Nasal representation. | |
Definition at line 33 of file NasalSys.hxx.
FGNasalSys::FGNasalSys | ( | ) |
Definition at line 286 of file NasalSys.cxx.
|
virtual |
Definition at line 354 of file NasalSys.cxx.
bool FGNasalSys::addCommand | ( | naRef | func, |
const std::string & | name ) |
Definition at line 1892 of file NasalSys.cxx.
naRef FGNasalSys::call | ( | naRef | code, |
int | argc, | ||
naRef * | args, | ||
naRef | locals ) |
Definition at line 314 of file NasalSys.cxx.
naRef FGNasalSys::callMethod | ( | naRef | code, |
naRef | self, | ||
int | argc, | ||
naRef * | args, | ||
naRef | locals ) |
Definition at line 331 of file NasalSys.cxx.
naRef FGNasalSys::callMethodWithContext | ( | naContext | ctx, |
naRef | code, | ||
naRef | self, | ||
int | argc, | ||
naRef * | args, | ||
naRef | locals ) |
Definition at line 341 of file NasalSys.cxx.
naRef FGNasalSys::callWithContext | ( | naContext | ctx, |
naRef | code, | ||
int | argc, | ||
naRef * | args, | ||
naRef | locals ) |
Definition at line 319 of file NasalSys.cxx.
bool FGNasalSys::checkIOrules | ( | ) |
Check if IOrules correctly work to limit access from Nasal scripts to the file system.
naRef FGNasalSys::cmdArgGhost | ( | ) |
Definition at line 1046 of file NasalSys.cxx.
bool FGNasalSys::createModule | ( | const char * | moduleName, |
const char * | fileName, | ||
const char * | src, | ||
int | len, | ||
const SGPropertyNode * | cmdarg = 0, | ||
int | argc = 0, | ||
naRef * | args = 0 ) |
Definition at line 1506 of file NasalSys.cxx.
void FGNasalSys::deleteModule | ( | const char * | moduleName | ) |
Definition at line 1558 of file NasalSys.cxx.
void FGNasalSys::gcRelease | ( | int | key | ) |
Definition at line 1787 of file NasalSys.cxx.
int FGNasalSys::gcSave | ( | naRef | r | ) |
Definition at line 1782 of file NasalSys.cxx.
string_list FGNasalSys::getAndClearErrorList | ( | ) |
nasal::Hash FGNasalSys::getGlobals | ( | ) | const |
Definition at line 2146 of file NasalSys.cxx.
naRef FGNasalSys::getModule | ( | const char * | moduleName | ) |
Definition at line 1633 of file NasalSys.cxx.
naRef FGNasalSys::getModule | ( | const std::string & | moduleName | ) | const |
Definition at line 1627 of file NasalSys.cxx.
|
static |
Convert the value of an SGPropertyNode to its Nasal representation.
Used by props.Node.getValue internally, but exposed here for other use cases which don't want to create a props.Node wrapper each time.
Definition at line 942 of file nasal-props.cxx.
void FGNasalSys::globalsSet | ( | const char * | key, |
naRef | val ) |
Set member of globals hash to given value.
Definition at line 309 of file NasalSys.cxx.
|
virtual |
Definition at line 1683 of file NasalSys.cxx.
|
virtual |
Definition at line 1720 of file NasalSys.cxx.
void FGNasalSys::hashset | ( | naRef | hash, |
const char * | key, | ||
naRef | val ) |
Set member of specified hash to given value.
Definition at line 302 of file NasalSys.cxx.
|
override |
Definition at line 1068 of file NasalSys.cxx.
bool FGNasalSys::loadModule | ( | SGPath | file, |
const char * | moduleName ) |
Definition at line 1488 of file NasalSys.cxx.
simgear::BufferedLogCallback * FGNasalSys::log | ( | ) | const |
retrive the associated log object, for displaying log output somewhere (a UI, presumably)
Definition at line 2136 of file NasalSys.cxx.
naRef FGNasalSys::nasalGlobals | ( | ) | const |
Definition at line 2141 of file NasalSys.cxx.
bool FGNasalSys::parseAndRun | ( | const std::string & | source | ) |
Definition at line 388 of file NasalSys.cxx.
bool FGNasalSys::parseAndRunWithOutput | ( | const std::string & | source, |
std::string & | output, | ||
std::string & | errors ) |
Definition at line 364 of file NasalSys.cxx.
naRef FGNasalSys::propNodeGhost | ( | SGPropertyNode * | handle | ) |
Definition at line 43 of file nasal-props.cxx.
void FGNasalSys::registerToLoad | ( | FGNasalModelData * | data | ) |
Definition at line 1880 of file NasalSys.cxx.
void FGNasalSys::registerToUnload | ( | FGNasalModelData * | data | ) |
Definition at line 1887 of file NasalSys.cxx.
bool FGNasalSys::reloadModuleFromFile | ( | const std::string & | moduleName | ) |
Definition at line 1592 of file NasalSys.cxx.
bool FGNasalSys::removeCommand | ( | const std::string & | name | ) |
Definition at line 1904 of file NasalSys.cxx.
naRef FGNasalSys::removeListener | ( | naContext | c, |
int | argc, | ||
naRef * | args ) |
Definition at line 1865 of file NasalSys.cxx.
void FGNasalSys::setCmdArg | ( | SGPropertyNode * | aNode | ) |
Definition at line 1063 of file NasalSys.cxx.
naRef FGNasalSys::setListener | ( | naContext | c, |
int | argc, | ||
naRef * | args ) |
Definition at line 1827 of file NasalSys.cxx.
void FGNasalSys::setTimer | ( | naContext | c, |
int | argc, | ||
naRef * | args ) |
Definition at line 1742 of file NasalSys.cxx.
|
override |
Definition at line 1191 of file NasalSys.cxx.
|
inlinestatic |
Definition at line 45 of file NasalSys.hxx.
|
override |
Definition at line 1262 of file NasalSys.cxx.
naRef FGNasalSys::wrappedPropsNode | ( | SGPropertyNode * | aProps | ) |
create Nasal props.Node for an SGPropertyNode* This is the actual ghost, wrapped in a Nasal sugar class.
Definition at line 1247 of file NasalSys.cxx.