+
+class FGNasalListener : public SGPropertyChangeListener {
+public:
+ FGNasalListener(SGPropertyNode* node, naRef code, FGNasalSys* nasal,
+ int key, int id, int init, int type);
+
+ virtual ~FGNasalListener();
+ virtual void valueChanged(SGPropertyNode* node);
+ virtual void childAdded(SGPropertyNode* parent, SGPropertyNode* child);
+ virtual void childRemoved(SGPropertyNode* parent, SGPropertyNode* child);
+
+private:
+ bool changed(SGPropertyNode* node);
+ void call(SGPropertyNode* which, naRef mode);
+
+ friend class FGNasalSys;
+ SGPropertyNode_ptr _node;
+ naRef _code;
+ int _gcKey;
+ int _id;
+ FGNasalSys* _nas;
+ int _init;
+ int _type;
+ unsigned int _active;
+ bool _dead;
+ long _last_int;
+ double _last_float;
+ string _last_string;
+};
+
+
+class NasalXMLVisitor : public XMLVisitor {
+public:
+ NasalXMLVisitor(naContext c, int argc, naRef* args);
+ virtual ~NasalXMLVisitor() { naFreeContext(_c); }
+
+ virtual void startElement(const char* tag, const XMLAttributes& a);
+ virtual void endElement(const char* tag);
+ virtual void data(const char* str, int len);
+ virtual void pi(const char* target, const char* data);
+
+private:
+ void call(naRef func, int num, naRef a = naNil(), naRef b = naNil());
+ naRef make_string(const char* s, int n = -1);
+
+ naContext _c;
+ naRef _start_element, _end_element, _data, _pi;
+};
+