Howto:Extend Nasal: Difference between revisions

Jump to navigation Jump to search
m
Line 286: Line 286:
'''To be written by Hooray & Zakalawe'''
'''To be written by Hooray & Zakalawe'''


For the time being, it's a good idea to take a look at the FGPositioned wrappers for the navdb to see how this is done in Nasal, see [https://gitorious.org/fg/flightgear/blobs/next/src/Scripting/NasalPositioned.cxx $FG_SRC/Scripting/NasalPositioned.cxx].
== Background ==
Quoting: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg17546.html
Quoting: http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg17546.html
<pre>
<pre>
Line 337: Line 340:
</pre>
</pre>


For the time being, it's a good idea to take a look at the FGPositioned wrappers for the navdb to see how this is done in Nasal, see [https://gitorious.org/fg/flightgear/blobs/next/src/Scripting/NasalPositioned.cxx $FG_SRC/Scripting/NasalPositioned.cxx].
== A standard interface for mapping C++ classes to Nasal objects ==


There's a plan to eventually unify all those helpers and provide them as part of the FGNasalSys class (or some custom abstract base class that C++ classes should implement to expose objects to Nasal), so that they automatically become available to all users of the Nasal subsystem.
There's a plan to eventually unify all those helpers and provide them as part of the FGNasalSys class (or some custom abstract base class that C++ classes should implement to expose objects to Nasal), so that they automatically become available to all users of the Nasal subsystem.
Line 396: Line 399:
private:
private:
};
};
</syntaxhighlight lang="cpp">
</syntaxhighlight>


The ghost_destructor could also be implemented as a method of FGNasalWrapper (rather than being a global void* function), so that each C++ class that is to be exposed to Nasal, would only need to implement the class-specific methods.
The ghost_destructor could also be implemented as a method of FGNasalWrapper (rather than being a global void* function), so that each C++ class that is to be exposed to Nasal, would only need to implement the class-specific methods.

Navigation menu