Index: src/plugin/Makefile.am
===================================================================
--- src/plugin/Makefile.am	(revision 13)
+++ src/plugin/Makefile.am	(revision 13)
@@ -0,0 +1,1 @@
+SUBDIRS=src
Index: src/plugin/Makefile.am
===================================================================
--- src/plugin/Makefile.am	(revision 13)
+++ 	(revision )
@@ -1,1 +1,0 @@
-SUBDIRS=src
Index: src/plugin/bootstrap.sh
===================================================================
--- src/plugin/bootstrap.sh	(revision 13)
+++ src/plugin/bootstrap.sh	(revision 13)
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e -u
+
+scriptdir=`dirname $0`
+
+cd "${scriptdir}"
+
+#libtoolize
+aclocal -I $1
+automake -a
+autoconf
Index: src/plugin/bootstrap.sh
===================================================================
--- src/plugin/bootstrap.sh	(revision 13)
+++ 	(revision )
@@ -1,12 +1,0 @@
-#!/bin/sh
-
-set -e -u
-
-scriptdir=`dirname $0`
-
-cd "${scriptdir}"
-
-#libtoolize
-aclocal -I $1
-automake -a
-autoconf
Index: src/plugin/src/Makefile.am
===================================================================
--- src/plugin/src/Makefile.am	(revision 13)
+++ src/plugin/src/Makefile.am	(revision 13)
@@ -0,0 +1,1 @@
+SUBDIRS=xplra
Index: src/plugin/src/Makefile.am
===================================================================
--- src/plugin/src/Makefile.am	(revision 13)
+++ 	(revision )
@@ -1,1 +1,0 @@
-SUBDIRS=xplra
Index: src/plugin/src/xplra/.copyright
===================================================================
--- src/plugin/src/xplra/.copyright	(revision 13)
+++ src/plugin/src/xplra/.copyright	(revision 13)
@@ -0,0 +1,23 @@
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
Index: src/plugin/src/xplra/.copyright
===================================================================
--- src/plugin/src/xplra/.copyright	(revision 13)
+++ 	(revision )
@@ -1,23 +1,0 @@
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
Index: src/plugin/src/xplra/.namespace
===================================================================
--- src/plugin/src/xplra/.namespace	(revision 13)
+++ src/plugin/src/xplra/.namespace	(revision 13)
@@ -0,0 +1,1 @@
+xplra
Index: src/plugin/src/xplra/.namespace
===================================================================
--- src/plugin/src/xplra/.namespace	(revision 13)
+++ 	(revision )
@@ -1,1 +1,0 @@
-xplra
Index: src/plugin/src/xplra/.srcmessage
===================================================================
--- src/plugin/src/xplra/.srcmessage	(revision 13)
+++ src/plugin/src/xplra/.srcmessage	(revision 13)
@@ -0,0 +1,1 @@
+// This file is part of XPLRA, a remote-access plugin for X-Plane
Index: src/plugin/src/xplra/.srcmessage
===================================================================
--- src/plugin/src/xplra/.srcmessage	(revision 13)
+++ 	(revision )
@@ -1,1 +1,0 @@
-// This file is part of XPLRA, a remote-access plugin for X-Plane
Index: src/plugin/src/xplra/DataRefTask.cc
===================================================================
--- src/plugin/src/xplra/DataRefTask.cc	(revision 13)
+++ src/plugin/src/xplra/DataRefTask.cc	(revision 13)
@@ -0,0 +1,61 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "DataRefTask.h"
+
+#include "hu/varadiistvan/xplcommon/Util.h"
+
+//------------------------------------------------------------------------------
+
+using xplra::DataRefTask;
+
+using hu::varadiistvan::xplcommon::Util;
+
+//------------------------------------------------------------------------------
+
+void DataRefTask::perform()
+{
+    if (dataRef==0) {
+        // Util::debug("DataRefTask::perform: name='%s'\n", name.c_str());
+        dataRef = XPLMFindDataRef(name.c_str());
+        // Util::debug("DataRefTask::perform: dataRef=%p\n", dataRef);
+    }
+    if (dataRef!=0) {
+        process();
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/DataRefTask.cc
===================================================================
--- src/plugin/src/xplra/DataRefTask.cc	(revision 13)
+++ 	(revision )
@@ -1,61 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "DataRefTask.h"
-
-#include "hu/varadiistvan/xplcommon/Util.h"
-
-//------------------------------------------------------------------------------
-
-using xplra::DataRefTask;
-
-using hu::varadiistvan::xplcommon::Util;
-
-//------------------------------------------------------------------------------
-
-void DataRefTask::perform()
-{
-    if (dataRef==0) {
-        // Util::debug("DataRefTask::perform: name='%s'\n", name.c_str());
-        dataRef = XPLMFindDataRef(name.c_str());
-        // Util::debug("DataRefTask::perform: dataRef=%p\n", dataRef);
-    }
-    if (dataRef!=0) {
-        process();
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/DataRefTask.h
===================================================================
--- src/plugin/src/xplra/DataRefTask.h	(revision 13)
+++ src/plugin/src/xplra/DataRefTask.h	(revision 13)
@@ -0,0 +1,155 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_DATAREFTASK_H
+#define XPLRA_DATAREFTASK_H
+//------------------------------------------------------------------------------
+
+#include "Task.h"
+
+#include <XPLMDataAccess.h>
+
+#include <string>
+
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A task that works with some dataref. This base class
+ * performs the mapping from dataref name to dataref value. The actual
+ * operation is performed by the subclasses.
+ */
+class DataRefTask : public Task
+{
+private:
+    /**
+     * The name of the dataref.
+     */
+    std::string name;
+
+    /**
+     * The dataref.
+     */
+    XPLMDataRef dataRef;
+
+protected:
+    /**
+     * Construct the dataref task for the dataref with the given name.
+     */
+    DataRefTask(const std::string& name);
+
+    /**
+     * Construct the dataref task for the given dataref.
+     */
+    DataRefTask(XPLMDataRef dataRef);
+
+public:
+    /**
+     * Determine if the task is valid, which is so, if the dataref is
+     * not 0.
+     */
+    bool isValid() const;
+
+    /**
+     * Get the name of the dataref.
+     */
+    const std::string& getName() const;
+
+    /**
+     * Get the dataref.
+     */
+    XPLMDataRef getDataRef() const;
+
+protected:
+    /**
+     * Perform the task. If the dataref is not valid yet, it will be
+     * queried. If the query is successful, the process() function is
+     * called.
+     */
+    virtual void perform();
+
+    /**
+     * Process the dataref. When this function is called, the dataref
+     * is valid.
+     */
+    virtual void process() = 0;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline DataRefTask::DataRefTask(const std::string& name) :
+    name(name),
+    dataRef(0)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline DataRefTask::DataRefTask(XPLMDataRef dataRef) :
+    dataRef(dataRef)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline bool DataRefTask::isValid() const
+{
+    return dataRef!=0;
+}
+
+//------------------------------------------------------------------------------
+
+inline const std::string& DataRefTask::getName() const
+{
+    return name;
+}
+
+//------------------------------------------------------------------------------
+
+inline XPLMDataRef DataRefTask::getDataRef() const
+{
+    return dataRef;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_DATAREFTASK_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/DataRefTask.h
===================================================================
--- src/plugin/src/xplra/DataRefTask.h	(revision 13)
+++ 	(revision )
@@ -1,155 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_DATAREFTASK_H
-#define XPLRA_DATAREFTASK_H
-//------------------------------------------------------------------------------
-
-#include "Task.h"
-
-#include <XPLMDataAccess.h>
-
-#include <string>
-
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-/**
- * A task that works with some dataref. This base class
- * performs the mapping from dataref name to dataref value. The actual
- * operation is performed by the subclasses.
- */
-class DataRefTask : public Task
-{
-private:
-    /**
-     * The name of the dataref.
-     */
-    std::string name;
-
-    /**
-     * The dataref.
-     */
-    XPLMDataRef dataRef;
-
-protected:
-    /**
-     * Construct the dataref task for the dataref with the given name.
-     */
-    DataRefTask(const std::string& name);
-
-    /**
-     * Construct the dataref task for the given dataref.
-     */
-    DataRefTask(XPLMDataRef dataRef);
-
-public:
-    /**
-     * Determine if the task is valid, which is so, if the dataref is
-     * not 0.
-     */
-    bool isValid() const;
-
-    /**
-     * Get the name of the dataref.
-     */
-    const std::string& getName() const;
-
-    /**
-     * Get the dataref.
-     */
-    XPLMDataRef getDataRef() const;
-
-protected:
-    /**
-     * Perform the task. If the dataref is not valid yet, it will be
-     * queried. If the query is successful, the process() function is
-     * called.
-     */
-    virtual void perform();
-
-    /**
-     * Process the dataref. When this function is called, the dataref
-     * is valid.
-     */
-    virtual void process() = 0;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline DataRefTask::DataRefTask(const std::string& name) :
-    name(name),
-    dataRef(0)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline DataRefTask::DataRefTask(XPLMDataRef dataRef) :
-    dataRef(dataRef)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline bool DataRefTask::isValid() const
-{
-    return dataRef!=0;
-}
-
-//------------------------------------------------------------------------------
-
-inline const std::string& DataRefTask::getName() const
-{
-    return name;
-}
-
-//------------------------------------------------------------------------------
-
-inline XPLMDataRef DataRefTask::getDataRef() const
-{
-    return dataRef;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_DATAREFTASK_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/GetDataRefTask.cc
===================================================================
--- src/plugin/src/xplra/GetDataRefTask.cc	(revision 13)
+++ src/plugin/src/xplra/GetDataRefTask.cc	(revision 13)
@@ -0,0 +1,125 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "GetDataRefTask.h"
+#include "Protocol.h"
+
+#include "hu/varadiistvan/xplcommon/Util.h"
+
+//------------------------------------------------------------------------------
+
+using xplra::GetDataRefTask;
+using xplra::GetIntDataRefTask;
+using xplra::GetFloatDataRefTask;
+using xplra::GetDoubleDataRefTask;
+
+using hu::varadiistvan::scpl::io::DataStream;
+using hu::varadiistvan::xplcommon::Util;
+
+using std::string;
+
+//------------------------------------------------------------------------------
+
+GetDataRefTask* GetDataRefTask::create(uint8_t& result, DataStream& stream)
+{
+    result = Protocol::RESULT_OK;
+
+    string name = stream.readString();
+    uint8_t type = stream.readU8();
+    if (!stream) return 0;
+
+    // Util::debug("hu.varadiistvan.xplra.GetDataRefTask::execute: name='%s', type=0x%02x\n",
+    //             name.c_str(), type);
+
+    if (type==Protocol::TYPE_INT) {
+        return new GetIntDataRefTask(name);
+    } else if (type==Protocol::TYPE_FLOAT) {
+        return new GetFloatDataRefTask(name);
+    } else if (type==Protocol::TYPE_DOUBLE) {
+        return new GetDoubleDataRefTask(name);
+    } else if (type==Protocol::TYPE_FLOAT_ARRAY ||
+               type==Protocol::TYPE_INT_ARRAY ||
+               type==Protocol::TYPE_BYTE_ARRAY)
+    {
+        int length = stream.readS32();
+        int offset = stream.readS32();
+        if (!stream) return 0;
+
+        if (length>Protocol::MAX_LENGTH) {
+            result = Protocol::RESULT_INVALID_LENGTH;
+            return 0;
+        }
+        if (offset<0) {
+            result = Protocol::RESULT_INVALID_OFFSET;
+            return 0;
+        }
+
+        if (type==Protocol::TYPE_FLOAT_ARRAY) {
+            return new GetFloatArrayDataRefTask(name, length, offset);
+        } else if (type==Protocol::TYPE_INT_ARRAY) {
+            return new GetIntArrayDataRefTask(name, length, offset);
+        } else {
+            return new GetByteArrayDataRefTask(name, length, offset);
+        }
+    } else {
+        result = Protocol::RESULT_INVALID_TYPE;
+        return 0;
+    }
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+void GetIntDataRefTask::writeValue(DataStream& stream)
+{
+    stream.writeS32(getValue());
+}
+
+//------------------------------------------------------------------------------
+
+void GetFloatDataRefTask::writeValue(DataStream& stream)
+{
+    stream.writeFloat(getValue());
+}
+
+//------------------------------------------------------------------------------
+
+void GetDoubleDataRefTask::writeValue(DataStream& stream)
+{
+    stream.writeDouble(getValue());
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/GetDataRefTask.cc
===================================================================
--- src/plugin/src/xplra/GetDataRefTask.cc	(revision 13)
+++ 	(revision )
@@ -1,125 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "GetDataRefTask.h"
-#include "Protocol.h"
-
-#include "hu/varadiistvan/xplcommon/Util.h"
-
-//------------------------------------------------------------------------------
-
-using xplra::GetDataRefTask;
-using xplra::GetIntDataRefTask;
-using xplra::GetFloatDataRefTask;
-using xplra::GetDoubleDataRefTask;
-
-using hu::varadiistvan::scpl::io::DataStream;
-using hu::varadiistvan::xplcommon::Util;
-
-using std::string;
-
-//------------------------------------------------------------------------------
-
-GetDataRefTask* GetDataRefTask::create(uint8_t& result, DataStream& stream)
-{
-    result = Protocol::RESULT_OK;
-
-    string name = stream.readString();
-    uint8_t type = stream.readU8();
-    if (!stream) return 0;
-
-    // Util::debug("hu.varadiistvan.xplra.GetDataRefTask::execute: name='%s', type=0x%02x\n",
-    //             name.c_str(), type);
-
-    if (type==Protocol::TYPE_INT) {
-        return new GetIntDataRefTask(name);
-    } else if (type==Protocol::TYPE_FLOAT) {
-        return new GetFloatDataRefTask(name);
-    } else if (type==Protocol::TYPE_DOUBLE) {
-        return new GetDoubleDataRefTask(name);
-    } else if (type==Protocol::TYPE_FLOAT_ARRAY ||
-               type==Protocol::TYPE_INT_ARRAY ||
-               type==Protocol::TYPE_BYTE_ARRAY)
-    {
-        int length = stream.readS32();
-        int offset = stream.readS32();
-        if (!stream) return 0;
-
-        if (length>Protocol::MAX_LENGTH) {
-            result = Protocol::RESULT_INVALID_LENGTH;
-            return 0;
-        }
-        if (offset<0) {
-            result = Protocol::RESULT_INVALID_OFFSET;
-            return 0;
-        }
-
-        if (type==Protocol::TYPE_FLOAT_ARRAY) {
-            return new GetFloatArrayDataRefTask(name, length, offset);
-        } else if (type==Protocol::TYPE_INT_ARRAY) {
-            return new GetIntArrayDataRefTask(name, length, offset);
-        } else {
-            return new GetByteArrayDataRefTask(name, length, offset);
-        }
-    } else {
-        result = Protocol::RESULT_INVALID_TYPE;
-        return 0;
-    }
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-void GetIntDataRefTask::writeValue(DataStream& stream)
-{
-    stream.writeS32(getValue());
-}
-
-//------------------------------------------------------------------------------
-
-void GetFloatDataRefTask::writeValue(DataStream& stream)
-{
-    stream.writeFloat(getValue());
-}
-
-//------------------------------------------------------------------------------
-
-void GetDoubleDataRefTask::writeValue(DataStream& stream)
-{
-    stream.writeDouble(getValue());
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/GetDataRefTask.h
===================================================================
--- src/plugin/src/xplra/GetDataRefTask.h	(revision 13)
+++ src/plugin/src/xplra/GetDataRefTask.h	(revision 13)
@@ -0,0 +1,723 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_GETDATAREFTASK_H
+#define XPLRA_GETDATAREFTASK_H
+//------------------------------------------------------------------------------
+
+#include "DataRefTask.h"
+
+#include <hu/varadiistvan/scpl/io/DataStream.h>
+
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for tasks that query the value of some dataref.
+ */
+class GetDataRefTask : public DataRefTask
+{
+public:
+    /**
+     * Read a dataref query specification and create the appropriate
+     * GetDataRefTask instance.
+     *
+     * @return the new instance, or 0 on error. In that case the given
+     * result reference variable will be filled with the error code,
+     * unless the stream failed, in which case it remains RESULT_OK.
+     */
+    static GetDataRefTask* create(uint8_t& result,
+                                  hu::varadiistvan::scpl::io::DataStream& stream);
+
+    /**
+     * Construct the task for the dataref with the given name.
+     */
+    GetDataRefTask(const std::string& name);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    GetDataRefTask(XPLMDataRef dataRef);
+
+    /**
+     * Write the value into the given stream.
+     */
+    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream) = 0;
+};
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for dataref querying tasks that query some scalar value.
+ *
+ * ConcreteClass is the actual child class. It should have a function
+ * called queryData, which wraps the corresponding function in XPLM.
+ */
+template <typename T, class ConcreteClass>
+class GetScalarDataRefTask : public GetDataRefTask
+{
+private:
+    /**
+     * The value retrieved.
+     */
+    T value;
+
+public:
+    /**
+     * Construct the task for the dataref with the given name.
+     */
+    GetScalarDataRefTask(const std::string& name);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    GetScalarDataRefTask(XPLMDataRef dataRef);
+
+    /**
+     * Get the value
+     */
+    T getValue() const;
+
+protected:
+    /**
+     * Perform the actual operation.
+     */
+    virtual void process();
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * A dataref task which retrieves the value of an integer.
+ */
+class GetIntDataRefTask :
+        public GetScalarDataRefTask<int, GetIntDataRefTask>
+{
+public:
+    /**
+     * Query the value from XPLM
+     */
+    static int queryData(XPLMDataRef dataRef);
+
+    /**
+     * Construct the task for the dataref with the given name.
+     */
+    GetIntDataRefTask(const std::string& name);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    GetIntDataRefTask(XPLMDataRef dataRef);
+
+    /**
+     * Write the value into the given stream.
+     */
+    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream);
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * A dataref task which retrieves the value of a single-precision
+ * floating point data.
+ */
+class GetFloatDataRefTask :
+        public GetScalarDataRefTask<float, GetFloatDataRefTask>
+{
+public:
+    /**
+     * Query the value from XPLM
+     */
+    static float queryData(XPLMDataRef dataRef);
+
+    /**
+     * Construct the task for the dataref with the given name.
+     */
+    GetFloatDataRefTask(const std::string& name);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    GetFloatDataRefTask(XPLMDataRef dataRef);
+
+    /**
+     * Write the value into the given stream.
+     */
+    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream);
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * A dataref task which retrieves the value of a double-precision
+ * floating point data.
+ */
+class GetDoubleDataRefTask :
+        public GetScalarDataRefTask<double, GetDoubleDataRefTask>
+{
+public:
+    /**
+     * Query the value from XPLM
+     */
+    static double queryData(XPLMDataRef dataRef);
+
+    /**
+     * Construct the task for the dataref with the given name.
+     */
+    GetDoubleDataRefTask(const std::string& name);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    GetDoubleDataRefTask(XPLMDataRef dataRef);
+
+    /**
+     * Write the value into the given stream.
+     */
+    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream);
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for dataref querying tasks that query some array.
+ *
+ * ConcreteClass is the actual child class. It should have a function
+ * called queryData, which wraps the corresponding function in XPLM.
+ */
+template <typename T, class ConcreteClass>
+class GetArrayDataRefTask : public GetDataRefTask
+{
+private:
+    /**
+     * The maximal number of data items returned.
+     */
+    int maxCount;
+
+    /**
+     * The offset within the dataref's value to start the query from.
+     */
+    int offset;
+
+    /**
+     * The data.
+     */
+    T* data;
+
+    /**
+     * The actual length of the data retrieved.
+     */
+    int length;
+
+protected:
+    /**
+     * Construct the task for the dataref with the given name.
+     *
+     * @param maxCount the maximal number of items to retrieve. If <0,
+     * the function will perform an extra query to retrieve the size of
+     * of the dataref's data, which it will store in the task, so
+     * later on it can be reused.
+     */
+    GetArrayDataRefTask(const std::string& name,
+                        int maxCount = -1, int offset = 0);
+
+    /**
+     * Construct the task for the given dataref
+     *
+     * @param maxCount the maximal number of items to retrieve. If <0,
+     * the function will perform an extra query to retrieve the size
+     * of the dataref's data, which it will store in the task, so
+     * later on it can be reused.
+     */
+    GetArrayDataRefTask(XPLMDataRef dataRef,
+                        int maxCount = -1, int offset = 0);
+
+public:
+    /**
+     * Destroy the object.
+     */
+    virtual ~GetArrayDataRefTask();
+
+    /**
+     * Get the data.
+     */
+    const T* getData() const;
+
+    /**
+     * Get the length of the data.
+     */
+    int getLength() const;
+
+protected:
+    /**
+     * Process the dataref by querying its value.
+     */
+    virtual void process();
+
+    /**
+     * Write the value into the given stream.
+     */
+    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream);
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * A dataref task which retrieves the value of a float array.
+ */
+class GetFloatArrayDataRefTask :
+        public GetArrayDataRefTask<float, GetFloatArrayDataRefTask>
+{
+public:
+    /**
+     * Get the data via XPLM
+     */
+    static int queryData(XPLMDataRef dataRef, float* dest,
+                         int offset, int count);
+
+public:
+    /**
+     * Construct the task for the dataref with the given name.
+     *
+     * @param maxCount the maximal number of data items to
+     * retrieve. If <0, the function will perform an extra query to
+     * retrieve the size of the dataref's data, which it will store in
+     * the task, so later on it can be reused.
+     */
+    GetFloatArrayDataRefTask(const std::string& name,
+                            int maxCount = -1, int offset = 0);
+
+    /**
+     * Construct the task for the given dataref
+     *
+     * @param maxBytes the maximal number of data items to
+     * retrieve. If <0, the function will perform an extra query to
+     * retrieve the size of the dataref's data, which it will store in
+     * the task, so later on it can be reused.
+     */
+    GetFloatArrayDataRefTask(XPLMDataRef dataRef,
+                             int maxCount = -1, int offset = 0);
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * A dataref task which retrieves the value of an integer array.
+ */
+class GetIntArrayDataRefTask :
+        public GetArrayDataRefTask<int, GetIntArrayDataRefTask>
+{
+public:
+    /**
+     * Get the data via XPLM
+     */
+    static int queryData(XPLMDataRef dataRef, int* dest,
+                         int offset, int count);
+
+public:
+    /**
+     * Construct the task for the dataref with the given name.
+     *
+     * @param maxCount the maximal number of data items to
+     * retrieve. If <0, the function will perform an extra query to
+     * retrieve the size of the dataref's data, which it will store in
+     * the task, so later on it can be reused.
+     */
+    GetIntArrayDataRefTask(const std::string& name,
+                           int maxCount = -1, int offset = 0);
+
+    /**
+     * Construct the task for the given dataref
+     *
+     * @param maxBytes the maximal number of data items to
+     * retrieve. If <0, the function will perform an extra query to
+     * retrieve the size of the dataref's data, which it will store in
+     * the task, so later on it can be reused.
+     */
+    GetIntArrayDataRefTask(XPLMDataRef dataRef,
+                           int maxCount = -1, int offset = 0);
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * A dataref task which retrieves the value of a byte array.
+ */
+class GetByteArrayDataRefTask :
+        public GetArrayDataRefTask<unsigned char, GetByteArrayDataRefTask>
+{
+public:
+    /**
+     * Get the data via XPLM
+     */
+    static int queryData(XPLMDataRef dataRef, void* dest,
+                         int offset, int count);
+
+public:
+    /**
+     * Construct the task for the dataref with the given name.
+     *
+     * @param maxBytes the maximal number of bytes to retrieve. If <0,
+     * the function will perform an extra query to retrieve the size
+     * of the dataref's data, which it will store in the task, so
+     * later on it can be reused.
+     */
+    GetByteArrayDataRefTask(const std::string& name,
+                            int maxBytes = -1, int offset = 0);
+
+    /**
+     * Construct the task for the given dataref
+     *
+     * @param maxBytes the maximal number of bytes to retrieve. If <0,
+     * the function will perform an extra query to retrieve the size
+     * of the dataref's data, which it will store in the task, so
+     * later on it can be reused.
+     */
+    GetByteArrayDataRefTask(XPLMDataRef dataRef,
+                            int maxBytes = -1, int offset = 0);
+};
+
+//------------------------------------------------------------------------------
+// Template definitions
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline GetScalarDataRefTask<T, ConcreteClass>::
+GetScalarDataRefTask(const std::string& name) :
+    GetDataRefTask(name),
+    value(0)
+{
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline GetScalarDataRefTask<T, ConcreteClass>::
+GetScalarDataRefTask(XPLMDataRef dataRef) :
+    GetDataRefTask(dataRef),
+    value(0)
+{
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline T GetScalarDataRefTask<T, ConcreteClass>::getValue() const
+{
+    return value;
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+void GetScalarDataRefTask<T, ConcreteClass>::process()
+{
+    value = ConcreteClass::queryData(getDataRef());
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline GetArrayDataRefTask<T, ConcreteClass>::
+GetArrayDataRefTask(const std::string& name, int maxCount, int offset) :
+    GetDataRefTask(name),
+    maxCount(maxCount),
+    offset(offset),
+    data( (maxCount>0) ? new T[maxCount] : 0 ),
+    length(-1)
+{
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline GetArrayDataRefTask<T, ConcreteClass>::
+GetArrayDataRefTask(XPLMDataRef dataRef, int maxCount, int offset) :
+    GetDataRefTask(dataRef),
+    maxCount(maxCount),
+    offset(offset),
+    data( (maxCount>0) ? new T[maxCount] : 0),
+    length(-1)
+{
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline GetArrayDataRefTask<T, ConcreteClass>::~GetArrayDataRefTask()
+{
+    delete [] data;
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline const T* GetArrayDataRefTask<T, ConcreteClass>::getData() const
+{
+    return data;
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline int GetArrayDataRefTask<T, ConcreteClass>::getLength() const
+{
+    return length;
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+void GetArrayDataRefTask<T, ConcreteClass>::process()
+{
+    if (maxCount<0) {
+        maxCount = ConcreteClass::queryData(getDataRef(), 0, 0, 0);
+
+        if (maxCount>0) {
+            maxCount -= offset;
+        }
+
+        if (maxCount>0) {
+            data = new T[maxCount];
+        } else {
+            maxCount = 0;
+        }
+    }
+
+    // Util::debug("GetByteArrayDataRefTask::process: dataRef=%p, maxBytes=%d, data=%p, offset\n",
+    //             getDataRef(), maxBytes, data, offset);
+    if (maxCount>0) {
+        length = ConcreteClass::queryData(getDataRef(), data, offset, maxCount);
+    } else {
+        length = maxCount;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+void GetArrayDataRefTask<T, ConcreteClass>::
+writeValue(hu::varadiistvan::scpl::io::DataStream& stream)
+{
+    stream.writeS32(length);
+    if (length>0) {
+        stream.write(data, length * sizeof(T));
+    }
+}
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline GetDataRefTask::GetDataRefTask(const std::string& name) :
+    DataRefTask(name)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline GetDataRefTask::GetDataRefTask(XPLMDataRef dataRef) :
+    DataRefTask(dataRef)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline int GetIntDataRefTask::queryData(XPLMDataRef dataRef)
+{
+    return XPLMGetDatai(dataRef);
+}
+
+//------------------------------------------------------------------------------
+
+inline GetIntDataRefTask::GetIntDataRefTask(const std::string& name) :
+    GetScalarDataRefTask<int, GetIntDataRefTask>(name)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline GetIntDataRefTask::GetIntDataRefTask(XPLMDataRef dataRef) :
+    GetScalarDataRefTask<int, GetIntDataRefTask>(dataRef)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline float GetFloatDataRefTask::queryData(XPLMDataRef dataRef)
+{
+    return XPLMGetDataf(dataRef);
+}
+
+//------------------------------------------------------------------------------
+
+inline GetFloatDataRefTask::GetFloatDataRefTask(const std::string& name) :
+    GetScalarDataRefTask<float, GetFloatDataRefTask>(name)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline GetFloatDataRefTask::GetFloatDataRefTask(XPLMDataRef dataRef) :
+    GetScalarDataRefTask<float, GetFloatDataRefTask>(dataRef)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline double GetDoubleDataRefTask::queryData(XPLMDataRef dataRef)
+{
+    return XPLMGetDatad(dataRef);
+}
+
+//------------------------------------------------------------------------------
+
+inline GetDoubleDataRefTask::GetDoubleDataRefTask(const std::string& name) :
+    GetScalarDataRefTask<double, GetDoubleDataRefTask>(name)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline GetDoubleDataRefTask::GetDoubleDataRefTask(XPLMDataRef dataRef) :
+    GetScalarDataRefTask<double, GetDoubleDataRefTask>(dataRef)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline int GetFloatArrayDataRefTask::queryData(XPLMDataRef dataRef, float* dest,
+                                               int offset, int count)
+{
+    return XPLMGetDatavf(dataRef, dest, offset, count);
+}
+
+//------------------------------------------------------------------------------
+
+inline
+GetFloatArrayDataRefTask::GetFloatArrayDataRefTask(const std::string& name,
+                                                   int maxCount, int offset) :
+    GetArrayDataRefTask<float, GetFloatArrayDataRefTask>(name, maxCount, offset)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline
+GetFloatArrayDataRefTask::GetFloatArrayDataRefTask(XPLMDataRef dataRef,
+                                                 int maxCount, int offset) :
+    GetArrayDataRefTask<float, GetFloatArrayDataRefTask>(dataRef,
+                                                         maxCount, offset)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline int GetIntArrayDataRefTask::queryData(XPLMDataRef dataRef, int* dest,
+                                             int offset, int count)
+{
+    return XPLMGetDatavi(dataRef, dest, offset, count);
+}
+
+//------------------------------------------------------------------------------
+
+inline
+GetIntArrayDataRefTask::GetIntArrayDataRefTask(const std::string& name,
+                                                   int maxCount, int offset) :
+    GetArrayDataRefTask<int, GetIntArrayDataRefTask>(name, maxCount, offset)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline
+GetIntArrayDataRefTask::GetIntArrayDataRefTask(XPLMDataRef dataRef,
+                                               int maxCount, int offset) :
+    GetArrayDataRefTask<int, GetIntArrayDataRefTask>(dataRef,
+                                                     maxCount, offset)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline int GetByteArrayDataRefTask::queryData(XPLMDataRef dataRef, void* dest,
+                                              int offset, int count)
+{
+    return XPLMGetDatab(dataRef, dest, offset, count);
+}
+
+//------------------------------------------------------------------------------
+
+inline
+GetByteArrayDataRefTask::GetByteArrayDataRefTask(const std::string& name,
+                                                 int maxBytes, int offset) :
+    GetArrayDataRefTask<unsigned char, GetByteArrayDataRefTask>(name, maxBytes,
+                                                                offset)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline
+GetByteArrayDataRefTask::GetByteArrayDataRefTask(XPLMDataRef dataRef,
+                                                 int maxBytes, int offset) :
+    GetArrayDataRefTask<unsigned char, GetByteArrayDataRefTask>(dataRef,
+                                                                maxBytes,
+                                                                offset)
+{
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_GETDATAREFTASK_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/GetDataRefTask.h
===================================================================
--- src/plugin/src/xplra/GetDataRefTask.h	(revision 13)
+++ 	(revision )
@@ -1,723 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_GETDATAREFTASK_H
-#define XPLRA_GETDATAREFTASK_H
-//------------------------------------------------------------------------------
-
-#include "DataRefTask.h"
-
-#include <hu/varadiistvan/scpl/io/DataStream.h>
-
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class for tasks that query the value of some dataref.
- */
-class GetDataRefTask : public DataRefTask
-{
-public:
-    /**
-     * Read a dataref query specification and create the appropriate
-     * GetDataRefTask instance.
-     *
-     * @return the new instance, or 0 on error. In that case the given
-     * result reference variable will be filled with the error code,
-     * unless the stream failed, in which case it remains RESULT_OK.
-     */
-    static GetDataRefTask* create(uint8_t& result,
-                                  hu::varadiistvan::scpl::io::DataStream& stream);
-
-    /**
-     * Construct the task for the dataref with the given name.
-     */
-    GetDataRefTask(const std::string& name);
-
-    /**
-     * Construct the task for the given dataref.
-     */
-    GetDataRefTask(XPLMDataRef dataRef);
-
-    /**
-     * Write the value into the given stream.
-     */
-    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream) = 0;
-};
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class for dataref querying tasks that query some scalar value.
- *
- * ConcreteClass is the actual child class. It should have a function
- * called queryData, which wraps the corresponding function in XPLM.
- */
-template <typename T, class ConcreteClass>
-class GetScalarDataRefTask : public GetDataRefTask
-{
-private:
-    /**
-     * The value retrieved.
-     */
-    T value;
-
-public:
-    /**
-     * Construct the task for the dataref with the given name.
-     */
-    GetScalarDataRefTask(const std::string& name);
-
-    /**
-     * Construct the task for the given dataref.
-     */
-    GetScalarDataRefTask(XPLMDataRef dataRef);
-
-    /**
-     * Get the value
-     */
-    T getValue() const;
-
-protected:
-    /**
-     * Perform the actual operation.
-     */
-    virtual void process();
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * A dataref task which retrieves the value of an integer.
- */
-class GetIntDataRefTask :
-        public GetScalarDataRefTask<int, GetIntDataRefTask>
-{
-public:
-    /**
-     * Query the value from XPLM
-     */
-    static int queryData(XPLMDataRef dataRef);
-
-    /**
-     * Construct the task for the dataref with the given name.
-     */
-    GetIntDataRefTask(const std::string& name);
-
-    /**
-     * Construct the task for the given dataref.
-     */
-    GetIntDataRefTask(XPLMDataRef dataRef);
-
-    /**
-     * Write the value into the given stream.
-     */
-    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream);
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * A dataref task which retrieves the value of a single-precision
- * floating point data.
- */
-class GetFloatDataRefTask :
-        public GetScalarDataRefTask<float, GetFloatDataRefTask>
-{
-public:
-    /**
-     * Query the value from XPLM
-     */
-    static float queryData(XPLMDataRef dataRef);
-
-    /**
-     * Construct the task for the dataref with the given name.
-     */
-    GetFloatDataRefTask(const std::string& name);
-
-    /**
-     * Construct the task for the given dataref.
-     */
-    GetFloatDataRefTask(XPLMDataRef dataRef);
-
-    /**
-     * Write the value into the given stream.
-     */
-    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream);
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * A dataref task which retrieves the value of a double-precision
- * floating point data.
- */
-class GetDoubleDataRefTask :
-        public GetScalarDataRefTask<double, GetDoubleDataRefTask>
-{
-public:
-    /**
-     * Query the value from XPLM
-     */
-    static double queryData(XPLMDataRef dataRef);
-
-    /**
-     * Construct the task for the dataref with the given name.
-     */
-    GetDoubleDataRefTask(const std::string& name);
-
-    /**
-     * Construct the task for the given dataref.
-     */
-    GetDoubleDataRefTask(XPLMDataRef dataRef);
-
-    /**
-     * Write the value into the given stream.
-     */
-    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream);
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * Base class for dataref querying tasks that query some array.
- *
- * ConcreteClass is the actual child class. It should have a function
- * called queryData, which wraps the corresponding function in XPLM.
- */
-template <typename T, class ConcreteClass>
-class GetArrayDataRefTask : public GetDataRefTask
-{
-private:
-    /**
-     * The maximal number of data items returned.
-     */
-    int maxCount;
-
-    /**
-     * The offset within the dataref's value to start the query from.
-     */
-    int offset;
-
-    /**
-     * The data.
-     */
-    T* data;
-
-    /**
-     * The actual length of the data retrieved.
-     */
-    int length;
-
-protected:
-    /**
-     * Construct the task for the dataref with the given name.
-     *
-     * @param maxCount the maximal number of items to retrieve. If <0,
-     * the function will perform an extra query to retrieve the size of
-     * of the dataref's data, which it will store in the task, so
-     * later on it can be reused.
-     */
-    GetArrayDataRefTask(const std::string& name,
-                        int maxCount = -1, int offset = 0);
-
-    /**
-     * Construct the task for the given dataref
-     *
-     * @param maxCount the maximal number of items to retrieve. If <0,
-     * the function will perform an extra query to retrieve the size
-     * of the dataref's data, which it will store in the task, so
-     * later on it can be reused.
-     */
-    GetArrayDataRefTask(XPLMDataRef dataRef,
-                        int maxCount = -1, int offset = 0);
-
-public:
-    /**
-     * Destroy the object.
-     */
-    virtual ~GetArrayDataRefTask();
-
-    /**
-     * Get the data.
-     */
-    const T* getData() const;
-
-    /**
-     * Get the length of the data.
-     */
-    int getLength() const;
-
-protected:
-    /**
-     * Process the dataref by querying its value.
-     */
-    virtual void process();
-
-    /**
-     * Write the value into the given stream.
-     */
-    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream);
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * A dataref task which retrieves the value of a float array.
- */
-class GetFloatArrayDataRefTask :
-        public GetArrayDataRefTask<float, GetFloatArrayDataRefTask>
-{
-public:
-    /**
-     * Get the data via XPLM
-     */
-    static int queryData(XPLMDataRef dataRef, float* dest,
-                         int offset, int count);
-
-public:
-    /**
-     * Construct the task for the dataref with the given name.
-     *
-     * @param maxCount the maximal number of data items to
-     * retrieve. If <0, the function will perform an extra query to
-     * retrieve the size of the dataref's data, which it will store in
-     * the task, so later on it can be reused.
-     */
-    GetFloatArrayDataRefTask(const std::string& name,
-                            int maxCount = -1, int offset = 0);
-
-    /**
-     * Construct the task for the given dataref
-     *
-     * @param maxBytes the maximal number of data items to
-     * retrieve. If <0, the function will perform an extra query to
-     * retrieve the size of the dataref's data, which it will store in
-     * the task, so later on it can be reused.
-     */
-    GetFloatArrayDataRefTask(XPLMDataRef dataRef,
-                             int maxCount = -1, int offset = 0);
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * A dataref task which retrieves the value of an integer array.
- */
-class GetIntArrayDataRefTask :
-        public GetArrayDataRefTask<int, GetIntArrayDataRefTask>
-{
-public:
-    /**
-     * Get the data via XPLM
-     */
-    static int queryData(XPLMDataRef dataRef, int* dest,
-                         int offset, int count);
-
-public:
-    /**
-     * Construct the task for the dataref with the given name.
-     *
-     * @param maxCount the maximal number of data items to
-     * retrieve. If <0, the function will perform an extra query to
-     * retrieve the size of the dataref's data, which it will store in
-     * the task, so later on it can be reused.
-     */
-    GetIntArrayDataRefTask(const std::string& name,
-                           int maxCount = -1, int offset = 0);
-
-    /**
-     * Construct the task for the given dataref
-     *
-     * @param maxBytes the maximal number of data items to
-     * retrieve. If <0, the function will perform an extra query to
-     * retrieve the size of the dataref's data, which it will store in
-     * the task, so later on it can be reused.
-     */
-    GetIntArrayDataRefTask(XPLMDataRef dataRef,
-                           int maxCount = -1, int offset = 0);
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * A dataref task which retrieves the value of a byte array.
- */
-class GetByteArrayDataRefTask :
-        public GetArrayDataRefTask<unsigned char, GetByteArrayDataRefTask>
-{
-public:
-    /**
-     * Get the data via XPLM
-     */
-    static int queryData(XPLMDataRef dataRef, void* dest,
-                         int offset, int count);
-
-public:
-    /**
-     * Construct the task for the dataref with the given name.
-     *
-     * @param maxBytes the maximal number of bytes to retrieve. If <0,
-     * the function will perform an extra query to retrieve the size
-     * of the dataref's data, which it will store in the task, so
-     * later on it can be reused.
-     */
-    GetByteArrayDataRefTask(const std::string& name,
-                            int maxBytes = -1, int offset = 0);
-
-    /**
-     * Construct the task for the given dataref
-     *
-     * @param maxBytes the maximal number of bytes to retrieve. If <0,
-     * the function will perform an extra query to retrieve the size
-     * of the dataref's data, which it will store in the task, so
-     * later on it can be reused.
-     */
-    GetByteArrayDataRefTask(XPLMDataRef dataRef,
-                            int maxBytes = -1, int offset = 0);
-};
-
-//------------------------------------------------------------------------------
-// Template definitions
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline GetScalarDataRefTask<T, ConcreteClass>::
-GetScalarDataRefTask(const std::string& name) :
-    GetDataRefTask(name),
-    value(0)
-{
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline GetScalarDataRefTask<T, ConcreteClass>::
-GetScalarDataRefTask(XPLMDataRef dataRef) :
-    GetDataRefTask(dataRef),
-    value(0)
-{
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline T GetScalarDataRefTask<T, ConcreteClass>::getValue() const
-{
-    return value;
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-void GetScalarDataRefTask<T, ConcreteClass>::process()
-{
-    value = ConcreteClass::queryData(getDataRef());
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline GetArrayDataRefTask<T, ConcreteClass>::
-GetArrayDataRefTask(const std::string& name, int maxCount, int offset) :
-    GetDataRefTask(name),
-    maxCount(maxCount),
-    offset(offset),
-    data( (maxCount>0) ? new T[maxCount] : 0 ),
-    length(-1)
-{
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline GetArrayDataRefTask<T, ConcreteClass>::
-GetArrayDataRefTask(XPLMDataRef dataRef, int maxCount, int offset) :
-    GetDataRefTask(dataRef),
-    maxCount(maxCount),
-    offset(offset),
-    data( (maxCount>0) ? new T[maxCount] : 0),
-    length(-1)
-{
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline GetArrayDataRefTask<T, ConcreteClass>::~GetArrayDataRefTask()
-{
-    delete [] data;
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline const T* GetArrayDataRefTask<T, ConcreteClass>::getData() const
-{
-    return data;
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline int GetArrayDataRefTask<T, ConcreteClass>::getLength() const
-{
-    return length;
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-void GetArrayDataRefTask<T, ConcreteClass>::process()
-{
-    if (maxCount<0) {
-        maxCount = ConcreteClass::queryData(getDataRef(), 0, 0, 0);
-
-        if (maxCount>0) {
-            maxCount -= offset;
-        }
-
-        if (maxCount>0) {
-            data = new T[maxCount];
-        } else {
-            maxCount = 0;
-        }
-    }
-
-    // Util::debug("GetByteArrayDataRefTask::process: dataRef=%p, maxBytes=%d, data=%p, offset\n",
-    //             getDataRef(), maxBytes, data, offset);
-    if (maxCount>0) {
-        length = ConcreteClass::queryData(getDataRef(), data, offset, maxCount);
-    } else {
-        length = maxCount;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-void GetArrayDataRefTask<T, ConcreteClass>::
-writeValue(hu::varadiistvan::scpl::io::DataStream& stream)
-{
-    stream.writeS32(length);
-    if (length>0) {
-        stream.write(data, length * sizeof(T));
-    }
-}
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline GetDataRefTask::GetDataRefTask(const std::string& name) :
-    DataRefTask(name)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline GetDataRefTask::GetDataRefTask(XPLMDataRef dataRef) :
-    DataRefTask(dataRef)
-{
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-inline int GetIntDataRefTask::queryData(XPLMDataRef dataRef)
-{
-    return XPLMGetDatai(dataRef);
-}
-
-//------------------------------------------------------------------------------
-
-inline GetIntDataRefTask::GetIntDataRefTask(const std::string& name) :
-    GetScalarDataRefTask<int, GetIntDataRefTask>(name)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline GetIntDataRefTask::GetIntDataRefTask(XPLMDataRef dataRef) :
-    GetScalarDataRefTask<int, GetIntDataRefTask>(dataRef)
-{
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-inline float GetFloatDataRefTask::queryData(XPLMDataRef dataRef)
-{
-    return XPLMGetDataf(dataRef);
-}
-
-//------------------------------------------------------------------------------
-
-inline GetFloatDataRefTask::GetFloatDataRefTask(const std::string& name) :
-    GetScalarDataRefTask<float, GetFloatDataRefTask>(name)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline GetFloatDataRefTask::GetFloatDataRefTask(XPLMDataRef dataRef) :
-    GetScalarDataRefTask<float, GetFloatDataRefTask>(dataRef)
-{
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-inline double GetDoubleDataRefTask::queryData(XPLMDataRef dataRef)
-{
-    return XPLMGetDatad(dataRef);
-}
-
-//------------------------------------------------------------------------------
-
-inline GetDoubleDataRefTask::GetDoubleDataRefTask(const std::string& name) :
-    GetScalarDataRefTask<double, GetDoubleDataRefTask>(name)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline GetDoubleDataRefTask::GetDoubleDataRefTask(XPLMDataRef dataRef) :
-    GetScalarDataRefTask<double, GetDoubleDataRefTask>(dataRef)
-{
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-inline int GetFloatArrayDataRefTask::queryData(XPLMDataRef dataRef, float* dest,
-                                               int offset, int count)
-{
-    return XPLMGetDatavf(dataRef, dest, offset, count);
-}
-
-//------------------------------------------------------------------------------
-
-inline
-GetFloatArrayDataRefTask::GetFloatArrayDataRefTask(const std::string& name,
-                                                   int maxCount, int offset) :
-    GetArrayDataRefTask<float, GetFloatArrayDataRefTask>(name, maxCount, offset)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline
-GetFloatArrayDataRefTask::GetFloatArrayDataRefTask(XPLMDataRef dataRef,
-                                                 int maxCount, int offset) :
-    GetArrayDataRefTask<float, GetFloatArrayDataRefTask>(dataRef,
-                                                         maxCount, offset)
-{
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-inline int GetIntArrayDataRefTask::queryData(XPLMDataRef dataRef, int* dest,
-                                             int offset, int count)
-{
-    return XPLMGetDatavi(dataRef, dest, offset, count);
-}
-
-//------------------------------------------------------------------------------
-
-inline
-GetIntArrayDataRefTask::GetIntArrayDataRefTask(const std::string& name,
-                                                   int maxCount, int offset) :
-    GetArrayDataRefTask<int, GetIntArrayDataRefTask>(name, maxCount, offset)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline
-GetIntArrayDataRefTask::GetIntArrayDataRefTask(XPLMDataRef dataRef,
-                                               int maxCount, int offset) :
-    GetArrayDataRefTask<int, GetIntArrayDataRefTask>(dataRef,
-                                                     maxCount, offset)
-{
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-inline int GetByteArrayDataRefTask::queryData(XPLMDataRef dataRef, void* dest,
-                                              int offset, int count)
-{
-    return XPLMGetDatab(dataRef, dest, offset, count);
-}
-
-//------------------------------------------------------------------------------
-
-inline
-GetByteArrayDataRefTask::GetByteArrayDataRefTask(const std::string& name,
-                                                 int maxBytes, int offset) :
-    GetArrayDataRefTask<unsigned char, GetByteArrayDataRefTask>(name, maxBytes,
-                                                                offset)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline
-GetByteArrayDataRefTask::GetByteArrayDataRefTask(XPLMDataRef dataRef,
-                                                 int maxBytes, int offset) :
-    GetArrayDataRefTask<unsigned char, GetByteArrayDataRefTask>(dataRef,
-                                                                maxBytes,
-                                                                offset)
-{
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_GETDATAREFTASK_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/GetMultiDataRefRequest.cc
===================================================================
--- src/plugin/src/xplra/GetMultiDataRefRequest.cc	(revision 13)
+++ src/plugin/src/xplra/GetMultiDataRefRequest.cc	(revision 13)
@@ -0,0 +1,96 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "GetMultiDataRefRequest.h"
+
+#include "Protocol.h"
+
+#include <hu/varadiistvan/xplcommon/Util.h>
+
+//------------------------------------------------------------------------------
+
+using xplra::GetMultiDataRefRequest;
+
+using hu::varadiistvan::scpl::io::DataStream;
+using hu::varadiistvan::xplcommon::Util;
+
+//------------------------------------------------------------------------------
+
+GetMultiDataRefRequest::GetMultiDataRefRequest(uint8_t& result,
+                                               DataStream& stream)
+{
+    result = Protocol::RESULT_OK;
+
+    uint32_t numTasks = stream.readU32();
+    if (!stream) return;
+    if (numTasks==0 || numTasks>Protocol::MAX_MULTI_COUNT) {
+        result = Protocol::RESULT_INVALID_COUNT;
+        return;
+    }
+
+    for(size_t i = 0;
+        i<numTasks && result==Protocol::RESULT_OK && stream; ++i)
+    {
+        GetDataRefTask* task = GetDataRefTask::create(result, stream);
+        if (task!=0) addTask(task);
+    }
+}
+
+//------------------------------------------------------------------------------
+
+void GetMultiDataRefRequest::writeResult(DataStream& stream) const
+{
+    // Util::debug("hu.varadiistvan.xplra.GetMultiDataRefRequest[%p]::writeResult\n", this);
+    size_t numTasks = getNumTasks();
+    for(size_t i = 0; i<numTasks; ++i) {
+        GetDataRefTask* task = getTask(i);
+        // Util::debug("hu.varadiistvan.xplra.GetMultiDataRefRequest[%p]::writeResult: task[%zu]: %d @ %p\n",
+        //             this, i, task->isValid(), task);
+        if (!task->isValid()) {
+            stream.writeU8(Protocol::RESULT_UNKNOWN_DATAREF);
+            stream.writeU32(i);
+            return;
+        }
+    }
+
+    stream.writeU8(Protocol::RESULT_OK);
+    for(size_t i = 0; i<numTasks; ++i) {
+        GetDataRefTask* task = getTask(i);
+        task->writeValue(stream);
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/GetMultiDataRefRequest.cc
===================================================================
--- src/plugin/src/xplra/GetMultiDataRefRequest.cc	(revision 13)
+++ 	(revision )
@@ -1,96 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "GetMultiDataRefRequest.h"
-
-#include "Protocol.h"
-
-#include <hu/varadiistvan/xplcommon/Util.h>
-
-//------------------------------------------------------------------------------
-
-using xplra::GetMultiDataRefRequest;
-
-using hu::varadiistvan::scpl::io::DataStream;
-using hu::varadiistvan::xplcommon::Util;
-
-//------------------------------------------------------------------------------
-
-GetMultiDataRefRequest::GetMultiDataRefRequest(uint8_t& result,
-                                               DataStream& stream)
-{
-    result = Protocol::RESULT_OK;
-
-    uint32_t numTasks = stream.readU32();
-    if (!stream) return;
-    if (numTasks==0 || numTasks>Protocol::MAX_MULTI_COUNT) {
-        result = Protocol::RESULT_INVALID_COUNT;
-        return;
-    }
-
-    for(size_t i = 0;
-        i<numTasks && result==Protocol::RESULT_OK && stream; ++i)
-    {
-        GetDataRefTask* task = GetDataRefTask::create(result, stream);
-        if (task!=0) addTask(task);
-    }
-}
-
-//------------------------------------------------------------------------------
-
-void GetMultiDataRefRequest::writeResult(DataStream& stream) const
-{
-    // Util::debug("hu.varadiistvan.xplra.GetMultiDataRefRequest[%p]::writeResult\n", this);
-    size_t numTasks = getNumTasks();
-    for(size_t i = 0; i<numTasks; ++i) {
-        GetDataRefTask* task = getTask(i);
-        // Util::debug("hu.varadiistvan.xplra.GetMultiDataRefRequest[%p]::writeResult: task[%zu]: %d @ %p\n",
-        //             this, i, task->isValid(), task);
-        if (!task->isValid()) {
-            stream.writeU8(Protocol::RESULT_UNKNOWN_DATAREF);
-            stream.writeU32(i);
-            return;
-        }
-    }
-
-    stream.writeU8(Protocol::RESULT_OK);
-    for(size_t i = 0; i<numTasks; ++i) {
-        GetDataRefTask* task = getTask(i);
-        task->writeValue(stream);
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/GetMultiDataRefRequest.h
===================================================================
--- src/plugin/src/xplra/GetMultiDataRefRequest.h	(revision 13)
+++ src/plugin/src/xplra/GetMultiDataRefRequest.h	(revision 13)
@@ -0,0 +1,78 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_GETMULTIDATAREFREQUEST_H
+#define XPLRA_GETMULTIDATAREFREQUEST_H
+//------------------------------------------------------------------------------
+
+#include "MultiTaskRequest.h"
+#include "GetDataRefTask.h"
+
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A request containing several dataref query tasks.
+ */
+class GetMultiDataRefRequest : public MultiTaskRequestTemplate<GetDataRefTask>
+{
+public:
+    /**
+     * Construct the request by reading the given number of task
+     * specifications from the given stream.
+     */
+    GetMultiDataRefRequest(uint8_t& result, hu::varadiistvan::scpl::io::DataStream& stream);
+
+    /**
+     * Write the result of an execution.
+     *
+     * If there is at least one invalid dataref, the result will be
+     * RESULT_UNKNOWN_DATAREF followed by a 32-bit unsigned value with
+     * the index of the first unknown dataref.
+     *
+     * Otherwise the result is RESULT_OK, followed by the values of
+     * the datarefs queried.
+     */
+    void writeResult(hu::varadiistvan::scpl::io::DataStream& stream) const;
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_GETMULTIDATAREFREQUEST_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/GetMultiDataRefRequest.h
===================================================================
--- src/plugin/src/xplra/GetMultiDataRefRequest.h	(revision 13)
+++ 	(revision )
@@ -1,78 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_GETMULTIDATAREFREQUEST_H
-#define XPLRA_GETMULTIDATAREFREQUEST_H
-//------------------------------------------------------------------------------
-
-#include "MultiTaskRequest.h"
-#include "GetDataRefTask.h"
-
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-/**
- * A request containing several dataref query tasks.
- */
-class GetMultiDataRefRequest : public MultiTaskRequestTemplate<GetDataRefTask>
-{
-public:
-    /**
-     * Construct the request by reading the given number of task
-     * specifications from the given stream.
-     */
-    GetMultiDataRefRequest(uint8_t& result, hu::varadiistvan::scpl::io::DataStream& stream);
-
-    /**
-     * Write the result of an execution.
-     *
-     * If there is at least one invalid dataref, the result will be
-     * RESULT_UNKNOWN_DATAREF followed by a 32-bit unsigned value with
-     * the index of the first unknown dataref.
-     *
-     * Otherwise the result is RESULT_OK, followed by the values of
-     * the datarefs queried.
-     */
-    void writeResult(hu::varadiistvan::scpl::io::DataStream& stream) const;
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_GETMULTIDATAREFREQUEST_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/ListenThread.cc
===================================================================
--- src/plugin/src/xplra/ListenThread.cc	(revision 13)
+++ src/plugin/src/xplra/ListenThread.cc	(revision 13)
@@ -0,0 +1,75 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "ListenThread.h"
+
+#include "ServerThread.h"
+
+#include <hu/varadiistvan/scpl/io/LocalServerSocket.h>
+#include <hu/varadiistvan/scpl/io/LocalAcceptor.h>
+#include <hu/varadiistvan/xplcommon/Util.h>
+
+//------------------------------------------------------------------------------
+
+using xplra::ListenThread;
+
+using hu::varadiistvan::scpl::io::LocalServerSocket;
+using hu::varadiistvan::scpl::io::LocalAcceptor;
+using hu::varadiistvan::xplcommon::Util;
+
+//------------------------------------------------------------------------------
+
+void ListenThread::run()
+{
+    Util::debug("xplra::ListenThread::run: started\n");
+
+    LocalServerSocket socket("xplra", &waiter);
+    LocalAcceptor& acceptor = socket.getAcceptor();
+    while(!quitEvent.check() && !quitEvent.failed() && !acceptor.failed()) {
+        if (acceptor.accept()) {
+            ServerThread* serverThread = new ServerThread(requestQueue,
+                                                          acceptor);
+            serverThread->start();
+        }
+        waiter.wait();
+    }
+
+    ServerThread::quitAll();
+
+    Util::debug("xplra::ListenThread::run: quitting\n");
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/ListenThread.cc
===================================================================
--- src/plugin/src/xplra/ListenThread.cc	(revision 13)
+++ 	(revision )
@@ -1,75 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "ListenThread.h"
-
-#include "ServerThread.h"
-
-#include <hu/varadiistvan/scpl/io/LocalServerSocket.h>
-#include <hu/varadiistvan/scpl/io/LocalAcceptor.h>
-#include <hu/varadiistvan/xplcommon/Util.h>
-
-//------------------------------------------------------------------------------
-
-using xplra::ListenThread;
-
-using hu::varadiistvan::scpl::io::LocalServerSocket;
-using hu::varadiistvan::scpl::io::LocalAcceptor;
-using hu::varadiistvan::xplcommon::Util;
-
-//------------------------------------------------------------------------------
-
-void ListenThread::run()
-{
-    Util::debug("xplra::ListenThread::run: started\n");
-
-    LocalServerSocket socket("xplra", &waiter);
-    LocalAcceptor& acceptor = socket.getAcceptor();
-    while(!quitEvent.check() && !quitEvent.failed() && !acceptor.failed()) {
-        if (acceptor.accept()) {
-            ServerThread* serverThread = new ServerThread(requestQueue,
-                                                          acceptor);
-            serverThread->start();
-        }
-        waiter.wait();
-    }
-
-    ServerThread::quitAll();
-
-    Util::debug("xplra::ListenThread::run: quitting\n");
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/ListenThread.h
===================================================================
--- src/plugin/src/xplra/ListenThread.h	(revision 13)
+++ src/plugin/src/xplra/ListenThread.h	(revision 13)
@@ -0,0 +1,117 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_LISTENTHREAD_H
+#define XPLRA_LISTENTHREAD_H
+//------------------------------------------------------------------------------
+
+#include <hu/varadiistvan/scpl/Thread.h>
+
+#include "RequestQueue.h"
+
+#include <hu/varadiistvan/scpl/io/Waiter.h>
+#include <hu/varadiistvan/scpl/io/WaitableEvent.h>
+
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+/**
+ * The thread that listens to incoming connections and starts the
+ * client serving threads.
+ *
+ * This is a detached thread, to allow it to quit automatically.
+ */
+class ListenThread : public hu::varadiistvan::scpl::Thread
+{
+private:
+    /**
+     * The waiter used in the thread.
+     */
+    hu::varadiistvan::scpl::io::Waiter waiter;
+
+    /**
+     * The event that can be fired to notify the thread that it should
+     * quit.
+     */
+    hu::varadiistvan::scpl::io::WaitableEvent quitEvent;
+
+    /**
+     * The queue for the requests.
+     */
+    RequestQueue requestQueue;
+
+public:
+    /**
+     * Construct the thread.
+     */
+    ListenThread();
+
+    /**
+     * Notify the thread to quit.
+     */
+    void quit();
+
+    /**
+     * Perform the thread's operation.
+     */
+    virtual void run();
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline ListenThread::ListenThread() :
+    Thread(true),
+    quitEvent(&waiter)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline void ListenThread::quit()
+{
+    requestQueue.disable();
+    quitEvent.fire();
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_LISTENTHREAD_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/ListenThread.h
===================================================================
--- src/plugin/src/xplra/ListenThread.h	(revision 13)
+++ 	(revision )
@@ -1,117 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_LISTENTHREAD_H
-#define XPLRA_LISTENTHREAD_H
-//------------------------------------------------------------------------------
-
-#include <hu/varadiistvan/scpl/Thread.h>
-
-#include "RequestQueue.h"
-
-#include <hu/varadiistvan/scpl/io/Waiter.h>
-#include <hu/varadiistvan/scpl/io/WaitableEvent.h>
-
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-/**
- * The thread that listens to incoming connections and starts the
- * client serving threads.
- *
- * This is a detached thread, to allow it to quit automatically.
- */
-class ListenThread : public hu::varadiistvan::scpl::Thread
-{
-private:
-    /**
-     * The waiter used in the thread.
-     */
-    hu::varadiistvan::scpl::io::Waiter waiter;
-
-    /**
-     * The event that can be fired to notify the thread that it should
-     * quit.
-     */
-    hu::varadiistvan::scpl::io::WaitableEvent quitEvent;
-
-    /**
-     * The queue for the requests.
-     */
-    RequestQueue requestQueue;
-
-public:
-    /**
-     * Construct the thread.
-     */
-    ListenThread();
-
-    /**
-     * Notify the thread to quit.
-     */
-    void quit();
-
-    /**
-     * Perform the thread's operation.
-     */
-    virtual void run();
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline ListenThread::ListenThread() :
-    Thread(true),
-    quitEvent(&waiter)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline void ListenThread::quit()
-{
-    requestQueue.disable();
-    quitEvent.fire();
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_LISTENTHREAD_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/Makefile.am
===================================================================
--- src/plugin/src/xplra/Makefile.am	(revision 13)
+++ src/plugin/src/xplra/Makefile.am	(revision 13)
@@ -0,0 +1,60 @@
+INCLUDES=@XPSDK_INCLUDES@
+
+AM_CXXFLAGS=$(VSCPL_CFLAGS) $(LIBXPLCOMMON_CFLAGS)
+
+AM_CPPFLAGS=-DXPLM210
+
+SRCS= \
+	plugin.cc			\
+	ListenThread.cc			\
+	RequestQueue.cc			\
+	ServerThread.cc			\
+	TaskRequest.cc			\
+	DataRefTask.cc			\
+	GetDataRefTask.cc		\
+	SetDataRefTask.cc		\
+	MultiTaskRequest.cc		\
+	GetMultiDataRefRequest.cc	\
+	SetMultiDataRefRequest.cc
+
+noinst_HEADERS= \
+	ListenThread.h			\
+	Request.h			\
+	RequestQueue.h			\
+	Protocol.h			\
+	ServerThread.h			\
+	Task.h				\
+	TaskRequest.h			\
+	DataRefTask.h			\
+	GetDataRefTask.h		\
+	SetDataRefTask.h		\
+	MultiTaskRequest.h		\
+	GetMultiDataRefRequest.h	\
+	SetMultiDataRefRequest.h
+
+if TARGET_API_POSIX
+AM_CPPFLAGS+=-DLIN
+AM_CXXFLAGS+=-fPIC -fno-stack-protector
+AM_LDFLAGS=-shared -rdynamic -nodefaultlibs -undefined_warning -Wl,-version-script=$(srcdir)/version.ldscript
+noinst_PROGRAMS=lin.xpl
+lin_xpl_SOURCES=$(SRCS)
+lin_xpl_LDADD=$(VSCPL_LIBS) $(LIBXPLCOMMON_LIBS)
+endif
+
+if TARGET_API_WIN32
+AM_CPPFLAGS+=-DIBM
+AM_LDFLAGS=-shared -Wl,--enable-auto-image-base
+
+noinst_PROGRAMS=win.xpl
+win_xpl_SOURCES=$(SRCS)
+
+win_xpl_LDADD=@XPSDK_LDFLAGS@
+if TARGET_API_WIN64
+win_xpl_LDADD+=-lXPLM_64
+else
+win_xpl_LDADD+=-lXPLM
+endif
+win_xpl_LDADD+=$(VSCPL_LIBS) $(LIBXPLCOMMON_LIBS)
+endif
+
+EXTRA_DIST=version.ldscript
Index: src/plugin/src/xplra/Makefile.am
===================================================================
--- src/plugin/src/xplra/Makefile.am	(revision 13)
+++ 	(revision )
@@ -1,60 +1,0 @@
-INCLUDES=@XPSDK_INCLUDES@
-
-AM_CXXFLAGS=$(VSCPL_CFLAGS) $(LIBXPLCOMMON_CFLAGS)
-
-AM_CPPFLAGS=-DXPLM210
-
-SRCS= \
-	plugin.cc			\
-	ListenThread.cc			\
-	RequestQueue.cc			\
-	ServerThread.cc			\
-	TaskRequest.cc			\
-	DataRefTask.cc			\
-	GetDataRefTask.cc		\
-	SetDataRefTask.cc		\
-	MultiTaskRequest.cc		\
-	GetMultiDataRefRequest.cc	\
-	SetMultiDataRefRequest.cc
-
-noinst_HEADERS= \
-	ListenThread.h			\
-	Request.h			\
-	RequestQueue.h			\
-	Protocol.h			\
-	ServerThread.h			\
-	Task.h				\
-	TaskRequest.h			\
-	DataRefTask.h			\
-	GetDataRefTask.h		\
-	SetDataRefTask.h		\
-	MultiTaskRequest.h		\
-	GetMultiDataRefRequest.h	\
-	SetMultiDataRefRequest.h
-
-if TARGET_API_POSIX
-AM_CPPFLAGS+=-DLIN
-AM_CXXFLAGS+=-fPIC -fno-stack-protector
-AM_LDFLAGS=-shared -rdynamic -nodefaultlibs -undefined_warning -Wl,-version-script=$(srcdir)/version.ldscript
-noinst_PROGRAMS=lin.xpl
-lin_xpl_SOURCES=$(SRCS)
-lin_xpl_LDADD=$(VSCPL_LIBS) $(LIBXPLCOMMON_LIBS)
-endif
-
-if TARGET_API_WIN32
-AM_CPPFLAGS+=-DIBM
-AM_LDFLAGS=-shared -Wl,--enable-auto-image-base
-
-noinst_PROGRAMS=win.xpl
-win_xpl_SOURCES=$(SRCS)
-
-win_xpl_LDADD=@XPSDK_LDFLAGS@
-if TARGET_API_WIN64
-win_xpl_LDADD+=-lXPLM_64
-else
-win_xpl_LDADD+=-lXPLM
-endif
-win_xpl_LDADD+=$(VSCPL_LIBS) $(LIBXPLCOMMON_LIBS)
-endif
-
-EXTRA_DIST=version.ldscript
Index: src/plugin/src/xplra/MultiTaskRequest.cc
===================================================================
--- src/plugin/src/xplra/MultiTaskRequest.cc	(revision 13)
+++ src/plugin/src/xplra/MultiTaskRequest.cc	(revision 13)
@@ -0,0 +1,70 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "MultiTaskRequest.h"
+
+#include "Task.h"
+
+#include <hu/varadiistvan/xplcommon/Util.h>
+
+//------------------------------------------------------------------------------
+
+using xplra::MultiTaskRequest;
+
+using hu::varadiistvan::xplcommon::Util;
+
+//------------------------------------------------------------------------------
+
+MultiTaskRequest::~MultiTaskRequest()
+{
+    for(tasks_t::iterator i = tasks.begin(); i!=tasks.end(); ++i) {
+        delete *i;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+void MultiTaskRequest::execute()
+{
+    // Util::debug("hu.varadiistvan.xplra.MultiTaskRequest[%p]::execute\n", this);
+    for(tasks_t::iterator i = tasks.begin(); i!=tasks.end(); ++i) {
+        // Util::debug("hu.varadiistvan.xplra.MultiTaskRequest[%p]::execute: task=%p\n",
+        //             this, *i);
+        (*i)->perform();
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/MultiTaskRequest.cc
===================================================================
--- src/plugin/src/xplra/MultiTaskRequest.cc	(revision 13)
+++ 	(revision )
@@ -1,70 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "MultiTaskRequest.h"
-
-#include "Task.h"
-
-#include <hu/varadiistvan/xplcommon/Util.h>
-
-//------------------------------------------------------------------------------
-
-using xplra::MultiTaskRequest;
-
-using hu::varadiistvan::xplcommon::Util;
-
-//------------------------------------------------------------------------------
-
-MultiTaskRequest::~MultiTaskRequest()
-{
-    for(tasks_t::iterator i = tasks.begin(); i!=tasks.end(); ++i) {
-        delete *i;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-void MultiTaskRequest::execute()
-{
-    // Util::debug("hu.varadiistvan.xplra.MultiTaskRequest[%p]::execute\n", this);
-    for(tasks_t::iterator i = tasks.begin(); i!=tasks.end(); ++i) {
-        // Util::debug("hu.varadiistvan.xplra.MultiTaskRequest[%p]::execute: task=%p\n",
-        //             this, *i);
-        (*i)->perform();
-    }
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/MultiTaskRequest.h
===================================================================
--- src/plugin/src/xplra/MultiTaskRequest.h	(revision 13)
+++ src/plugin/src/xplra/MultiTaskRequest.h	(revision 13)
@@ -0,0 +1,170 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_MULTITASKREQUEST_H
+#define XPLRA_MULTITASKREQUEST_H
+//------------------------------------------------------------------------------
+
+#include "Request.h"
+
+#include <vector>
+
+#include <cstdlib>
+
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+class Task;
+
+//------------------------------------------------------------------------------
+
+/**
+ * A request containing several tasks which it performs one-by-one
+ * when executing the request. It owns the tasks, which get deleted
+ * when the request object is deleted.
+ */
+class MultiTaskRequest : public Request
+{
+private:
+    /**
+     * Type for the vector of the tasks.
+     */
+    typedef std::vector<Task*> tasks_t;
+
+    /**
+     * The tasks.
+     */
+    tasks_t tasks;
+
+public:
+    /**
+     * Destroy the request by deleting the tasks.
+     */
+    virtual ~MultiTaskRequest();
+
+    /**
+     * Add a task to the request.
+     */
+    void addTask(Task* task);
+
+    /**
+     * Get the number of tasks.
+     */
+    size_t getNumTasks() const;
+
+    /**
+     * Get the task at the given index.
+     */
+    Task* getTask(size_t index) const;
+
+protected:
+    /**
+     * Perform the tasks one-by-one.
+     */
+    virtual void execute();
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * A templated version of MultiTaskRequest, which accepts and returns
+ * tasks of a given type only.
+ */
+template <class TaskClass>
+class MultiTaskRequestTemplate : public MultiTaskRequest
+{
+public:
+    /**
+     * Add the given task.
+     */
+    void addTask(TaskClass* task);
+
+    /**
+     * Get the task at the given index.
+     */
+    TaskClass* getTask(size_t index) const;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline void MultiTaskRequest::addTask(Task* task)
+{
+    tasks.push_back(task);
+}
+
+//------------------------------------------------------------------------------
+
+inline size_t MultiTaskRequest::getNumTasks() const
+{
+    return tasks.size();
+}
+
+//------------------------------------------------------------------------------
+
+inline Task* MultiTaskRequest::getTask(size_t index) const
+{
+    return tasks[index];
+}
+
+//------------------------------------------------------------------------------
+// Template definitions
+//------------------------------------------------------------------------------
+
+template <class TaskClass>
+inline void MultiTaskRequestTemplate<TaskClass>::addTask(TaskClass* task)
+{
+    MultiTaskRequest::addTask(task);
+}
+
+//------------------------------------------------------------------------------
+
+template <class TaskClass>
+inline TaskClass*
+MultiTaskRequestTemplate<TaskClass>::getTask(size_t index) const
+{
+    return static_cast<TaskClass*>(MultiTaskRequest::getTask(index));
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_MULTITASKREQUEST_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/MultiTaskRequest.h
===================================================================
--- src/plugin/src/xplra/MultiTaskRequest.h	(revision 13)
+++ 	(revision )
@@ -1,170 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_MULTITASKREQUEST_H
-#define XPLRA_MULTITASKREQUEST_H
-//------------------------------------------------------------------------------
-
-#include "Request.h"
-
-#include <vector>
-
-#include <cstdlib>
-
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-class Task;
-
-//------------------------------------------------------------------------------
-
-/**
- * A request containing several tasks which it performs one-by-one
- * when executing the request. It owns the tasks, which get deleted
- * when the request object is deleted.
- */
-class MultiTaskRequest : public Request
-{
-private:
-    /**
-     * Type for the vector of the tasks.
-     */
-    typedef std::vector<Task*> tasks_t;
-
-    /**
-     * The tasks.
-     */
-    tasks_t tasks;
-
-public:
-    /**
-     * Destroy the request by deleting the tasks.
-     */
-    virtual ~MultiTaskRequest();
-
-    /**
-     * Add a task to the request.
-     */
-    void addTask(Task* task);
-
-    /**
-     * Get the number of tasks.
-     */
-    size_t getNumTasks() const;
-
-    /**
-     * Get the task at the given index.
-     */
-    Task* getTask(size_t index) const;
-
-protected:
-    /**
-     * Perform the tasks one-by-one.
-     */
-    virtual void execute();
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * A templated version of MultiTaskRequest, which accepts and returns
- * tasks of a given type only.
- */
-template <class TaskClass>
-class MultiTaskRequestTemplate : public MultiTaskRequest
-{
-public:
-    /**
-     * Add the given task.
-     */
-    void addTask(TaskClass* task);
-
-    /**
-     * Get the task at the given index.
-     */
-    TaskClass* getTask(size_t index) const;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline void MultiTaskRequest::addTask(Task* task)
-{
-    tasks.push_back(task);
-}
-
-//------------------------------------------------------------------------------
-
-inline size_t MultiTaskRequest::getNumTasks() const
-{
-    return tasks.size();
-}
-
-//------------------------------------------------------------------------------
-
-inline Task* MultiTaskRequest::getTask(size_t index) const
-{
-    return tasks[index];
-}
-
-//------------------------------------------------------------------------------
-// Template definitions
-//------------------------------------------------------------------------------
-
-template <class TaskClass>
-inline void MultiTaskRequestTemplate<TaskClass>::addTask(TaskClass* task)
-{
-    MultiTaskRequest::addTask(task);
-}
-
-//------------------------------------------------------------------------------
-
-template <class TaskClass>
-inline TaskClass*
-MultiTaskRequestTemplate<TaskClass>::getTask(size_t index) const
-{
-    return static_cast<TaskClass*>(MultiTaskRequest::getTask(index));
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_MULTITASKREQUEST_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/Protocol.h
===================================================================
--- src/plugin/src/xplra/Protocol.h	(revision 13)
+++ src/plugin/src/xplra/Protocol.h	(revision 13)
@@ -0,0 +1,191 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_PROTOCOL_H
+#define XPLRA_PROTOCOL_H
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Constants and helpers for the protocol.
+ */
+class Protocol
+{
+public:
+    /**
+     * Command: get the value of a single dataref.
+     */
+    static const uint8_t COMMAND_GET_SINGLE = 0x01;
+
+    /**
+     * Command: set the value of a single dataref.
+     */
+    static const uint8_t COMMAND_SET_SINGLE = 0x02;
+
+    /**
+     * Command: get the value of a multiple datarefs.
+     */
+    static const uint8_t COMMAND_GET_MULTI = 0x03;
+
+    /**
+     * Command: set the value of a multiple datarefs.
+     */
+    static const uint8_t COMMAND_SET_MULTI = 0x04;
+
+    /**
+     * Command: register a multiple-data query request
+     */
+    static const uint8_t COMMAND_REGISTER_GET_MULTI = 0x11;
+
+    /**
+     * Command: unregister a multiple-data query request
+     */
+    static const uint8_t COMMAND_UNREGISTER_GET_MULTI = 0x12;
+
+    /**
+     * Command: execute a registered multiple-data query request
+     */
+    static const uint8_t COMMAND_EXECUTE_GET_MULTI = 0x13;
+
+    /**
+     * Command: register a multiple-data update request
+     */
+    static const uint8_t COMMAND_REGISTER_SET_MULTI = 0x21;
+
+    /**
+     * Command: unregister a multiple-data update request
+     */
+    static const uint8_t COMMAND_UNREGISTER_SET_MULTI = 0x22;
+
+    /**
+     * Command: execute a registered multiple-data update request
+     */
+    static const uint8_t COMMAND_EXECUTE_SET_MULTI = 0x23;
+
+    /**
+     * Data type: int
+     */
+    static const uint8_t TYPE_INT = 0x01;
+
+    /**
+     * Data type: float
+     */
+    static const uint8_t TYPE_FLOAT = 0x02;
+
+    /**
+     * Data type: double
+     */
+    static const uint8_t TYPE_DOUBLE = 0x03;
+
+    /**
+     * Data type: float array
+     */
+    static const uint8_t TYPE_FLOAT_ARRAY = 0x11;
+
+    /**
+     * Data type: int array
+     */
+    static const uint8_t TYPE_INT_ARRAY = 0x12;
+
+    /**
+     * Data type: byte array
+     */
+    static const uint8_t TYPE_BYTE_ARRAY = 0x13;
+
+    /**
+     * Result code: no error, everything is OK.
+     */
+    static const uint8_t RESULT_OK = 0x00;
+
+    /**
+     * Result code: invalid command
+     */
+    static const uint8_t RESULT_INVALID_COMMAND = 0x01;
+
+    /**
+     * Result code: unknown dataref
+     */
+    static const uint8_t RESULT_UNKNOWN_DATAREF = 0x02;
+
+    /**
+     * Result code: invalid type
+     */
+    static const uint8_t RESULT_INVALID_TYPE = 0x03;
+
+    /**
+     * Result code: invalid length
+     */
+    static const uint8_t RESULT_INVALID_LENGTH = 0x04;
+
+    /**
+     * Result code: invalid offset
+     */
+    static const uint8_t RESULT_INVALID_OFFSET = 0x05;
+
+    /**
+     * Result code: invalid count
+     */
+    static const uint8_t RESULT_INVALID_COUNT = 0x06;
+
+    /**
+     * Result code: invalid ID
+     */
+    static const uint8_t RESULT_INVALID_ID = 0x07;
+
+    /**
+     * Result code: other error
+     */
+    static const uint8_t RESULT_OTHER_ERROR = 0xff;
+
+    /**
+     * The maximal length we accept (in order to protect ourselves).
+     */
+    static const int MAX_LENGTH = 2048;
+
+    /**
+     * The maximal count of requests in a multiple-data query or
+     * update.
+     */
+    static const size_t MAX_MULTI_COUNT = 1024;
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_PROTOCOL_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/Protocol.h
===================================================================
--- src/plugin/src/xplra/Protocol.h	(revision 13)
+++ 	(revision )
@@ -1,191 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_PROTOCOL_H
-#define XPLRA_PROTOCOL_H
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-/**
- * Constants and helpers for the protocol.
- */
-class Protocol
-{
-public:
-    /**
-     * Command: get the value of a single dataref.
-     */
-    static const uint8_t COMMAND_GET_SINGLE = 0x01;
-
-    /**
-     * Command: set the value of a single dataref.
-     */
-    static const uint8_t COMMAND_SET_SINGLE = 0x02;
-
-    /**
-     * Command: get the value of a multiple datarefs.
-     */
-    static const uint8_t COMMAND_GET_MULTI = 0x03;
-
-    /**
-     * Command: set the value of a multiple datarefs.
-     */
-    static const uint8_t COMMAND_SET_MULTI = 0x04;
-
-    /**
-     * Command: register a multiple-data query request
-     */
-    static const uint8_t COMMAND_REGISTER_GET_MULTI = 0x11;
-
-    /**
-     * Command: unregister a multiple-data query request
-     */
-    static const uint8_t COMMAND_UNREGISTER_GET_MULTI = 0x12;
-
-    /**
-     * Command: execute a registered multiple-data query request
-     */
-    static const uint8_t COMMAND_EXECUTE_GET_MULTI = 0x13;
-
-    /**
-     * Command: register a multiple-data update request
-     */
-    static const uint8_t COMMAND_REGISTER_SET_MULTI = 0x21;
-
-    /**
-     * Command: unregister a multiple-data update request
-     */
-    static const uint8_t COMMAND_UNREGISTER_SET_MULTI = 0x22;
-
-    /**
-     * Command: execute a registered multiple-data update request
-     */
-    static const uint8_t COMMAND_EXECUTE_SET_MULTI = 0x23;
-
-    /**
-     * Data type: int
-     */
-    static const uint8_t TYPE_INT = 0x01;
-
-    /**
-     * Data type: float
-     */
-    static const uint8_t TYPE_FLOAT = 0x02;
-
-    /**
-     * Data type: double
-     */
-    static const uint8_t TYPE_DOUBLE = 0x03;
-
-    /**
-     * Data type: float array
-     */
-    static const uint8_t TYPE_FLOAT_ARRAY = 0x11;
-
-    /**
-     * Data type: int array
-     */
-    static const uint8_t TYPE_INT_ARRAY = 0x12;
-
-    /**
-     * Data type: byte array
-     */
-    static const uint8_t TYPE_BYTE_ARRAY = 0x13;
-
-    /**
-     * Result code: no error, everything is OK.
-     */
-    static const uint8_t RESULT_OK = 0x00;
-
-    /**
-     * Result code: invalid command
-     */
-    static const uint8_t RESULT_INVALID_COMMAND = 0x01;
-
-    /**
-     * Result code: unknown dataref
-     */
-    static const uint8_t RESULT_UNKNOWN_DATAREF = 0x02;
-
-    /**
-     * Result code: invalid type
-     */
-    static const uint8_t RESULT_INVALID_TYPE = 0x03;
-
-    /**
-     * Result code: invalid length
-     */
-    static const uint8_t RESULT_INVALID_LENGTH = 0x04;
-
-    /**
-     * Result code: invalid offset
-     */
-    static const uint8_t RESULT_INVALID_OFFSET = 0x05;
-
-    /**
-     * Result code: invalid count
-     */
-    static const uint8_t RESULT_INVALID_COUNT = 0x06;
-
-    /**
-     * Result code: invalid ID
-     */
-    static const uint8_t RESULT_INVALID_ID = 0x07;
-
-    /**
-     * Result code: other error
-     */
-    static const uint8_t RESULT_OTHER_ERROR = 0xff;
-
-    /**
-     * The maximal length we accept (in order to protect ourselves).
-     */
-    static const int MAX_LENGTH = 2048;
-
-    /**
-     * The maximal count of requests in a multiple-data query or
-     * update.
-     */
-    static const size_t MAX_MULTI_COUNT = 1024;
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_PROTOCOL_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/Request.h
===================================================================
--- src/plugin/src/xplra/Request.h	(revision 13)
+++ src/plugin/src/xplra/Request.h	(revision 13)
@@ -0,0 +1,95 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_REQUEST_H
+#define XPLRA_REQUEST_H
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for requests. A request is something that is executed in
+ * the flight loop.
+ */
+class Request
+{
+private:
+    /**
+     * Indicate that the request is completed.
+     */
+    volatile bool completed;
+
+public:
+    /**
+     * Construct the request.
+     */
+    Request();
+
+    /**
+     * Virtual destructor.
+     */
+    virtual ~Request();
+
+protected:
+    /**
+     * Execute the request. Make this very fast!
+     */
+    virtual void execute() = 0;
+
+    friend class RequestQueue;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Request::Request() :
+    completed(false)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline Request::~Request()
+{
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_REQUEST_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/Request.h
===================================================================
--- src/plugin/src/xplra/Request.h	(revision 13)
+++ 	(revision )
@@ -1,95 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_REQUEST_H
-#define XPLRA_REQUEST_H
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class for requests. A request is something that is executed in
- * the flight loop.
- */
-class Request
-{
-private:
-    /**
-     * Indicate that the request is completed.
-     */
-    volatile bool completed;
-
-public:
-    /**
-     * Construct the request.
-     */
-    Request();
-
-    /**
-     * Virtual destructor.
-     */
-    virtual ~Request();
-
-protected:
-    /**
-     * Execute the request. Make this very fast!
-     */
-    virtual void execute() = 0;
-
-    friend class RequestQueue;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Request::Request() :
-    completed(false)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline Request::~Request()
-{
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_REQUEST_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/RequestQueue.cc
===================================================================
--- src/plugin/src/xplra/RequestQueue.cc	(revision 13)
+++ src/plugin/src/xplra/RequestQueue.cc	(revision 13)
@@ -0,0 +1,156 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "RequestQueue.h"
+
+#include "Request.h"
+
+#include <hu/varadiistvan/xplcommon/Util.h>
+
+//------------------------------------------------------------------------------
+
+using xplra::RequestQueue;
+
+using hu::varadiistvan::xplcommon::Util;
+
+//------------------------------------------------------------------------------
+
+float RequestQueue::flightLoop(float /*inElapsedSinceLastCall*/,
+                               float /*inElapsedTimeSinceLastFlightLoop*/,
+                               int /*inCounter*/, void* inRefCon)
+{
+    RequestQueue* requestQueue = reinterpret_cast<RequestQueue*>(inRefCon);
+    requestQueue->run();
+#if USE_SCHEDULE_FLIGHTLOOP
+    return 0.0;
+#else
+    return flightLoopInterval;
+#endif
+}
+
+//------------------------------------------------------------------------------
+
+RequestQueue::RequestQueue() :
+    enabled(true)
+{
+#if USE_SCHEDULE_FLIGHTLOOP
+    XPLMCreateFlightLoop_t createFL;
+
+    createFL.structSize = sizeof(createFL);
+    createFL.phase = xplm_FlightLoop_Phase_AfterFlightModel;
+    createFL.callbackFunc = &flightLoop;
+    createFL.refcon = this;
+
+    flightLoopID = XPLMCreateFlightLoop(&createFL);
+#else
+    XPLMRegisterFlightLoopCallback(&flightLoop, flightLoopInterval, this);
+#endif
+}
+
+//------------------------------------------------------------------------------
+
+bool RequestQueue::execute(Request* request)
+{
+    mutex.lock();
+    if (!enabled) {
+        mutex.unlock();
+        return false;
+    }
+
+    request->completed = false;
+    requests.push_back(request);
+
+#if USE_SCHEDULE_FLIGHTLOOP
+    if (requests.size()==1) {
+        XPLMScheduleFlightLoop(flightLoopID, -2.0, true);
+    }
+#endif
+
+    while(enabled && !request->completed) {
+        requestsDone.wait(mutex);
+    }
+
+    bool result = request->completed;
+
+    mutex.unlock();
+
+    return result;
+}
+
+//------------------------------------------------------------------------------
+
+void RequestQueue::disable()
+{
+    mutex.lock();
+    enabled = false;
+    mutex.unlock();
+    requestsDone.broadcast();
+#if USE_SCHEDULE_FLIGHTLOOP
+    XPLMDestroyFlightLoop(flightLoopID);
+#else
+    XPLMUnregisterFlightLoopCallback(&flightLoop, this);
+#endif
+}
+
+//------------------------------------------------------------------------------
+
+void RequestQueue::run()
+{
+    requests_t queuedRequests;
+
+    mutex.lock();
+    requests.swap(queuedRequests);
+    mutex.unlock();
+
+    if (queuedRequests.empty()) return;
+
+    for(requests_t::const_iterator i = queuedRequests.begin();
+        i!=queuedRequests.end(); ++i)
+    {
+        (*i)->execute();
+    }
+
+    mutex.lock();
+    for(requests_t::const_iterator i = queuedRequests.begin();
+        i!=queuedRequests.end(); ++i)
+    {
+        (*i)->completed = true;
+    }
+    mutex.unlock();
+    requestsDone.broadcast();
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/RequestQueue.cc
===================================================================
--- src/plugin/src/xplra/RequestQueue.cc	(revision 13)
+++ 	(revision )
@@ -1,156 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "RequestQueue.h"
-
-#include "Request.h"
-
-#include <hu/varadiistvan/xplcommon/Util.h>
-
-//------------------------------------------------------------------------------
-
-using xplra::RequestQueue;
-
-using hu::varadiistvan::xplcommon::Util;
-
-//------------------------------------------------------------------------------
-
-float RequestQueue::flightLoop(float /*inElapsedSinceLastCall*/,
-                               float /*inElapsedTimeSinceLastFlightLoop*/,
-                               int /*inCounter*/, void* inRefCon)
-{
-    RequestQueue* requestQueue = reinterpret_cast<RequestQueue*>(inRefCon);
-    requestQueue->run();
-#if USE_SCHEDULE_FLIGHTLOOP
-    return 0.0;
-#else
-    return flightLoopInterval;
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-RequestQueue::RequestQueue() :
-    enabled(true)
-{
-#if USE_SCHEDULE_FLIGHTLOOP
-    XPLMCreateFlightLoop_t createFL;
-
-    createFL.structSize = sizeof(createFL);
-    createFL.phase = xplm_FlightLoop_Phase_AfterFlightModel;
-    createFL.callbackFunc = &flightLoop;
-    createFL.refcon = this;
-
-    flightLoopID = XPLMCreateFlightLoop(&createFL);
-#else
-    XPLMRegisterFlightLoopCallback(&flightLoop, flightLoopInterval, this);
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-bool RequestQueue::execute(Request* request)
-{
-    mutex.lock();
-    if (!enabled) {
-        mutex.unlock();
-        return false;
-    }
-
-    request->completed = false;
-    requests.push_back(request);
-
-#if USE_SCHEDULE_FLIGHTLOOP
-    if (requests.size()==1) {
-        XPLMScheduleFlightLoop(flightLoopID, -2.0, true);
-    }
-#endif
-
-    while(enabled && !request->completed) {
-        requestsDone.wait(mutex);
-    }
-
-    bool result = request->completed;
-
-    mutex.unlock();
-
-    return result;
-}
-
-//------------------------------------------------------------------------------
-
-void RequestQueue::disable()
-{
-    mutex.lock();
-    enabled = false;
-    mutex.unlock();
-    requestsDone.broadcast();
-#if USE_SCHEDULE_FLIGHTLOOP
-    XPLMDestroyFlightLoop(flightLoopID);
-#else
-    XPLMUnregisterFlightLoopCallback(&flightLoop, this);
-#endif
-}
-
-//------------------------------------------------------------------------------
-
-void RequestQueue::run()
-{
-    requests_t queuedRequests;
-
-    mutex.lock();
-    requests.swap(queuedRequests);
-    mutex.unlock();
-
-    if (queuedRequests.empty()) return;
-
-    for(requests_t::const_iterator i = queuedRequests.begin();
-        i!=queuedRequests.end(); ++i)
-    {
-        (*i)->execute();
-    }
-
-    mutex.lock();
-    for(requests_t::const_iterator i = queuedRequests.begin();
-        i!=queuedRequests.end(); ++i)
-    {
-        (*i)->completed = true;
-    }
-    mutex.unlock();
-    requestsDone.broadcast();
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/RequestQueue.h
===================================================================
--- src/plugin/src/xplra/RequestQueue.h	(revision 13)
+++ src/plugin/src/xplra/RequestQueue.h	(revision 13)
@@ -0,0 +1,168 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_REQUESTQUEUE_H
+#define XPLRA_REQUESTQUEUE_H
+//------------------------------------------------------------------------------
+
+#include <hu/varadiistvan/scpl/Mutex.h>
+#include <hu/varadiistvan/scpl/CondVar.h>
+
+#include <XPLMProcessing.h>
+
+#include <vector>
+
+//------------------------------------------------------------------------------
+
+// Define to 1, if the new XPLMScheduleFlightLoop function should be
+// used to schedule the flight loop only on-demand
+#define USE_SCHEDULE_FLIGHTLOOP 0
+
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+class Request;
+
+//------------------------------------------------------------------------------
+
+/**
+ * The queue of the requests. Client serving threads can add requests
+ * to the queue. The queue provides a flight loop callback, which it
+ * automatically schedules if a request is added to it, unless we are
+ * already disabled.
+ *
+ * An instance of the queue should be created in the plugin enable
+ * callback. The disable callback should disable the queue, so that it
+ * will not accept any further requests.
+ */
+class RequestQueue
+{
+private:
+    /**
+     * Type for the collection of the queued requests.
+     */
+    typedef std::vector<Request*> requests_t;
+
+#if !USE_SCHEDULE_FLIGHTLOOP
+    /**
+     * The interval of the flight loop.
+     */
+    static const float flightLoopInterval = 0.1;
+#endif
+
+    /**
+     * The flight loop function.
+     */
+    static float flightLoop(float inElapsedSinceLastCall,
+                            float inElapsedTimeSinceLastFlightLoop,
+                            int inCounter, void* inRefCon);
+
+#if USE_SCHEDULE_FLIGHTLOOP
+    /**
+     * The ID of the flight loop running the queue.
+     */
+    XPLMFlightLoopID flightLoopID;
+#endif
+
+    /**
+     * The mutex protecting the queue.
+     */
+    hu::varadiistvan::scpl::Mutex mutex;
+
+    /**
+     * A conditional variable to notify the threads waiting for their
+     * request to be executed.
+     */
+    hu::varadiistvan::scpl::CondVar requestsDone;
+
+    /**
+     * Indicate if the queue is enabled or not.
+     */
+    volatile bool enabled;
+
+    /**
+     * The vector of the queued requests.
+     */
+    requests_t requests;
+
+public:
+    /**
+     * Construct the queue. It creates the flight loop, so it should
+     * be called from a plugin callback.
+     */
+    RequestQueue();
+
+    /**
+     * Execute the given request. It will be enqueued, and then this
+     * function will wait until the request is executed or the request
+     * queue is disabled.
+     *
+     * If the queue is already disabled when calling this function, it
+     * returns immediately with false.
+     *
+     * @return if the request was executed
+     */
+    bool execute(Request* request);
+
+    /**
+     * Disable the queue. It sets the flag indicating that the queue
+     * is disabled, and wakes up all waiters waiting on the
+     * conditional variable. It should be called from a plugin
+     * callback, as it also destroys the flight loop.
+     */
+    void disable();
+
+private:
+    /**
+     * Run the queue.
+     *
+     * It locks the mutex, swaps the vector of requests with an empty
+     * one, unlocks the mutex and runs the requests one by one. When
+     * all requests are executed, it wakes up all waiters waiting on
+     * the conditional variable.
+     *
+     * It is called from the flight loop function.
+     */
+    void run();
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_REQUESTQUEUE_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/RequestQueue.h
===================================================================
--- src/plugin/src/xplra/RequestQueue.h	(revision 13)
+++ 	(revision )
@@ -1,168 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_REQUESTQUEUE_H
-#define XPLRA_REQUESTQUEUE_H
-//------------------------------------------------------------------------------
-
-#include <hu/varadiistvan/scpl/Mutex.h>
-#include <hu/varadiistvan/scpl/CondVar.h>
-
-#include <XPLMProcessing.h>
-
-#include <vector>
-
-//------------------------------------------------------------------------------
-
-// Define to 1, if the new XPLMScheduleFlightLoop function should be
-// used to schedule the flight loop only on-demand
-#define USE_SCHEDULE_FLIGHTLOOP 0
-
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-class Request;
-
-//------------------------------------------------------------------------------
-
-/**
- * The queue of the requests. Client serving threads can add requests
- * to the queue. The queue provides a flight loop callback, which it
- * automatically schedules if a request is added to it, unless we are
- * already disabled.
- *
- * An instance of the queue should be created in the plugin enable
- * callback. The disable callback should disable the queue, so that it
- * will not accept any further requests.
- */
-class RequestQueue
-{
-private:
-    /**
-     * Type for the collection of the queued requests.
-     */
-    typedef std::vector<Request*> requests_t;
-
-#if !USE_SCHEDULE_FLIGHTLOOP
-    /**
-     * The interval of the flight loop.
-     */
-    static const float flightLoopInterval = 0.1;
-#endif
-
-    /**
-     * The flight loop function.
-     */
-    static float flightLoop(float inElapsedSinceLastCall,
-                            float inElapsedTimeSinceLastFlightLoop,
-                            int inCounter, void* inRefCon);
-
-#if USE_SCHEDULE_FLIGHTLOOP
-    /**
-     * The ID of the flight loop running the queue.
-     */
-    XPLMFlightLoopID flightLoopID;
-#endif
-
-    /**
-     * The mutex protecting the queue.
-     */
-    hu::varadiistvan::scpl::Mutex mutex;
-
-    /**
-     * A conditional variable to notify the threads waiting for their
-     * request to be executed.
-     */
-    hu::varadiistvan::scpl::CondVar requestsDone;
-
-    /**
-     * Indicate if the queue is enabled or not.
-     */
-    volatile bool enabled;
-
-    /**
-     * The vector of the queued requests.
-     */
-    requests_t requests;
-
-public:
-    /**
-     * Construct the queue. It creates the flight loop, so it should
-     * be called from a plugin callback.
-     */
-    RequestQueue();
-
-    /**
-     * Execute the given request. It will be enqueued, and then this
-     * function will wait until the request is executed or the request
-     * queue is disabled.
-     *
-     * If the queue is already disabled when calling this function, it
-     * returns immediately with false.
-     *
-     * @return if the request was executed
-     */
-    bool execute(Request* request);
-
-    /**
-     * Disable the queue. It sets the flag indicating that the queue
-     * is disabled, and wakes up all waiters waiting on the
-     * conditional variable. It should be called from a plugin
-     * callback, as it also destroys the flight loop.
-     */
-    void disable();
-
-private:
-    /**
-     * Run the queue.
-     *
-     * It locks the mutex, swaps the vector of requests with an empty
-     * one, unlocks the mutex and runs the requests one by one. When
-     * all requests are executed, it wakes up all waiters waiting on
-     * the conditional variable.
-     *
-     * It is called from the flight loop function.
-     */
-    void run();
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_REQUESTQUEUE_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/ServerThread.cc
===================================================================
--- src/plugin/src/xplra/ServerThread.cc	(revision 13)
+++ src/plugin/src/xplra/ServerThread.cc	(revision 13)
@@ -0,0 +1,390 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "ServerThread.h"
+
+#include "RequestQueue.h"
+#include "Protocol.h"
+#include "GetDataRefTask.h"
+#include "SetDataRefTask.h"
+#include "TaskRequest.h"
+#include "GetMultiDataRefRequest.h"
+#include "SetMultiDataRefRequest.h"
+
+#include <hu/varadiistvan/xplcommon/Util.h>
+
+#include <cstdio>
+
+//------------------------------------------------------------------------------
+
+using xplra::ServerThread;
+
+using hu::varadiistvan::scpl::io::LocalAcceptor;
+using hu::varadiistvan::scpl::Mutex;
+using hu::varadiistvan::xplcommon::Util;
+
+using std::string;
+
+//------------------------------------------------------------------------------
+
+Mutex ServerThread::instancesMutex;
+
+ServerThread::instances_t ServerThread::instances;
+
+//------------------------------------------------------------------------------
+
+void ServerThread::quitAll()
+{
+    instancesMutex.lock();
+    for(instances_t::iterator i = instances.begin(); i!=instances.end(); ++i) {
+        (*i)->quit();
+    }
+    instancesMutex.unlock();
+}
+
+//------------------------------------------------------------------------------
+
+ServerThread::ServerThread(RequestQueue& requestQueue, LocalAcceptor& acceptor) :
+    Thread(true),
+    requestQueue(requestQueue),
+    bufferedStream(acceptor.getSocket(&waiter)),
+    stream(*bufferedStream),
+    nextGetMultiRequestID(1),
+    nextSetMultiRequestID(1)
+{
+    instancesMutex.lock();
+    instances.insert(this);
+    instancesMutex.unlock();
+}
+
+//------------------------------------------------------------------------------
+
+ServerThread::~ServerThread()
+{
+    delete bufferedStream;
+
+    for(getMultiRequests_t::iterator i = getMultiRequests.begin();
+        i!=getMultiRequests.end(); ++i)
+    {
+        delete i->second;
+    }
+
+    for(setMultiRequests_t::iterator i = setMultiRequests.begin();
+        i!=setMultiRequests.end(); ++i)
+    {
+        delete i->second;
+    }
+
+    instancesMutex.lock();
+    instances.erase(this);
+    instancesMutex.unlock();
+}
+
+//------------------------------------------------------------------------------
+
+void ServerThread::quit()
+{
+    stream.interrupt();
+}
+
+//------------------------------------------------------------------------------
+
+void ServerThread::run()
+{
+    Util::debug("hu.varadiistvan.xplra.ServerThread[%p]::run\n", this);
+    while(stream) {
+        uint8_t command = stream.readU8();
+        if (!stream) continue;
+
+        // Util::debug("hu.varadiistvan.xplra.ServerThread[%p]::run: command=0x%02x\n",
+        //             this, command);
+
+        if (command==Protocol::COMMAND_GET_SINGLE) {
+            if (!handleGetSingle()) break;
+        } else if (command==Protocol::COMMAND_SET_SINGLE) {
+            if (!handleSetSingle()) break;
+        } else if (command==Protocol::COMMAND_GET_MULTI) {
+            if (!handleGetMulti()) break;
+        } else if (command==Protocol::COMMAND_SET_MULTI) {
+            if (!handleSetMulti()) break;
+        } else if (command==Protocol::COMMAND_REGISTER_GET_MULTI) {
+            if (!handleRegisterGetMulti()) break;
+        } else if (command==Protocol::COMMAND_UNREGISTER_GET_MULTI) {
+            if (!handleUnregisterGetMulti()) break;
+        } else if (command==Protocol::COMMAND_EXECUTE_GET_MULTI) {
+            if (!handleExecuteGetMulti()) break;
+        } else if (command==Protocol::COMMAND_REGISTER_SET_MULTI) {
+            if (!handleRegisterSetMulti()) break;
+        } else if (command==Protocol::COMMAND_UNREGISTER_SET_MULTI) {
+            if (!handleUnregisterSetMulti()) break;
+        } else if (command==Protocol::COMMAND_EXECUTE_SET_MULTI) {
+            if (!handleExecuteSetMulti()) break;
+        } else {
+            stream.writeU8(Protocol::RESULT_INVALID_COMMAND);
+        }
+        stream.flush();
+    }
+
+    Util::debug("hu.varadiistvan.xplra.ServerThread[%p]::run: quitting\n", this);
+}
+
+//------------------------------------------------------------------------------
+
+bool ServerThread::handleGetSingle()
+{
+    uint8_t result = Protocol::RESULT_OK;
+    GetDataRefTask* task = GetDataRefTask::create(result, stream);
+
+    if (!stream) {
+        return false;
+    } else if (task==0) {
+        stream.writeU8(result);
+        return true;
+    }
+
+    TaskRequest request(task);
+    if (!requestQueue.execute(&request)) return false;
+
+    if (task->isValid()) {
+        stream.writeU8(Protocol::RESULT_OK);
+        task->writeValue(stream);
+    } else {
+        stream.writeU8(Protocol::RESULT_UNKNOWN_DATAREF);
+    }
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+bool ServerThread::handleSetSingle()
+{
+    uint8_t result = Protocol::RESULT_OK;
+    SetDataRefTask* task = SetDataRefTask::create(result, stream);
+
+    if (!stream) {
+        return false;
+    } else if (task==0) {
+        stream.writeU8(result);
+        return true;
+    }
+
+    task->readValue(stream);
+    if (!stream) {
+        delete task;
+        return false;
+    }
+
+    TaskRequest request(task);
+    if (!requestQueue.execute(&request)) return false;
+
+    stream.writeU8(task->isValid() ? Protocol::RESULT_OK :
+                   Protocol::RESULT_UNKNOWN_DATAREF);
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+bool ServerThread::handleGetMulti()
+{
+    uint8_t result = Protocol::RESULT_OK;
+    GetMultiDataRefRequest* request =
+        new GetMultiDataRefRequest(result, stream);
+    if (result!=Protocol::RESULT_OK || !stream) {
+        delete request;
+        stream.writeU8(result);
+        return stream;
+    }
+
+    bool isOK = requestQueue.execute(request);
+
+    if (isOK) {
+        request->writeResult(stream);
+    }
+
+    delete request;
+
+    return isOK;
+}
+
+//------------------------------------------------------------------------------
+
+bool ServerThread::handleSetMulti()
+{
+    uint8_t result = Protocol::RESULT_OK;
+    SetMultiDataRefRequest* request =
+        new SetMultiDataRefRequest(result, stream, true);
+    if (result!=Protocol::RESULT_OK || !stream) {
+        delete request;
+        stream.writeU8(result);
+        return stream;
+    }
+
+    bool isOK = requestQueue.execute(request);
+
+    if (isOK) {
+        request->writeResult(stream);
+    }
+
+    delete request;
+
+    return isOK;
+}
+
+//------------------------------------------------------------------------------
+
+bool ServerThread::handleRegisterGetMulti()
+{
+    uint8_t result = Protocol::RESULT_OK;
+    GetMultiDataRefRequest* request =
+        new GetMultiDataRefRequest(result, stream);
+    if (result!=Protocol::RESULT_OK || !stream) {
+        delete request;
+        stream.writeU8(result);
+        return stream;
+    }
+
+    size_t id = nextGetMultiRequestID++;
+    getMultiRequests[id] = request;
+
+    stream.writeU8(Protocol::RESULT_OK);
+    stream.writeU32(id);
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+bool ServerThread::handleUnregisterGetMulti()
+{
+    uint32_t id = stream.readU32();
+    if (!stream) return false;
+
+    getMultiRequests_t::iterator i = getMultiRequests.find(id);
+    if (i==getMultiRequests.end()) {
+        stream.writeU8(Protocol::RESULT_INVALID_ID);
+    } else {
+        GetMultiDataRefRequest* request = i->second;
+        getMultiRequests.erase(i);
+        delete request;
+        stream.writeU8(Protocol::RESULT_OK);
+    }
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+bool ServerThread::handleExecuteGetMulti()
+{
+    uint32_t id = stream.readU32();
+    if (!stream) return false;
+
+    getMultiRequests_t::iterator i = getMultiRequests.find(id);
+    if (i==getMultiRequests.end()) {
+        stream.writeU8(Protocol::RESULT_INVALID_ID);
+    } else {
+        GetMultiDataRefRequest* request = i->second;
+        if (!requestQueue.execute(request)) return false;
+        request->writeResult(stream);
+    }
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+bool ServerThread::handleRegisterSetMulti()
+{
+    uint8_t result = Protocol::RESULT_OK;
+    SetMultiDataRefRequest* request =
+        new SetMultiDataRefRequest(result, stream, false);
+    if (result!=Protocol::RESULT_OK || !stream) {
+        delete request;
+        stream.writeU8(result);
+        return stream;
+    }
+
+    size_t id = nextSetMultiRequestID++;
+    setMultiRequests[id] = request;
+
+    stream.writeU8(Protocol::RESULT_OK);
+    stream.writeU32(id);
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+bool ServerThread::handleUnregisterSetMulti()
+{
+    uint32_t id = stream.readU32();
+    if (!stream) return false;
+
+    setMultiRequests_t::iterator i = setMultiRequests.find(id);
+    if (i==setMultiRequests.end()) {
+        stream.writeU8(Protocol::RESULT_INVALID_ID);
+    } else {
+        SetMultiDataRefRequest* request = i->second;
+        setMultiRequests.erase(i);
+        delete request;
+        stream.writeU8(Protocol::RESULT_OK);
+    }
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+bool ServerThread::handleExecuteSetMulti()
+{
+    uint32_t id = stream.readU32();
+    if (!stream) return false;
+
+    setMultiRequests_t::iterator i = setMultiRequests.find(id);
+    if (i==setMultiRequests.end()) {
+        stream.writeU8(Protocol::RESULT_INVALID_ID);
+    } else {
+        SetMultiDataRefRequest* request = i->second;
+        request->readValues(stream);
+        if (!stream || !requestQueue.execute(request)) return false;
+        request->writeResult(stream);
+    }
+
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/ServerThread.cc
===================================================================
--- src/plugin/src/xplra/ServerThread.cc	(revision 13)
+++ 	(revision )
@@ -1,390 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "ServerThread.h"
-
-#include "RequestQueue.h"
-#include "Protocol.h"
-#include "GetDataRefTask.h"
-#include "SetDataRefTask.h"
-#include "TaskRequest.h"
-#include "GetMultiDataRefRequest.h"
-#include "SetMultiDataRefRequest.h"
-
-#include <hu/varadiistvan/xplcommon/Util.h>
-
-#include <cstdio>
-
-//------------------------------------------------------------------------------
-
-using xplra::ServerThread;
-
-using hu::varadiistvan::scpl::io::LocalAcceptor;
-using hu::varadiistvan::scpl::Mutex;
-using hu::varadiistvan::xplcommon::Util;
-
-using std::string;
-
-//------------------------------------------------------------------------------
-
-Mutex ServerThread::instancesMutex;
-
-ServerThread::instances_t ServerThread::instances;
-
-//------------------------------------------------------------------------------
-
-void ServerThread::quitAll()
-{
-    instancesMutex.lock();
-    for(instances_t::iterator i = instances.begin(); i!=instances.end(); ++i) {
-        (*i)->quit();
-    }
-    instancesMutex.unlock();
-}
-
-//------------------------------------------------------------------------------
-
-ServerThread::ServerThread(RequestQueue& requestQueue, LocalAcceptor& acceptor) :
-    Thread(true),
-    requestQueue(requestQueue),
-    bufferedStream(acceptor.getSocket(&waiter)),
-    stream(*bufferedStream),
-    nextGetMultiRequestID(1),
-    nextSetMultiRequestID(1)
-{
-    instancesMutex.lock();
-    instances.insert(this);
-    instancesMutex.unlock();
-}
-
-//------------------------------------------------------------------------------
-
-ServerThread::~ServerThread()
-{
-    delete bufferedStream;
-
-    for(getMultiRequests_t::iterator i = getMultiRequests.begin();
-        i!=getMultiRequests.end(); ++i)
-    {
-        delete i->second;
-    }
-
-    for(setMultiRequests_t::iterator i = setMultiRequests.begin();
-        i!=setMultiRequests.end(); ++i)
-    {
-        delete i->second;
-    }
-
-    instancesMutex.lock();
-    instances.erase(this);
-    instancesMutex.unlock();
-}
-
-//------------------------------------------------------------------------------
-
-void ServerThread::quit()
-{
-    stream.interrupt();
-}
-
-//------------------------------------------------------------------------------
-
-void ServerThread::run()
-{
-    Util::debug("hu.varadiistvan.xplra.ServerThread[%p]::run\n", this);
-    while(stream) {
-        uint8_t command = stream.readU8();
-        if (!stream) continue;
-
-        // Util::debug("hu.varadiistvan.xplra.ServerThread[%p]::run: command=0x%02x\n",
-        //             this, command);
-
-        if (command==Protocol::COMMAND_GET_SINGLE) {
-            if (!handleGetSingle()) break;
-        } else if (command==Protocol::COMMAND_SET_SINGLE) {
-            if (!handleSetSingle()) break;
-        } else if (command==Protocol::COMMAND_GET_MULTI) {
-            if (!handleGetMulti()) break;
-        } else if (command==Protocol::COMMAND_SET_MULTI) {
-            if (!handleSetMulti()) break;
-        } else if (command==Protocol::COMMAND_REGISTER_GET_MULTI) {
-            if (!handleRegisterGetMulti()) break;
-        } else if (command==Protocol::COMMAND_UNREGISTER_GET_MULTI) {
-            if (!handleUnregisterGetMulti()) break;
-        } else if (command==Protocol::COMMAND_EXECUTE_GET_MULTI) {
-            if (!handleExecuteGetMulti()) break;
-        } else if (command==Protocol::COMMAND_REGISTER_SET_MULTI) {
-            if (!handleRegisterSetMulti()) break;
-        } else if (command==Protocol::COMMAND_UNREGISTER_SET_MULTI) {
-            if (!handleUnregisterSetMulti()) break;
-        } else if (command==Protocol::COMMAND_EXECUTE_SET_MULTI) {
-            if (!handleExecuteSetMulti()) break;
-        } else {
-            stream.writeU8(Protocol::RESULT_INVALID_COMMAND);
-        }
-        stream.flush();
-    }
-
-    Util::debug("hu.varadiistvan.xplra.ServerThread[%p]::run: quitting\n", this);
-}
-
-//------------------------------------------------------------------------------
-
-bool ServerThread::handleGetSingle()
-{
-    uint8_t result = Protocol::RESULT_OK;
-    GetDataRefTask* task = GetDataRefTask::create(result, stream);
-
-    if (!stream) {
-        return false;
-    } else if (task==0) {
-        stream.writeU8(result);
-        return true;
-    }
-
-    TaskRequest request(task);
-    if (!requestQueue.execute(&request)) return false;
-
-    if (task->isValid()) {
-        stream.writeU8(Protocol::RESULT_OK);
-        task->writeValue(stream);
-    } else {
-        stream.writeU8(Protocol::RESULT_UNKNOWN_DATAREF);
-    }
-
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-bool ServerThread::handleSetSingle()
-{
-    uint8_t result = Protocol::RESULT_OK;
-    SetDataRefTask* task = SetDataRefTask::create(result, stream);
-
-    if (!stream) {
-        return false;
-    } else if (task==0) {
-        stream.writeU8(result);
-        return true;
-    }
-
-    task->readValue(stream);
-    if (!stream) {
-        delete task;
-        return false;
-    }
-
-    TaskRequest request(task);
-    if (!requestQueue.execute(&request)) return false;
-
-    stream.writeU8(task->isValid() ? Protocol::RESULT_OK :
-                   Protocol::RESULT_UNKNOWN_DATAREF);
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-bool ServerThread::handleGetMulti()
-{
-    uint8_t result = Protocol::RESULT_OK;
-    GetMultiDataRefRequest* request =
-        new GetMultiDataRefRequest(result, stream);
-    if (result!=Protocol::RESULT_OK || !stream) {
-        delete request;
-        stream.writeU8(result);
-        return stream;
-    }
-
-    bool isOK = requestQueue.execute(request);
-
-    if (isOK) {
-        request->writeResult(stream);
-    }
-
-    delete request;
-
-    return isOK;
-}
-
-//------------------------------------------------------------------------------
-
-bool ServerThread::handleSetMulti()
-{
-    uint8_t result = Protocol::RESULT_OK;
-    SetMultiDataRefRequest* request =
-        new SetMultiDataRefRequest(result, stream, true);
-    if (result!=Protocol::RESULT_OK || !stream) {
-        delete request;
-        stream.writeU8(result);
-        return stream;
-    }
-
-    bool isOK = requestQueue.execute(request);
-
-    if (isOK) {
-        request->writeResult(stream);
-    }
-
-    delete request;
-
-    return isOK;
-}
-
-//------------------------------------------------------------------------------
-
-bool ServerThread::handleRegisterGetMulti()
-{
-    uint8_t result = Protocol::RESULT_OK;
-    GetMultiDataRefRequest* request =
-        new GetMultiDataRefRequest(result, stream);
-    if (result!=Protocol::RESULT_OK || !stream) {
-        delete request;
-        stream.writeU8(result);
-        return stream;
-    }
-
-    size_t id = nextGetMultiRequestID++;
-    getMultiRequests[id] = request;
-
-    stream.writeU8(Protocol::RESULT_OK);
-    stream.writeU32(id);
-
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-bool ServerThread::handleUnregisterGetMulti()
-{
-    uint32_t id = stream.readU32();
-    if (!stream) return false;
-
-    getMultiRequests_t::iterator i = getMultiRequests.find(id);
-    if (i==getMultiRequests.end()) {
-        stream.writeU8(Protocol::RESULT_INVALID_ID);
-    } else {
-        GetMultiDataRefRequest* request = i->second;
-        getMultiRequests.erase(i);
-        delete request;
-        stream.writeU8(Protocol::RESULT_OK);
-    }
-
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-bool ServerThread::handleExecuteGetMulti()
-{
-    uint32_t id = stream.readU32();
-    if (!stream) return false;
-
-    getMultiRequests_t::iterator i = getMultiRequests.find(id);
-    if (i==getMultiRequests.end()) {
-        stream.writeU8(Protocol::RESULT_INVALID_ID);
-    } else {
-        GetMultiDataRefRequest* request = i->second;
-        if (!requestQueue.execute(request)) return false;
-        request->writeResult(stream);
-    }
-
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-bool ServerThread::handleRegisterSetMulti()
-{
-    uint8_t result = Protocol::RESULT_OK;
-    SetMultiDataRefRequest* request =
-        new SetMultiDataRefRequest(result, stream, false);
-    if (result!=Protocol::RESULT_OK || !stream) {
-        delete request;
-        stream.writeU8(result);
-        return stream;
-    }
-
-    size_t id = nextSetMultiRequestID++;
-    setMultiRequests[id] = request;
-
-    stream.writeU8(Protocol::RESULT_OK);
-    stream.writeU32(id);
-
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-bool ServerThread::handleUnregisterSetMulti()
-{
-    uint32_t id = stream.readU32();
-    if (!stream) return false;
-
-    setMultiRequests_t::iterator i = setMultiRequests.find(id);
-    if (i==setMultiRequests.end()) {
-        stream.writeU8(Protocol::RESULT_INVALID_ID);
-    } else {
-        SetMultiDataRefRequest* request = i->second;
-        setMultiRequests.erase(i);
-        delete request;
-        stream.writeU8(Protocol::RESULT_OK);
-    }
-
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-bool ServerThread::handleExecuteSetMulti()
-{
-    uint32_t id = stream.readU32();
-    if (!stream) return false;
-
-    setMultiRequests_t::iterator i = setMultiRequests.find(id);
-    if (i==setMultiRequests.end()) {
-        stream.writeU8(Protocol::RESULT_INVALID_ID);
-    } else {
-        SetMultiDataRefRequest* request = i->second;
-        request->readValues(stream);
-        if (!stream || !requestQueue.execute(request)) return false;
-        request->writeResult(stream);
-    }
-
-    return true;
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/ServerThread.h
===================================================================
--- src/plugin/src/xplra/ServerThread.h	(revision 13)
+++ src/plugin/src/xplra/ServerThread.h	(revision 13)
@@ -0,0 +1,242 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_SERVERTHREAD_H
+#define XPLRA_SERVERTHREAD_H
+//------------------------------------------------------------------------------
+
+#include <hu/varadiistvan/scpl/Thread.h>
+
+#include <hu/varadiistvan/scpl/io/Waiter.h>
+#include <hu/varadiistvan/scpl/io/BufferedStream.h>
+#include <hu/varadiistvan/scpl/io/DataStream.h>
+#include <hu/varadiistvan/scpl/io/LocalAcceptor.h>
+
+#include <hu/varadiistvan/scpl/Mutex.h>
+
+#include <set>
+#include <map>
+
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+class RequestQueue;
+
+class GetMultiDataRefRequest;
+class SetMultiDataRefRequest;
+
+//------------------------------------------------------------------------------
+
+/**
+ * A thread serving a client.
+ */
+class ServerThread : public hu::varadiistvan::scpl::Thread
+{
+private:
+    /**
+     * Type for the set of server thread instances.
+     */
+    typedef std::set<ServerThread*> instances_t;
+
+    /**
+     * Type for the registered multiple-data query requests.
+     */
+    typedef std::map<size_t, GetMultiDataRefRequest*> getMultiRequests_t;
+
+    /**
+     * Type for the registered multiple-data update requests.
+     */
+    typedef std::map<size_t, SetMultiDataRefRequest*> setMultiRequests_t;
+
+    /**
+     * A mutex to protect the collection of server threads.
+     */
+    static hu::varadiistvan::scpl::Mutex instancesMutex;
+
+    /**
+     * The instances of this class.
+     */
+    static instances_t instances;
+
+public:
+    /**
+     * Call quit() an all threads.
+     */
+    static void quitAll();
+
+private:
+    /**
+     * The request queue to use.
+     */
+    RequestQueue& requestQueue;
+
+    /**
+     * Our waiter.
+     */
+    hu::varadiistvan::scpl::io::Waiter waiter;
+
+    /**
+     * The buffered stream to use for communication at the low-level.
+     */
+    hu::varadiistvan::scpl::io::BufferedStream* bufferedStream;
+
+    /**
+     * The data stream being used for communication.
+     */
+    hu::varadiistvan::scpl::io::DataStream stream;
+
+    /**
+     * The ID of the next multiple-data query request.
+     */
+    size_t nextGetMultiRequestID;
+
+    /**
+     * The registered multiple-data query requests.
+     */
+    getMultiRequests_t getMultiRequests;
+
+    /**
+     * The ID of the next multiple-data update request.
+     */
+    size_t nextSetMultiRequestID;
+
+    /**
+     * The registered multiple-data query requests.
+     */
+    setMultiRequests_t setMultiRequests;
+
+public:
+    /**
+     * Construct the thread by using a LocalSocket returned by the
+     * given acceptor.
+     */
+    ServerThread(RequestQueue& requestQueue,
+                 hu::varadiistvan::scpl::io::LocalAcceptor& acceptor);
+
+    /**
+     * Destroy the thread.
+     */
+    virtual ~ServerThread();
+
+    /**
+     * Quit the thread. It interrupts the blocking stream.
+     */
+    void quit();
+
+    /**
+     * Perform the thread's operation.
+     */
+    virtual void run();
+
+private:
+    /**
+     * Handle the COMMAND_GET_SINGLE command
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleGetSingle();
+
+    /**
+     * Handle the COMMAND_SET_SINGLE command
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleSetSingle();
+
+    /**
+     * Handle the COMMAND_GET_MULTI command
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleGetMulti();
+
+    /**
+     * Handle the COMMAND_SET_MULTI command
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleSetMulti();
+
+    /**
+     * Handle the COMMAND_REGISTER_GET_MULTI command
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleRegisterGetMulti();
+
+    /**
+     * Handle the COMMAND_UNREGISTER_GET_MULTI command
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleUnregisterGetMulti();
+
+    /**
+     * Handle the COMMAND_EXECUTE_GET_MULTI command
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleExecuteGetMulti();
+
+    /**
+     * Handle the COMMAND_REGISTER_SET_MULTI command
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleRegisterSetMulti();
+
+    /**
+     * Handle the COMMAND_UNREGISTER_SET_MULTI command
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleUnregisterSetMulti();
+
+    /**
+     * Handle the COMMAND_EXECUTE_SET_MULTI command
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleExecuteSetMulti();
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_SERVERTHREAD_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/ServerThread.h
===================================================================
--- src/plugin/src/xplra/ServerThread.h	(revision 13)
+++ 	(revision )
@@ -1,242 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_SERVERTHREAD_H
-#define XPLRA_SERVERTHREAD_H
-//------------------------------------------------------------------------------
-
-#include <hu/varadiistvan/scpl/Thread.h>
-
-#include <hu/varadiistvan/scpl/io/Waiter.h>
-#include <hu/varadiistvan/scpl/io/BufferedStream.h>
-#include <hu/varadiistvan/scpl/io/DataStream.h>
-#include <hu/varadiistvan/scpl/io/LocalAcceptor.h>
-
-#include <hu/varadiistvan/scpl/Mutex.h>
-
-#include <set>
-#include <map>
-
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-class RequestQueue;
-
-class GetMultiDataRefRequest;
-class SetMultiDataRefRequest;
-
-//------------------------------------------------------------------------------
-
-/**
- * A thread serving a client.
- */
-class ServerThread : public hu::varadiistvan::scpl::Thread
-{
-private:
-    /**
-     * Type for the set of server thread instances.
-     */
-    typedef std::set<ServerThread*> instances_t;
-
-    /**
-     * Type for the registered multiple-data query requests.
-     */
-    typedef std::map<size_t, GetMultiDataRefRequest*> getMultiRequests_t;
-
-    /**
-     * Type for the registered multiple-data update requests.
-     */
-    typedef std::map<size_t, SetMultiDataRefRequest*> setMultiRequests_t;
-
-    /**
-     * A mutex to protect the collection of server threads.
-     */
-    static hu::varadiistvan::scpl::Mutex instancesMutex;
-
-    /**
-     * The instances of this class.
-     */
-    static instances_t instances;
-
-public:
-    /**
-     * Call quit() an all threads.
-     */
-    static void quitAll();
-
-private:
-    /**
-     * The request queue to use.
-     */
-    RequestQueue& requestQueue;
-
-    /**
-     * Our waiter.
-     */
-    hu::varadiistvan::scpl::io::Waiter waiter;
-
-    /**
-     * The buffered stream to use for communication at the low-level.
-     */
-    hu::varadiistvan::scpl::io::BufferedStream* bufferedStream;
-
-    /**
-     * The data stream being used for communication.
-     */
-    hu::varadiistvan::scpl::io::DataStream stream;
-
-    /**
-     * The ID of the next multiple-data query request.
-     */
-    size_t nextGetMultiRequestID;
-
-    /**
-     * The registered multiple-data query requests.
-     */
-    getMultiRequests_t getMultiRequests;
-
-    /**
-     * The ID of the next multiple-data update request.
-     */
-    size_t nextSetMultiRequestID;
-
-    /**
-     * The registered multiple-data query requests.
-     */
-    setMultiRequests_t setMultiRequests;
-
-public:
-    /**
-     * Construct the thread by using a LocalSocket returned by the
-     * given acceptor.
-     */
-    ServerThread(RequestQueue& requestQueue,
-                 hu::varadiistvan::scpl::io::LocalAcceptor& acceptor);
-
-    /**
-     * Destroy the thread.
-     */
-    virtual ~ServerThread();
-
-    /**
-     * Quit the thread. It interrupts the blocking stream.
-     */
-    void quit();
-
-    /**
-     * Perform the thread's operation.
-     */
-    virtual void run();
-
-private:
-    /**
-     * Handle the COMMAND_GET_SINGLE command
-     *
-     * @return true, if we can continue, false if the thread should quit
-     */
-    bool handleGetSingle();
-
-    /**
-     * Handle the COMMAND_SET_SINGLE command
-     *
-     * @return true, if we can continue, false if the thread should quit
-     */
-    bool handleSetSingle();
-
-    /**
-     * Handle the COMMAND_GET_MULTI command
-     *
-     * @return true, if we can continue, false if the thread should quit
-     */
-    bool handleGetMulti();
-
-    /**
-     * Handle the COMMAND_SET_MULTI command
-     *
-     * @return true, if we can continue, false if the thread should quit
-     */
-    bool handleSetMulti();
-
-    /**
-     * Handle the COMMAND_REGISTER_GET_MULTI command
-     *
-     * @return true, if we can continue, false if the thread should quit
-     */
-    bool handleRegisterGetMulti();
-
-    /**
-     * Handle the COMMAND_UNREGISTER_GET_MULTI command
-     *
-     * @return true, if we can continue, false if the thread should quit
-     */
-    bool handleUnregisterGetMulti();
-
-    /**
-     * Handle the COMMAND_EXECUTE_GET_MULTI command
-     *
-     * @return true, if we can continue, false if the thread should quit
-     */
-    bool handleExecuteGetMulti();
-
-    /**
-     * Handle the COMMAND_REGISTER_SET_MULTI command
-     *
-     * @return true, if we can continue, false if the thread should quit
-     */
-    bool handleRegisterSetMulti();
-
-    /**
-     * Handle the COMMAND_UNREGISTER_SET_MULTI command
-     *
-     * @return true, if we can continue, false if the thread should quit
-     */
-    bool handleUnregisterSetMulti();
-
-    /**
-     * Handle the COMMAND_EXECUTE_SET_MULTI command
-     *
-     * @return true, if we can continue, false if the thread should quit
-     */
-    bool handleExecuteSetMulti();
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_SERVERTHREAD_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/SetDataRefTask.cc
===================================================================
--- src/plugin/src/xplra/SetDataRefTask.cc	(revision 13)
+++ src/plugin/src/xplra/SetDataRefTask.cc	(revision 13)
@@ -0,0 +1,122 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "SetDataRefTask.h"
+
+#include "Protocol.h"
+
+//------------------------------------------------------------------------------
+
+using xplra::SetDataRefTask;
+using xplra::SetIntDataRefTask;
+using xplra::SetFloatDataRefTask;
+using xplra::SetDoubleDataRefTask;
+
+using hu::varadiistvan::scpl::io::DataStream;
+
+using std::string;
+
+//------------------------------------------------------------------------------
+
+SetDataRefTask* SetDataRefTask::create(uint8_t& result, DataStream& stream)
+{
+    result = Protocol::RESULT_OK;
+
+    string name = stream.readString();
+    uint8_t type = stream.readU8();
+    if (!stream) return 0;
+
+    if (type==Protocol::TYPE_INT) {
+        return new SetIntDataRefTask(name);
+    } else if (type==Protocol::TYPE_FLOAT) {
+        return new SetFloatDataRefTask(name);
+    } else if (type==Protocol::TYPE_DOUBLE) {
+        return new SetDoubleDataRefTask(name);
+    } else if (type==Protocol::TYPE_FLOAT_ARRAY ||
+               type==Protocol::TYPE_INT_ARRAY ||
+               type==Protocol::TYPE_BYTE_ARRAY)
+    {
+        int length = stream.readS32();
+        int offset = stream.readS32();
+        if (!stream) return 0;
+        if (length<=0 || length>Protocol::MAX_LENGTH) {
+            result = Protocol::RESULT_INVALID_LENGTH;
+            return 0;
+        }
+        if (offset<0) {
+            result = Protocol::RESULT_INVALID_OFFSET;
+            return 0;
+        }
+
+        if (type==Protocol::TYPE_INT_ARRAY) {
+            return new SetIntArrayDataRefTask(name, length, offset);
+        } else if (type==Protocol::TYPE_FLOAT_ARRAY) {
+            return new SetFloatArrayDataRefTask(name, length, offset);
+        } else {
+            return new SetByteArrayDataRefTask(name, length, offset);
+        }
+    } else {
+        result = Protocol::RESULT_INVALID_TYPE;
+    }
+
+    return 0;
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+void SetIntDataRefTask::readValue(DataStream& stream)
+{
+    value = stream.readS32();
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+void SetFloatDataRefTask::readValue(DataStream& stream)
+{
+    value = stream.readFloat();
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+void SetDoubleDataRefTask::readValue(DataStream& stream)
+{
+    value = stream.readDouble();
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/SetDataRefTask.cc
===================================================================
--- src/plugin/src/xplra/SetDataRefTask.cc	(revision 13)
+++ 	(revision )
@@ -1,122 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "SetDataRefTask.h"
-
-#include "Protocol.h"
-
-//------------------------------------------------------------------------------
-
-using xplra::SetDataRefTask;
-using xplra::SetIntDataRefTask;
-using xplra::SetFloatDataRefTask;
-using xplra::SetDoubleDataRefTask;
-
-using hu::varadiistvan::scpl::io::DataStream;
-
-using std::string;
-
-//------------------------------------------------------------------------------
-
-SetDataRefTask* SetDataRefTask::create(uint8_t& result, DataStream& stream)
-{
-    result = Protocol::RESULT_OK;
-
-    string name = stream.readString();
-    uint8_t type = stream.readU8();
-    if (!stream) return 0;
-
-    if (type==Protocol::TYPE_INT) {
-        return new SetIntDataRefTask(name);
-    } else if (type==Protocol::TYPE_FLOAT) {
-        return new SetFloatDataRefTask(name);
-    } else if (type==Protocol::TYPE_DOUBLE) {
-        return new SetDoubleDataRefTask(name);
-    } else if (type==Protocol::TYPE_FLOAT_ARRAY ||
-               type==Protocol::TYPE_INT_ARRAY ||
-               type==Protocol::TYPE_BYTE_ARRAY)
-    {
-        int length = stream.readS32();
-        int offset = stream.readS32();
-        if (!stream) return 0;
-        if (length<=0 || length>Protocol::MAX_LENGTH) {
-            result = Protocol::RESULT_INVALID_LENGTH;
-            return 0;
-        }
-        if (offset<0) {
-            result = Protocol::RESULT_INVALID_OFFSET;
-            return 0;
-        }
-
-        if (type==Protocol::TYPE_INT_ARRAY) {
-            return new SetIntArrayDataRefTask(name, length, offset);
-        } else if (type==Protocol::TYPE_FLOAT_ARRAY) {
-            return new SetFloatArrayDataRefTask(name, length, offset);
-        } else {
-            return new SetByteArrayDataRefTask(name, length, offset);
-        }
-    } else {
-        result = Protocol::RESULT_INVALID_TYPE;
-    }
-
-    return 0;
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-void SetIntDataRefTask::readValue(DataStream& stream)
-{
-    value = stream.readS32();
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-void SetFloatDataRefTask::readValue(DataStream& stream)
-{
-    value = stream.readFloat();
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-void SetDoubleDataRefTask::readValue(DataStream& stream)
-{
-    value = stream.readDouble();
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/SetDataRefTask.h
===================================================================
--- src/plugin/src/xplra/SetDataRefTask.h	(revision 13)
+++ src/plugin/src/xplra/SetDataRefTask.h	(revision 13)
@@ -0,0 +1,615 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_SETDATAREFTASK_H
+#define XPLRA_SETDATAREFTASK_H
+//------------------------------------------------------------------------------
+
+#include "DataRefTask.h"
+
+#include <hu/varadiistvan/scpl/io/DataStream.h>
+
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for dataref tasks that set the value of some data
+ * referenced by a dataref.
+ *
+ * Since XPLM provides no feedback on whether the setting is
+ * successful, we detect only if the dataref is valid or not. So the
+ * isValid() function provides the only feedback if the task executed
+ * successfully or not. (We could use XPLMCanWriteDataRef, but for
+ * efficiency reasons we refrain from it. A separate task may be
+ * created for this purpose.)
+ */
+class SetDataRefTask : public DataRefTask
+{
+public:
+    /**
+     * Read a dataref setting specification and create the appropriate
+     * SetDataRefTask instance.
+     *
+     * @param result will contain the result of the operation. It
+     * signifies an error only, if some wrong data is read. If the
+     * stream fails, it will indicate RESULT_OK.
+     *
+     * @return the new instance or 0 on error.
+     */
+    static SetDataRefTask* create(uint8_t& result, hu::varadiistvan::scpl::io::DataStream& stream);
+
+    /**
+     * Construct the task for the dataref with the given name.
+     */
+    SetDataRefTask(const std::string& name);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    SetDataRefTask(XPLMDataRef dataRef);
+
+    /**
+     * Read and set the value to update from the given stream
+     */
+    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream) = 0;
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for dataref setting tasks that set a single scalar
+ * value.
+ *
+ * ConcreteClass is the actual child class. It should have a function
+ * name setData() which performs the actual setting.
+ */
+template <typename T, class ConcreteClass>
+class SetScalarDataRefTask : public SetDataRefTask
+{
+protected:
+    /**
+     * The value to set.
+     */
+    T value;
+
+public:
+    /**
+     * Construct the task for setting the data referenced by the
+     * dataref with the given name.
+     */
+    SetScalarDataRefTask(const std::string& name);
+
+    /**
+     * Construct the task for setting the data referenced by the given
+     * dataref.
+     */
+    SetScalarDataRefTask(XPLMDataRef dataRef);
+
+protected:
+    /**
+     * Perform the actual operation.
+     */
+    virtual void process();
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * Task to set the value of an integer data.
+ */
+class SetIntDataRefTask :
+        public SetScalarDataRefTask<int, SetIntDataRefTask>
+{
+public:
+    /**
+     * Set the given dataref's value to the given value.
+     */
+    static void setData(XPLMDataRef dataRef, int value);
+
+    /**
+     * Construct the task for the dataref with the given name.
+     */
+    SetIntDataRefTask(const std::string& name);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    SetIntDataRefTask(XPLMDataRef dataRef);
+
+    /**
+     * Read and set the value to update from the given stream
+     */
+    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream);
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * Task to set the value of a single-precision floating point data.
+ */
+class SetFloatDataRefTask :
+        public SetScalarDataRefTask<float, SetFloatDataRefTask>
+{
+public:
+    /**
+     * Set the given dataref's value to the given value.
+     */
+    static void setData(XPLMDataRef dataRef, float value);
+
+    /**
+     * Construct the task for the dataref with the given name.
+     */
+    SetFloatDataRefTask(const std::string& name);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    SetFloatDataRefTask(XPLMDataRef dataRef);
+
+    /**
+     * Read and set the value to update from the given stream
+     */
+    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream);
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * Task to set the value of a double-precision floating point data.
+ */
+class SetDoubleDataRefTask :
+        public SetScalarDataRefTask<double, SetDoubleDataRefTask>
+{
+public:
+    /**
+     * Set the given dataref's value to the given value.
+     */
+    static void setData(XPLMDataRef dataRef, double value);
+
+    /**
+     * Construct the task for the dataref with the given name.
+     */
+    SetDoubleDataRefTask(const std::string& name);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    SetDoubleDataRefTask(XPLMDataRef dataRef);
+
+    /**
+     * Read and set the value to update from the given stream
+     */
+    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream);
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * Base class for dataref setting tasks that set the values of an
+ * array.
+ *
+ * ConcreteClass is the actual child class. It should have a function
+ * name setData() which performs the actual setting.
+ */
+template <typename T, class ConcreteClass>
+class SetArrayDataRefTask : public SetDataRefTask
+{
+private:
+    /**
+     * The number of data items in the value.
+     */
+    int count;
+
+    /**
+     * The offset starting with which the data should be set.
+     */
+    int offset;
+
+    /**
+     * The value to set.
+     */
+    T* value;
+
+public:
+    /**
+     * Construct the data setting task for the dataref with the given
+     * name.
+     *
+     * The value array will be allocated, but not filled with
+     * data. Thus count should be positive!
+     */
+    SetArrayDataRefTask(const std::string& name, int count, int offset = 0);
+
+    /**
+     * Construct the data setting task for the given dataref.
+     *
+     * The value array will be allocated, but not filled with
+     * data. Thus count should be positive!
+     */
+    SetArrayDataRefTask(XPLMDataRef dataRef, int count, int offset = 0);
+
+    /**
+     * Destroy the task.
+     */
+    virtual ~SetArrayDataRefTask();
+
+    /**
+     * Read and set the value to update from the given stream
+     */
+    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream);
+
+protected:
+    /**
+     * Perform the actual operation.
+     */
+    virtual void process();
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * A dataref setting task which sets an array of integers.
+ */
+class SetIntArrayDataRefTask :
+    public SetArrayDataRefTask<int, SetIntArrayDataRefTask>
+{
+public:
+    /**
+     * Perform the actual setting.
+     */
+    static void setData(XPLMDataRef dataRef, int* value, int count, int offset);
+
+    /**
+     * Construct the task for the dataref with the given name.
+     */
+    SetIntArrayDataRefTask(const std::string& name, int count, int offset = 0);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    SetIntArrayDataRefTask(XPLMDataRef dataRef, int count, int offset = 0);
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * A dataref setting task which sets an array of single-precision
+ * floating-point values.
+ */
+class SetFloatArrayDataRefTask :
+    public SetArrayDataRefTask<float, SetFloatArrayDataRefTask>
+{
+public:
+    /**
+     * Perform the actual setting.
+     */
+    static void setData(XPLMDataRef dataRef, float* value, int count, int offset);
+
+    /**
+     * Construct the task for the dataref with the given name.
+     */
+    SetFloatArrayDataRefTask(const std::string& name, int count, int offset = 0);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    SetFloatArrayDataRefTask(XPLMDataRef dataRef, int count, int offset = 0);
+};
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+/**
+ * A dataref setting task which sets an array of bytes.
+ */
+class SetByteArrayDataRefTask :
+    public SetArrayDataRefTask<unsigned char, SetByteArrayDataRefTask>
+{
+public:
+    /**
+     * Perform the actual setting.
+     */
+    static void setData(XPLMDataRef dataRef, unsigned char* value,
+                        int count, int offset);
+
+    /**
+     * Construct the task for the dataref with the given name.
+     */
+    SetByteArrayDataRefTask(const std::string& name, int count, int offset = 0);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    SetByteArrayDataRefTask(XPLMDataRef dataRef, int count, int offset = 0);
+};
+
+//------------------------------------------------------------------------------
+// Template definitions
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline SetScalarDataRefTask<T, ConcreteClass>::
+SetScalarDataRefTask(const std::string& name) :
+    SetDataRefTask(name)
+{
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline SetScalarDataRefTask<T, ConcreteClass>::
+SetScalarDataRefTask(XPLMDataRef dataRef) :
+    SetDataRefTask(dataRef)
+{
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+void SetScalarDataRefTask<T, ConcreteClass>::process()
+{
+    ConcreteClass::setData(getDataRef(), value);
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline SetArrayDataRefTask<T, ConcreteClass>::
+SetArrayDataRefTask(const std::string& name, int count, int offset) :
+    SetDataRefTask(name),
+    count(count),
+    offset(offset),
+    value(new T[count])
+{
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline SetArrayDataRefTask<T, ConcreteClass>::
+SetArrayDataRefTask(XPLMDataRef dataRef, int count, int offset) :
+    SetDataRefTask(dataRef),
+    count(count),
+    offset(offset),
+    value(new T[count])
+{
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline SetArrayDataRefTask<T, ConcreteClass>::~SetArrayDataRefTask()
+{
+    delete [] value;
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+void SetArrayDataRefTask<T, ConcreteClass>::
+readValue(hu::varadiistvan::scpl::io::DataStream& stream)
+{
+    stream.read(value, count * sizeof(T));
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+void SetArrayDataRefTask<T, ConcreteClass>::process()
+{
+    ConcreteClass::setData(getDataRef(), value, count, offset);
+}
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline SetDataRefTask::SetDataRefTask(const std::string& name) :
+    DataRefTask(name)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline SetDataRefTask::SetDataRefTask(XPLMDataRef dataRef) :
+    DataRefTask(dataRef)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline void SetIntDataRefTask::setData(XPLMDataRef dataRef, int value)
+{
+    XPLMSetDatai(dataRef, value);
+}
+
+//------------------------------------------------------------------------------
+
+inline SetIntDataRefTask::SetIntDataRefTask(const std::string& name) :
+    SetScalarDataRefTask<int, SetIntDataRefTask>(name)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline SetIntDataRefTask::SetIntDataRefTask(XPLMDataRef dataRef) :
+    SetScalarDataRefTask<int, SetIntDataRefTask>(dataRef)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline void SetFloatDataRefTask::setData(XPLMDataRef dataRef, float value)
+{
+    XPLMSetDatai(dataRef, value);
+}
+
+//------------------------------------------------------------------------------
+
+inline SetFloatDataRefTask::SetFloatDataRefTask(const std::string& name) :
+    SetScalarDataRefTask<float, SetFloatDataRefTask>(name)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline SetFloatDataRefTask::SetFloatDataRefTask(XPLMDataRef dataRef) :
+    SetScalarDataRefTask<float, SetFloatDataRefTask>(dataRef)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline void SetDoubleDataRefTask::setData(XPLMDataRef dataRef, double value)
+{
+    XPLMSetDatai(dataRef, value);
+}
+
+//------------------------------------------------------------------------------
+
+inline SetDoubleDataRefTask::SetDoubleDataRefTask(const std::string& name) :
+    SetScalarDataRefTask<double, SetDoubleDataRefTask>(name)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline SetDoubleDataRefTask::SetDoubleDataRefTask(XPLMDataRef dataRef) :
+    SetScalarDataRefTask<double, SetDoubleDataRefTask>(dataRef)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline void SetIntArrayDataRefTask::setData(XPLMDataRef dataRef, int* value,
+                                            int count, int offset)
+{
+    XPLMSetDatavi(dataRef, value, offset, count);
+}
+
+//------------------------------------------------------------------------------
+
+inline SetIntArrayDataRefTask::SetIntArrayDataRefTask(const std::string& name,
+                                                      int count, int offset) :
+    SetArrayDataRefTask<int, SetIntArrayDataRefTask>(name, count, offset)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline SetIntArrayDataRefTask::SetIntArrayDataRefTask(XPLMDataRef dataRef,
+                                                      int count, int offset) :
+    SetArrayDataRefTask<int, SetIntArrayDataRefTask>(dataRef, count, offset)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline void SetFloatArrayDataRefTask::setData(XPLMDataRef dataRef,
+                                              float* value,
+                                              int count, int offset)
+{
+    XPLMSetDatavf(dataRef, value, offset, count);
+}
+
+//------------------------------------------------------------------------------
+
+inline
+SetFloatArrayDataRefTask::SetFloatArrayDataRefTask(const std::string& name,
+                                                   int count, int offset) :
+    SetArrayDataRefTask<float, SetFloatArrayDataRefTask>(name, count, offset)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline
+SetFloatArrayDataRefTask::SetFloatArrayDataRefTask(XPLMDataRef dataRef,
+                                                   int count, int offset) :
+    SetArrayDataRefTask<float, SetFloatArrayDataRefTask>(dataRef, count, offset)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline void SetByteArrayDataRefTask::setData(XPLMDataRef dataRef,
+                                             unsigned char* value,
+                                             int count, int offset)
+{
+    XPLMSetDatab(dataRef, value, offset, count);
+}
+
+//------------------------------------------------------------------------------
+
+inline
+SetByteArrayDataRefTask::SetByteArrayDataRefTask(const std::string& name,
+                                                 int count, int offset) :
+    SetArrayDataRefTask<unsigned char, SetByteArrayDataRefTask>(name,
+                                                                count, offset)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline
+SetByteArrayDataRefTask::SetByteArrayDataRefTask(XPLMDataRef dataRef,
+                                                 int count, int offset) :
+    SetArrayDataRefTask<unsigned char, SetByteArrayDataRefTask>(dataRef,
+                                                                count, offset)
+{
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_SETDATAREFTASK_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/SetDataRefTask.h
===================================================================
--- src/plugin/src/xplra/SetDataRefTask.h	(revision 13)
+++ 	(revision )
@@ -1,615 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_SETDATAREFTASK_H
-#define XPLRA_SETDATAREFTASK_H
-//------------------------------------------------------------------------------
-
-#include "DataRefTask.h"
-
-#include <hu/varadiistvan/scpl/io/DataStream.h>
-
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-/**
- * Base class for dataref tasks that set the value of some data
- * referenced by a dataref.
- *
- * Since XPLM provides no feedback on whether the setting is
- * successful, we detect only if the dataref is valid or not. So the
- * isValid() function provides the only feedback if the task executed
- * successfully or not. (We could use XPLMCanWriteDataRef, but for
- * efficiency reasons we refrain from it. A separate task may be
- * created for this purpose.)
- */
-class SetDataRefTask : public DataRefTask
-{
-public:
-    /**
-     * Read a dataref setting specification and create the appropriate
-     * SetDataRefTask instance.
-     *
-     * @param result will contain the result of the operation. It
-     * signifies an error only, if some wrong data is read. If the
-     * stream fails, it will indicate RESULT_OK.
-     *
-     * @return the new instance or 0 on error.
-     */
-    static SetDataRefTask* create(uint8_t& result, hu::varadiistvan::scpl::io::DataStream& stream);
-
-    /**
-     * Construct the task for the dataref with the given name.
-     */
-    SetDataRefTask(const std::string& name);
-
-    /**
-     * Construct the task for the given dataref.
-     */
-    SetDataRefTask(XPLMDataRef dataRef);
-
-    /**
-     * Read and set the value to update from the given stream
-     */
-    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream) = 0;
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * Base class for dataref setting tasks that set a single scalar
- * value.
- *
- * ConcreteClass is the actual child class. It should have a function
- * name setData() which performs the actual setting.
- */
-template <typename T, class ConcreteClass>
-class SetScalarDataRefTask : public SetDataRefTask
-{
-protected:
-    /**
-     * The value to set.
-     */
-    T value;
-
-public:
-    /**
-     * Construct the task for setting the data referenced by the
-     * dataref with the given name.
-     */
-    SetScalarDataRefTask(const std::string& name);
-
-    /**
-     * Construct the task for setting the data referenced by the given
-     * dataref.
-     */
-    SetScalarDataRefTask(XPLMDataRef dataRef);
-
-protected:
-    /**
-     * Perform the actual operation.
-     */
-    virtual void process();
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * Task to set the value of an integer data.
- */
-class SetIntDataRefTask :
-        public SetScalarDataRefTask<int, SetIntDataRefTask>
-{
-public:
-    /**
-     * Set the given dataref's value to the given value.
-     */
-    static void setData(XPLMDataRef dataRef, int value);
-
-    /**
-     * Construct the task for the dataref with the given name.
-     */
-    SetIntDataRefTask(const std::string& name);
-
-    /**
-     * Construct the task for the given dataref.
-     */
-    SetIntDataRefTask(XPLMDataRef dataRef);
-
-    /**
-     * Read and set the value to update from the given stream
-     */
-    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream);
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * Task to set the value of a single-precision floating point data.
- */
-class SetFloatDataRefTask :
-        public SetScalarDataRefTask<float, SetFloatDataRefTask>
-{
-public:
-    /**
-     * Set the given dataref's value to the given value.
-     */
-    static void setData(XPLMDataRef dataRef, float value);
-
-    /**
-     * Construct the task for the dataref with the given name.
-     */
-    SetFloatDataRefTask(const std::string& name);
-
-    /**
-     * Construct the task for the given dataref.
-     */
-    SetFloatDataRefTask(XPLMDataRef dataRef);
-
-    /**
-     * Read and set the value to update from the given stream
-     */
-    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream);
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * Task to set the value of a double-precision floating point data.
- */
-class SetDoubleDataRefTask :
-        public SetScalarDataRefTask<double, SetDoubleDataRefTask>
-{
-public:
-    /**
-     * Set the given dataref's value to the given value.
-     */
-    static void setData(XPLMDataRef dataRef, double value);
-
-    /**
-     * Construct the task for the dataref with the given name.
-     */
-    SetDoubleDataRefTask(const std::string& name);
-
-    /**
-     * Construct the task for the given dataref.
-     */
-    SetDoubleDataRefTask(XPLMDataRef dataRef);
-
-    /**
-     * Read and set the value to update from the given stream
-     */
-    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream);
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * Base class for dataref setting tasks that set the values of an
- * array.
- *
- * ConcreteClass is the actual child class. It should have a function
- * name setData() which performs the actual setting.
- */
-template <typename T, class ConcreteClass>
-class SetArrayDataRefTask : public SetDataRefTask
-{
-private:
-    /**
-     * The number of data items in the value.
-     */
-    int count;
-
-    /**
-     * The offset starting with which the data should be set.
-     */
-    int offset;
-
-    /**
-     * The value to set.
-     */
-    T* value;
-
-public:
-    /**
-     * Construct the data setting task for the dataref with the given
-     * name.
-     *
-     * The value array will be allocated, but not filled with
-     * data. Thus count should be positive!
-     */
-    SetArrayDataRefTask(const std::string& name, int count, int offset = 0);
-
-    /**
-     * Construct the data setting task for the given dataref.
-     *
-     * The value array will be allocated, but not filled with
-     * data. Thus count should be positive!
-     */
-    SetArrayDataRefTask(XPLMDataRef dataRef, int count, int offset = 0);
-
-    /**
-     * Destroy the task.
-     */
-    virtual ~SetArrayDataRefTask();
-
-    /**
-     * Read and set the value to update from the given stream
-     */
-    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream);
-
-protected:
-    /**
-     * Perform the actual operation.
-     */
-    virtual void process();
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * A dataref setting task which sets an array of integers.
- */
-class SetIntArrayDataRefTask :
-    public SetArrayDataRefTask<int, SetIntArrayDataRefTask>
-{
-public:
-    /**
-     * Perform the actual setting.
-     */
-    static void setData(XPLMDataRef dataRef, int* value, int count, int offset);
-
-    /**
-     * Construct the task for the dataref with the given name.
-     */
-    SetIntArrayDataRefTask(const std::string& name, int count, int offset = 0);
-
-    /**
-     * Construct the task for the given dataref.
-     */
-    SetIntArrayDataRefTask(XPLMDataRef dataRef, int count, int offset = 0);
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * A dataref setting task which sets an array of single-precision
- * floating-point values.
- */
-class SetFloatArrayDataRefTask :
-    public SetArrayDataRefTask<float, SetFloatArrayDataRefTask>
-{
-public:
-    /**
-     * Perform the actual setting.
-     */
-    static void setData(XPLMDataRef dataRef, float* value, int count, int offset);
-
-    /**
-     * Construct the task for the dataref with the given name.
-     */
-    SetFloatArrayDataRefTask(const std::string& name, int count, int offset = 0);
-
-    /**
-     * Construct the task for the given dataref.
-     */
-    SetFloatArrayDataRefTask(XPLMDataRef dataRef, int count, int offset = 0);
-};
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-/**
- * A dataref setting task which sets an array of bytes.
- */
-class SetByteArrayDataRefTask :
-    public SetArrayDataRefTask<unsigned char, SetByteArrayDataRefTask>
-{
-public:
-    /**
-     * Perform the actual setting.
-     */
-    static void setData(XPLMDataRef dataRef, unsigned char* value,
-                        int count, int offset);
-
-    /**
-     * Construct the task for the dataref with the given name.
-     */
-    SetByteArrayDataRefTask(const std::string& name, int count, int offset = 0);
-
-    /**
-     * Construct the task for the given dataref.
-     */
-    SetByteArrayDataRefTask(XPLMDataRef dataRef, int count, int offset = 0);
-};
-
-//------------------------------------------------------------------------------
-// Template definitions
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline SetScalarDataRefTask<T, ConcreteClass>::
-SetScalarDataRefTask(const std::string& name) :
-    SetDataRefTask(name)
-{
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline SetScalarDataRefTask<T, ConcreteClass>::
-SetScalarDataRefTask(XPLMDataRef dataRef) :
-    SetDataRefTask(dataRef)
-{
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-void SetScalarDataRefTask<T, ConcreteClass>::process()
-{
-    ConcreteClass::setData(getDataRef(), value);
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline SetArrayDataRefTask<T, ConcreteClass>::
-SetArrayDataRefTask(const std::string& name, int count, int offset) :
-    SetDataRefTask(name),
-    count(count),
-    offset(offset),
-    value(new T[count])
-{
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline SetArrayDataRefTask<T, ConcreteClass>::
-SetArrayDataRefTask(XPLMDataRef dataRef, int count, int offset) :
-    SetDataRefTask(dataRef),
-    count(count),
-    offset(offset),
-    value(new T[count])
-{
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-inline SetArrayDataRefTask<T, ConcreteClass>::~SetArrayDataRefTask()
-{
-    delete [] value;
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-void SetArrayDataRefTask<T, ConcreteClass>::
-readValue(hu::varadiistvan::scpl::io::DataStream& stream)
-{
-    stream.read(value, count * sizeof(T));
-}
-
-//------------------------------------------------------------------------------
-
-template <typename T, class ConcreteClass>
-void SetArrayDataRefTask<T, ConcreteClass>::process()
-{
-    ConcreteClass::setData(getDataRef(), value, count, offset);
-}
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline SetDataRefTask::SetDataRefTask(const std::string& name) :
-    DataRefTask(name)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline SetDataRefTask::SetDataRefTask(XPLMDataRef dataRef) :
-    DataRefTask(dataRef)
-{
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-inline void SetIntDataRefTask::setData(XPLMDataRef dataRef, int value)
-{
-    XPLMSetDatai(dataRef, value);
-}
-
-//------------------------------------------------------------------------------
-
-inline SetIntDataRefTask::SetIntDataRefTask(const std::string& name) :
-    SetScalarDataRefTask<int, SetIntDataRefTask>(name)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline SetIntDataRefTask::SetIntDataRefTask(XPLMDataRef dataRef) :
-    SetScalarDataRefTask<int, SetIntDataRefTask>(dataRef)
-{
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-inline void SetFloatDataRefTask::setData(XPLMDataRef dataRef, float value)
-{
-    XPLMSetDatai(dataRef, value);
-}
-
-//------------------------------------------------------------------------------
-
-inline SetFloatDataRefTask::SetFloatDataRefTask(const std::string& name) :
-    SetScalarDataRefTask<float, SetFloatDataRefTask>(name)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline SetFloatDataRefTask::SetFloatDataRefTask(XPLMDataRef dataRef) :
-    SetScalarDataRefTask<float, SetFloatDataRefTask>(dataRef)
-{
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-inline void SetDoubleDataRefTask::setData(XPLMDataRef dataRef, double value)
-{
-    XPLMSetDatai(dataRef, value);
-}
-
-//------------------------------------------------------------------------------
-
-inline SetDoubleDataRefTask::SetDoubleDataRefTask(const std::string& name) :
-    SetScalarDataRefTask<double, SetDoubleDataRefTask>(name)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline SetDoubleDataRefTask::SetDoubleDataRefTask(XPLMDataRef dataRef) :
-    SetScalarDataRefTask<double, SetDoubleDataRefTask>(dataRef)
-{
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-inline void SetIntArrayDataRefTask::setData(XPLMDataRef dataRef, int* value,
-                                            int count, int offset)
-{
-    XPLMSetDatavi(dataRef, value, offset, count);
-}
-
-//------------------------------------------------------------------------------
-
-inline SetIntArrayDataRefTask::SetIntArrayDataRefTask(const std::string& name,
-                                                      int count, int offset) :
-    SetArrayDataRefTask<int, SetIntArrayDataRefTask>(name, count, offset)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline SetIntArrayDataRefTask::SetIntArrayDataRefTask(XPLMDataRef dataRef,
-                                                      int count, int offset) :
-    SetArrayDataRefTask<int, SetIntArrayDataRefTask>(dataRef, count, offset)
-{
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-inline void SetFloatArrayDataRefTask::setData(XPLMDataRef dataRef,
-                                              float* value,
-                                              int count, int offset)
-{
-    XPLMSetDatavf(dataRef, value, offset, count);
-}
-
-//------------------------------------------------------------------------------
-
-inline
-SetFloatArrayDataRefTask::SetFloatArrayDataRefTask(const std::string& name,
-                                                   int count, int offset) :
-    SetArrayDataRefTask<float, SetFloatArrayDataRefTask>(name, count, offset)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline
-SetFloatArrayDataRefTask::SetFloatArrayDataRefTask(XPLMDataRef dataRef,
-                                                   int count, int offset) :
-    SetArrayDataRefTask<float, SetFloatArrayDataRefTask>(dataRef, count, offset)
-{
-}
-
-//------------------------------------------------------------------------------
-//------------------------------------------------------------------------------
-
-inline void SetByteArrayDataRefTask::setData(XPLMDataRef dataRef,
-                                             unsigned char* value,
-                                             int count, int offset)
-{
-    XPLMSetDatab(dataRef, value, offset, count);
-}
-
-//------------------------------------------------------------------------------
-
-inline
-SetByteArrayDataRefTask::SetByteArrayDataRefTask(const std::string& name,
-                                                 int count, int offset) :
-    SetArrayDataRefTask<unsigned char, SetByteArrayDataRefTask>(name,
-                                                                count, offset)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline
-SetByteArrayDataRefTask::SetByteArrayDataRefTask(XPLMDataRef dataRef,
-                                                 int count, int offset) :
-    SetArrayDataRefTask<unsigned char, SetByteArrayDataRefTask>(dataRef,
-                                                                count, offset)
-{
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_SETDATAREFTASK_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/SetMultiDataRefRequest.cc
===================================================================
--- src/plugin/src/xplra/SetMultiDataRefRequest.cc	(revision 13)
+++ src/plugin/src/xplra/SetMultiDataRefRequest.cc	(revision 13)
@@ -0,0 +1,102 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "SetMultiDataRefRequest.h"
+
+#include "Protocol.h"
+
+//------------------------------------------------------------------------------
+
+using xplra::SetMultiDataRefRequest;
+
+using hu::varadiistvan::scpl::io::DataStream;
+
+//------------------------------------------------------------------------------
+
+SetMultiDataRefRequest::SetMultiDataRefRequest(uint8_t& result,
+                                               DataStream& stream,
+                                               bool readValues)
+{
+    result = Protocol::RESULT_OK;
+
+    uint32_t numTasks = stream.readU32();
+    if (!stream) return;
+    if (numTasks==0 || numTasks>Protocol::MAX_MULTI_COUNT) {
+        result = Protocol::RESULT_INVALID_COUNT;
+        return;
+    }
+
+    for(size_t i = 0;
+        i<numTasks && result==Protocol::RESULT_OK && stream; ++i) {
+        SetDataRefTask* task = SetDataRefTask::create(result, stream);
+        if (task!=0) {
+            if (readValues) {
+                task->readValue(stream);
+            }
+            addTask(task);
+        }
+    }
+}
+
+//------------------------------------------------------------------------------
+
+void SetMultiDataRefRequest::readValues(DataStream& stream)
+{
+    size_t numTasks = getNumTasks();
+    for(size_t i = 0; i<numTasks && stream; ++i) {
+        SetDataRefTask* task = getTask(i);
+        task->readValue(stream);
+    }
+}
+
+//------------------------------------------------------------------------------
+
+void SetMultiDataRefRequest::writeResult(DataStream& stream) const
+{
+    size_t numTasks = getNumTasks();
+    for(size_t i = 0; i<numTasks; ++i) {
+        SetDataRefTask* task = getTask(i);
+        if (!task->isValid()) {
+            stream.writeU8(Protocol::RESULT_UNKNOWN_DATAREF);
+            stream.writeU32(i);
+            return;
+        }
+    }
+
+    stream.writeU8(Protocol::RESULT_OK);
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/SetMultiDataRefRequest.cc
===================================================================
--- src/plugin/src/xplra/SetMultiDataRefRequest.cc	(revision 13)
+++ 	(revision )
@@ -1,102 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "SetMultiDataRefRequest.h"
-
-#include "Protocol.h"
-
-//------------------------------------------------------------------------------
-
-using xplra::SetMultiDataRefRequest;
-
-using hu::varadiistvan::scpl::io::DataStream;
-
-//------------------------------------------------------------------------------
-
-SetMultiDataRefRequest::SetMultiDataRefRequest(uint8_t& result,
-                                               DataStream& stream,
-                                               bool readValues)
-{
-    result = Protocol::RESULT_OK;
-
-    uint32_t numTasks = stream.readU32();
-    if (!stream) return;
-    if (numTasks==0 || numTasks>Protocol::MAX_MULTI_COUNT) {
-        result = Protocol::RESULT_INVALID_COUNT;
-        return;
-    }
-
-    for(size_t i = 0;
-        i<numTasks && result==Protocol::RESULT_OK && stream; ++i) {
-        SetDataRefTask* task = SetDataRefTask::create(result, stream);
-        if (task!=0) {
-            if (readValues) {
-                task->readValue(stream);
-            }
-            addTask(task);
-        }
-    }
-}
-
-//------------------------------------------------------------------------------
-
-void SetMultiDataRefRequest::readValues(DataStream& stream)
-{
-    size_t numTasks = getNumTasks();
-    for(size_t i = 0; i<numTasks && stream; ++i) {
-        SetDataRefTask* task = getTask(i);
-        task->readValue(stream);
-    }
-}
-
-//------------------------------------------------------------------------------
-
-void SetMultiDataRefRequest::writeResult(DataStream& stream) const
-{
-    size_t numTasks = getNumTasks();
-    for(size_t i = 0; i<numTasks; ++i) {
-        SetDataRefTask* task = getTask(i);
-        if (!task->isValid()) {
-            stream.writeU8(Protocol::RESULT_UNKNOWN_DATAREF);
-            stream.writeU32(i);
-            return;
-        }
-    }
-
-    stream.writeU8(Protocol::RESULT_OK);
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/SetMultiDataRefRequest.h
===================================================================
--- src/plugin/src/xplra/SetMultiDataRefRequest.h	(revision 13)
+++ src/plugin/src/xplra/SetMultiDataRefRequest.h	(revision 13)
@@ -0,0 +1,84 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_SETMULTIDATAREFREQUEST_H
+#define XPLRA_SETMULTIDATAREFREQUEST_H
+//------------------------------------------------------------------------------
+
+#include "MultiTaskRequest.h"
+#include "SetDataRefTask.h"
+
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A request containing several dataref update tasks.
+ */
+class SetMultiDataRefRequest : public MultiTaskRequestTemplate<SetDataRefTask>
+{
+public:
+    /**
+     * Construct the request by reading the task specifications from
+     * the given stream.
+     */
+    SetMultiDataRefRequest(uint8_t& result,
+                           hu::varadiistvan::scpl::io::DataStream& stream,
+                           bool readValues);
+
+    /**
+     * Read the values of all tasks.
+     */
+    void readValues(hu::varadiistvan::scpl::io::DataStream& stream);
+
+    /**
+     * Write the result of an execution.
+     *
+     * If there is at least one invalid dataref, the result will be
+     * RESULT_UNKNOWN_DATAREF followed by a 32-bit unsigned value with
+     * the index of the first unknown dataref.
+     *
+     * Otherwise the result is RESULT_OK.
+     */
+    void writeResult(hu::varadiistvan::scpl::io::DataStream& stream) const;
+};
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_SETMULTIDATAREFREQUEST_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/SetMultiDataRefRequest.h
===================================================================
--- src/plugin/src/xplra/SetMultiDataRefRequest.h	(revision 13)
+++ 	(revision )
@@ -1,84 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_SETMULTIDATAREFREQUEST_H
-#define XPLRA_SETMULTIDATAREFREQUEST_H
-//------------------------------------------------------------------------------
-
-#include "MultiTaskRequest.h"
-#include "SetDataRefTask.h"
-
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-/**
- * A request containing several dataref update tasks.
- */
-class SetMultiDataRefRequest : public MultiTaskRequestTemplate<SetDataRefTask>
-{
-public:
-    /**
-     * Construct the request by reading the task specifications from
-     * the given stream.
-     */
-    SetMultiDataRefRequest(uint8_t& result,
-                           hu::varadiistvan::scpl::io::DataStream& stream,
-                           bool readValues);
-
-    /**
-     * Read the values of all tasks.
-     */
-    void readValues(hu::varadiistvan::scpl::io::DataStream& stream);
-
-    /**
-     * Write the result of an execution.
-     *
-     * If there is at least one invalid dataref, the result will be
-     * RESULT_UNKNOWN_DATAREF followed by a 32-bit unsigned value with
-     * the index of the first unknown dataref.
-     *
-     * Otherwise the result is RESULT_OK.
-     */
-    void writeResult(hu::varadiistvan::scpl::io::DataStream& stream) const;
-};
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_SETMULTIDATAREFREQUEST_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/Task.h
===================================================================
--- src/plugin/src/xplra/Task.h	(revision 13)
+++ src/plugin/src/xplra/Task.h	(revision 13)
@@ -0,0 +1,75 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_TASK_H
+#define XPLRA_TASK_H
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A task is like a request, but it cannot be executed directly by the
+ * flight loop callback. Instead, it defines some simple task, of
+ * which potentially many can be added to a single request.
+ */
+class Task
+{
+public:
+    /**
+     * Virtual destructor.
+     */
+    virtual ~Task();
+
+    /**
+     * Perform the task
+     */
+    virtual void perform() = 0;
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline Task::~Task()
+{
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_TASK_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/Task.h
===================================================================
--- src/plugin/src/xplra/Task.h	(revision 13)
+++ 	(revision )
@@ -1,75 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_TASK_H
-#define XPLRA_TASK_H
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-/**
- * A task is like a request, but it cannot be executed directly by the
- * flight loop callback. Instead, it defines some simple task, of
- * which potentially many can be added to a single request.
- */
-class Task
-{
-public:
-    /**
-     * Virtual destructor.
-     */
-    virtual ~Task();
-
-    /**
-     * Perform the task
-     */
-    virtual void perform() = 0;
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline Task::~Task()
-{
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_TASK_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/TaskRequest.cc
===================================================================
--- src/plugin/src/xplra/TaskRequest.cc	(revision 13)
+++ src/plugin/src/xplra/TaskRequest.cc	(revision 13)
@@ -0,0 +1,50 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "TaskRequest.h"
+
+//------------------------------------------------------------------------------
+
+using xplra::TaskRequest;
+
+//------------------------------------------------------------------------------
+
+void TaskRequest::execute()
+{
+    task->perform();
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/TaskRequest.cc
===================================================================
--- src/plugin/src/xplra/TaskRequest.cc	(revision 13)
+++ 	(revision )
@@ -1,50 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "TaskRequest.h"
-
-//------------------------------------------------------------------------------
-
-using xplra::TaskRequest;
-
-//------------------------------------------------------------------------------
-
-void TaskRequest::execute()
-{
-    task->perform();
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/TaskRequest.h
===================================================================
--- src/plugin/src/xplra/TaskRequest.h	(revision 13)
+++ src/plugin/src/xplra/TaskRequest.h	(revision 13)
@@ -0,0 +1,101 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+#ifndef XPLRA_TASKREQUEST_H
+#define XPLRA_TASKREQUEST_H
+//------------------------------------------------------------------------------
+
+#include "Request.h"
+
+#include "Task.h"
+
+//------------------------------------------------------------------------------
+
+namespace xplra {
+
+//------------------------------------------------------------------------------
+
+/**
+ * A request the performs a task.
+ */
+class TaskRequest : public Request
+{
+private:
+    /**
+     * The task belonging to the request. It is owned by the request,
+     * i.e. deleted when the request is deleted.
+     */
+    Task* task;
+
+public:
+    /**
+     * Construct the request for the given task. The task will become
+     * owned by the request, so it will be deleted when the task is
+     * deleted.
+     */
+    TaskRequest(Task* task);
+
+    /**
+     * Destroy the task request.
+     */
+    virtual ~TaskRequest();
+
+    /**
+     * Execute the request by performing the task.
+     */
+    virtual void execute();
+};
+
+//------------------------------------------------------------------------------
+// Inline definitions
+//------------------------------------------------------------------------------
+
+inline TaskRequest::TaskRequest(Task* task) :
+    task(task)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline TaskRequest::~TaskRequest()
+{
+    delete task;
+}
+
+//------------------------------------------------------------------------------
+
+} /* namespace xplra */
+
+//------------------------------------------------------------------------------
+#endif // XPLRA_TASKREQUEST_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/TaskRequest.h
===================================================================
--- src/plugin/src/xplra/TaskRequest.h	(revision 13)
+++ 	(revision )
@@ -1,101 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-#ifndef XPLRA_TASKREQUEST_H
-#define XPLRA_TASKREQUEST_H
-//------------------------------------------------------------------------------
-
-#include "Request.h"
-
-#include "Task.h"
-
-//------------------------------------------------------------------------------
-
-namespace xplra {
-
-//------------------------------------------------------------------------------
-
-/**
- * A request the performs a task.
- */
-class TaskRequest : public Request
-{
-private:
-    /**
-     * The task belonging to the request. It is owned by the request,
-     * i.e. deleted when the request is deleted.
-     */
-    Task* task;
-
-public:
-    /**
-     * Construct the request for the given task. The task will become
-     * owned by the request, so it will be deleted when the task is
-     * deleted.
-     */
-    TaskRequest(Task* task);
-
-    /**
-     * Destroy the task request.
-     */
-    virtual ~TaskRequest();
-
-    /**
-     * Execute the request by performing the task.
-     */
-    virtual void execute();
-};
-
-//------------------------------------------------------------------------------
-// Inline definitions
-//------------------------------------------------------------------------------
-
-inline TaskRequest::TaskRequest(Task* task) :
-    task(task)
-{
-}
-
-//------------------------------------------------------------------------------
-
-inline TaskRequest::~TaskRequest()
-{
-    delete task;
-}
-
-//------------------------------------------------------------------------------
-
-} /* namespace xplra */
-
-//------------------------------------------------------------------------------
-#endif // XPLRA_TASKREQUEST_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/plugin.cc
===================================================================
--- src/plugin/src/xplra/plugin.cc	(revision 13)
+++ src/plugin/src/xplra/plugin.cc	(revision 13)
@@ -0,0 +1,123 @@
+// Copyright (c) 2013 by István Váradi
+
+// This file is part of XPLRA, a remote-access plugin for X-Plane
+
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// The views and conclusions contained in the software and documentation are those
+// of the authors and should not be interpreted as representing official policies,
+// either expressed or implied, of the FreeBSD Project.
+
+//------------------------------------------------------------------------------
+
+#include "ListenThread.h"
+
+#include <hu/varadiistvan/xplcommon/Util.h>
+#include <hu/varadiistvan/scpl/config.h>
+
+#include <XPLMDefs.h>
+#include <XPLMUtilities.h>
+#include <XPLMProcessing.h>
+
+#include <cstdio>
+#include <cstring>
+#include <cstdarg>
+
+#if TARGET_API_POSIX
+#include <signal.h>
+#endif
+
+//------------------------------------------------------------------------------
+
+using xplra::ListenThread;
+
+using hu::varadiistvan::xplcommon::Util;
+
+//------------------------------------------------------------------------------
+
+/**
+ * The thread to use to listen for incoming connections.
+ */
+static ListenThread* listenThread = 0;
+
+//------------------------------------------------------------------------------
+
+PLUGIN_API int XPluginStart(char* outName, char* outSignature,
+                            char* outDescription)
+{
+    Util::debug("hu.varadiistvan.xplra called\n");
+
+    strcpy(outName, "X-Plane Remote Access");
+    strcpy(outSignature, "hu.varadiistvan.xplra");
+    strcpy(outDescription, "Provides remote access to datarefs");
+
+#if TARGET_API_POSIX
+    signal(SIGPIPE, SIG_IGN);
+#endif
+
+    return 1;
+}
+
+//------------------------------------------------------------------------------
+
+PLUGIN_API void XPluginEnable(void)
+{
+    Util::debug("hu.varadiistvan.xplra.XPluginEnable called\n");
+    // XPLMRegisterFlightLoopCallback(&callback, 5.0, 0);
+    listenThread = new ListenThread();
+    listenThread->start();
+}
+
+//------------------------------------------------------------------------------
+
+PLUGIN_API void XPluginReceiveMessage(XPLMPluginID inFrom, long inMessage,
+                                      void* inParam)
+{
+    Util::debug("hu.varadiistvan.xplra.XPluginReceiveMessage called, inFrom=%d, inMessage=%ld, inParam=%p\n",
+          inFrom, inMessage, inParam);
+}
+
+//------------------------------------------------------------------------------
+
+PLUGIN_API void XPluginDisable(void)
+{
+    Util::debug("hu.varadiistvan.xplra.XPluginDisable called\n");
+    // XPLMUnregisterFlightLoopCallback(&callback, 0);
+    if (listenThread!=0) {
+        listenThread->quit();
+        listenThread = 0;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+PLUGIN_API void XPluginStop(void)
+{
+    Util::debug("hu.varadiistvan.xplra.XPluginStop called\n");
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
Index: src/plugin/src/xplra/plugin.cc
===================================================================
--- src/plugin/src/xplra/plugin.cc	(revision 13)
+++ 	(revision )
@@ -1,123 +1,0 @@
-// Copyright (c) 2013 by István Váradi
-
-// This file is part of XPLRA, a remote-access plugin for X-Plane
-
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-
-// 1. Redistributions of source code must retain the above copyright notice, this
-//    list of conditions and the following disclaimer.
-// 2. Redistributions in binary form must reproduce the above copyright notice,
-//    this list of conditions and the following disclaimer in the documentation
-//    and/or other materials provided with the distribution.
-
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The views and conclusions contained in the software and documentation are those
-// of the authors and should not be interpreted as representing official policies,
-// either expressed or implied, of the FreeBSD Project.
-
-//------------------------------------------------------------------------------
-
-#include "ListenThread.h"
-
-#include <hu/varadiistvan/xplcommon/Util.h>
-#include <hu/varadiistvan/scpl/config.h>
-
-#include <XPLMDefs.h>
-#include <XPLMUtilities.h>
-#include <XPLMProcessing.h>
-
-#include <cstdio>
-#include <cstring>
-#include <cstdarg>
-
-#if TARGET_API_POSIX
-#include <signal.h>
-#endif
-
-//------------------------------------------------------------------------------
-
-using xplra::ListenThread;
-
-using hu::varadiistvan::xplcommon::Util;
-
-//------------------------------------------------------------------------------
-
-/**
- * The thread to use to listen for incoming connections.
- */
-static ListenThread* listenThread = 0;
-
-//------------------------------------------------------------------------------
-
-PLUGIN_API int XPluginStart(char* outName, char* outSignature,
-                            char* outDescription)
-{
-    Util::debug("hu.varadiistvan.xplra called\n");
-
-    strcpy(outName, "X-Plane Remote Access");
-    strcpy(outSignature, "hu.varadiistvan.xplra");
-    strcpy(outDescription, "Provides remote access to datarefs");
-
-#if TARGET_API_POSIX
-    signal(SIGPIPE, SIG_IGN);
-#endif
-
-    return 1;
-}
-
-//------------------------------------------------------------------------------
-
-PLUGIN_API void XPluginEnable(void)
-{
-    Util::debug("hu.varadiistvan.xplra.XPluginEnable called\n");
-    // XPLMRegisterFlightLoopCallback(&callback, 5.0, 0);
-    listenThread = new ListenThread();
-    listenThread->start();
-}
-
-//------------------------------------------------------------------------------
-
-PLUGIN_API void XPluginReceiveMessage(XPLMPluginID inFrom, long inMessage,
-                                      void* inParam)
-{
-    Util::debug("hu.varadiistvan.xplra.XPluginReceiveMessage called, inFrom=%d, inMessage=%ld, inParam=%p\n",
-          inFrom, inMessage, inParam);
-}
-
-//------------------------------------------------------------------------------
-
-PLUGIN_API void XPluginDisable(void)
-{
-    Util::debug("hu.varadiistvan.xplra.XPluginDisable called\n");
-    // XPLMUnregisterFlightLoopCallback(&callback, 0);
-    if (listenThread!=0) {
-        listenThread->quit();
-        listenThread = 0;
-    }
-}
-
-//------------------------------------------------------------------------------
-
-PLUGIN_API void XPluginStop(void)
-{
-    Util::debug("hu.varadiistvan.xplra.XPluginStop called\n");
-}
-
-//------------------------------------------------------------------------------
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 4
-// indent-tabs-mode: nil
-// End:
Index: src/plugin/src/xplra/version.ldscript
===================================================================
--- src/plugin/src/xplra/version.ldscript	(revision 13)
+++ src/plugin/src/xplra/version.ldscript	(revision 13)
@@ -0,0 +1,10 @@
+{
+ global:
+  XPluginStart;
+  XPluginStop;
+  XPluginEnable;
+  XPluginDisable;
+  XPluginReceiveMessage;
+ local:
+   *;
+};
Index: src/plugin/src/xplra/version.ldscript
===================================================================
--- src/plugin/src/xplra/version.ldscript	(revision 13)
+++ 	(revision )
@@ -1,10 +1,0 @@
-{
- global:
-  XPluginStart;
-  XPluginStop;
-  XPluginEnable;
-  XPluginDisable;
-  XPluginReceiveMessage;
- local:
-   *;
-};
