Index: src/xplra/GetDataRefTask.cc
===================================================================
--- src/xplra/GetDataRefTask.cc	(revision 6)
+++ src/xplra/GetDataRefTask.cc	(revision 7)
@@ -69,4 +69,13 @@
         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);
Index: src/xplra/Makefile.am
===================================================================
--- src/xplra/Makefile.am	(revision 6)
+++ src/xplra/Makefile.am	(revision 7)
@@ -30,5 +30,6 @@
 	TaskRequest.cc		\
 	DataRefTask.cc		\
-	GetDataRefTask.cc
+	GetDataRefTask.cc	\
+	SetDataRefTask.cc
 
 libxplra_la_LIBADD=$(LIBXPLCOMMON_LIBS)
@@ -43,3 +44,4 @@
 	TaskRequest.h		\
 	DataRefTask.h		\
-	GetDataRefTask.h
+	GetDataRefTask.h	\
+	SetDataRefTask.h
Index: src/xplra/Protocol.h
===================================================================
--- src/xplra/Protocol.h	(revision 6)
+++ src/xplra/Protocol.h	(revision 7)
@@ -45,4 +45,9 @@
      */
     static const uint8_t COMMAND_GET_SINGLE = 0x01;
+
+    /**
+     * Command: set the value of a single dataref.
+     */
+    static const uint8_t COMMAND_SET_SINGLE = 0x02;
 
     /**
@@ -97,7 +102,22 @@
 
     /**
+     * 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: 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;
 };
 
Index: src/xplra/ServerThread.cc
===================================================================
--- src/xplra/ServerThread.cc	(revision 6)
+++ src/xplra/ServerThread.cc	(revision 7)
@@ -34,4 +34,5 @@
 #include "Protocol.h"
 #include "GetDataRefTask.h"
+#include "SetDataRefTask.h"
 #include "TaskRequest.h"
 
@@ -111,5 +112,7 @@
 
         if (command==Protocol::COMMAND_GET_SINGLE) {
-            if (!handleGetSingle(stream)) break;
+            if (!handleGetSingle()) break;
+        } else if (command==Protocol::COMMAND_SET_SINGLE) {
+            if (!handleSetSingle()) break;
         } else {
             stream.writeU8(Protocol::RESULT_INVALID_COMMAND);
@@ -123,13 +126,12 @@
 //------------------------------------------------------------------------------
 
-bool ServerThread::handleGetSingle(xplcommon::DataStream& stream)
+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(Protocol::RESULT_INVALID_TYPE);
+        stream.writeU8(result);
         return true;
     }
@@ -150,4 +152,25 @@
 //------------------------------------------------------------------------------
 
+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;
+    }
+
+    TaskRequest request(task);
+    if (!requestQueue.execute(&request)) return false;
+
+    stream.writeU8(task->isValid() ? Protocol::RESULT_OK :
+                   Protocol::RESULT_UNKNOWN_DATAREF);
+    return true;
+}
+
+//------------------------------------------------------------------------------
+
 // Local Variables:
 // mode: C++
Index: src/xplra/ServerThread.h
===================================================================
--- src/xplra/ServerThread.h	(revision 6)
+++ src/xplra/ServerThread.h	(revision 7)
@@ -129,5 +129,12 @@
      * @return true, if we can continue, false if the thread should quit
      */
-    bool handleGetSingle(xplcommon::DataStream& stream);
+    bool handleGetSingle();
+
+    /**
+     * Handle the COMMAND_SET_SINGLE command
+     *
+     * @return true, if we can continue, false if the thread should quit
+     */
+    bool handleSetSingle();
 };
 
Index: src/xplra/SetDataRefTask.cc
===================================================================
--- src/xplra/SetDataRefTask.cc	(revision 7)
+++ src/xplra/SetDataRefTask.cc	(revision 7)
@@ -0,0 +1,134 @@
+// 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 xplcommon::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) {
+        int value = stream.readS32();
+        if (stream) return new SetIntDataRefTask(name, value);
+    } else if (type==Protocol::TYPE_FLOAT) {
+        float value = stream.readFloat();
+        if (stream) return new SetFloatDataRefTask(name, value);
+    } else if (type==Protocol::TYPE_DOUBLE) {
+        double value = stream.readDouble();
+        if (stream) return new SetDoubleDataRefTask(name, value);
+    } 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;
+        }
+
+        SetDataRefTask* task = 0;
+        if (type==Protocol::TYPE_INT_ARRAY) {
+            task = new SetIntArrayDataRefTask(name, length, offset);
+        } else if (type==Protocol::TYPE_FLOAT_ARRAY) {
+            task = new SetFloatArrayDataRefTask(name, length, offset);
+        } else {
+            task = new SetByteArrayDataRefTask(name, length, offset);
+        }
+
+        task->readValue(stream);
+
+        if (stream) {
+            return task;
+        } else {
+            delete task;
+        }
+    } 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/xplra/SetDataRefTask.h
===================================================================
--- src/xplra/SetDataRefTask.h	(revision 7)
+++ src/xplra/SetDataRefTask.h	(revision 7)
@@ -0,0 +1,621 @@
+// 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 <xplcommon/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, xplcommon::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(xplcommon::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, T value);
+
+    /**
+     * Construct the task for setting the data referenced by the given
+     * dataref.
+     */
+    SetScalarDataRefTask(XPLMDataRef dataRef, T value);
+
+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, int value);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    SetIntDataRefTask(XPLMDataRef dataRef, int value);
+
+    /**
+     * Read and set the value to update from the given stream
+     */
+    virtual void readValue(xplcommon::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, float value);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    SetFloatDataRefTask(XPLMDataRef dataRef, float value);
+
+    /**
+     * Read and set the value to update from the given stream
+     */
+    virtual void readValue(xplcommon::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, double value);
+
+    /**
+     * Construct the task for the given dataref.
+     */
+    SetDoubleDataRefTask(XPLMDataRef dataRef, double value);
+
+    /**
+     * Read and set the value to update from the given stream
+     */
+    virtual void readValue(xplcommon::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(xplcommon::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, T value) :
+    SetDataRefTask(name),
+    value(value)
+{
+}
+
+//------------------------------------------------------------------------------
+
+template <typename T, class ConcreteClass>
+inline SetScalarDataRefTask<T, ConcreteClass>::
+SetScalarDataRefTask(XPLMDataRef dataRef, T value) :
+    SetDataRefTask(dataRef),
+    value(value)
+{
+}
+
+//------------------------------------------------------------------------------
+
+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(xplcommon::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, int value) :
+    SetScalarDataRefTask<int, SetIntDataRefTask>(name, value)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline SetIntDataRefTask::SetIntDataRefTask(XPLMDataRef dataRef, int value) :
+    SetScalarDataRefTask<int, SetIntDataRefTask>(dataRef, value)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline void SetFloatDataRefTask::setData(XPLMDataRef dataRef, float value)
+{
+    XPLMSetDatai(dataRef, value);
+}
+
+//------------------------------------------------------------------------------
+
+inline SetFloatDataRefTask::SetFloatDataRefTask(const std::string& name,
+                                                float value) :
+    SetScalarDataRefTask<float, SetFloatDataRefTask>(name, value)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline SetFloatDataRefTask::SetFloatDataRefTask(XPLMDataRef dataRef,
+                                                float value) :
+    SetScalarDataRefTask<float, SetFloatDataRefTask>(dataRef, value)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+inline void SetDoubleDataRefTask::setData(XPLMDataRef dataRef, double value)
+{
+    XPLMSetDatai(dataRef, value);
+}
+
+//------------------------------------------------------------------------------
+
+inline SetDoubleDataRefTask::SetDoubleDataRefTask(const std::string& name,
+                                                  double value) :
+    SetScalarDataRefTask<double, SetDoubleDataRefTask>(name, value)
+{
+}
+
+//------------------------------------------------------------------------------
+
+inline SetDoubleDataRefTask::SetDoubleDataRefTask(XPLMDataRef dataRef,
+                                                  double value) :
+    SetScalarDataRefTask<double, SetDoubleDataRefTask>(dataRef, value)
+{
+}
+
+//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
+
+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:
