1 // Expose FGProtocol module to Nasal to enable I/O protocols to be implemented in Nasal space, e.g.
2 // to support REST/AJAX, JSON or HTTP WebSockets
4 // Copyright (C) 2013 The FlightGear community
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License as
8 // published by the Free Software Foundation; either version 2 of the
9 // License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful, but
12 // WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #include "NasalFGProtocol.hxx"
25 #include <Main/globals.hxx>
26 #include <Main/util.hxx>
28 #include <simgear/nasal/cppbind/from_nasal.hxx>
29 #include <simgear/nasal/cppbind/to_nasal.hxx>
30 #include <simgear/nasal/cppbind/NasalHash.hxx>
31 #include <simgear/nasal/cppbind/Ghost.hxx>
33 typedef boost::shared_ptr<FGProtocol> FGProtocol_ptr;
34 typedef nasal::Ghost< FGProtocol_ptr > NasalFGProtocol;
37 //------------------------------------------------------------------------------
38 naRef initNasalFGProtocol(naRef globals, naContext c)
40 NasalFGProtocol::init("io.fgprotocol");
42 // This is where you want to expose various methods from FGProtocol/NetChat/NetChannel