Index: test/Makefile.am
===================================================================
--- test/Makefile.am	(revision 14)
+++ test/Makefile.am	(revision 19)
@@ -6,5 +6,5 @@
 endif
 
-noinst_PROGRAMS=ctest basictest
+noinst_PROGRAMS=ctest basictest multigettest
 
 ctest_SOURCES=ctest.c
@@ -14,2 +14,4 @@
 
 basictest_SOURCES=basictest.cc
+
+multigettest_SOURCES=multigettest.cc
Index: test/multigettest.cc
===================================================================
--- test/multigettest.cc	(revision 19)
+++ test/multigettest.cc	(revision 19)
@@ -0,0 +1,181 @@
+// 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 <hu/varadiistvan/xplra/XPlane.h>
+#include <hu/varadiistvan/xplra/MultiGetter.h>
+
+#include <hu/varadiistvan/scpl/Thread.h>
+
+#include <cstdio>
+#include <cstring>
+
+//------------------------------------------------------------------------------
+
+using hu::varadiistvan::xplra::XPlane;
+using hu::varadiistvan::xplra::MultiGetter;
+using hu::varadiistvan::xplra::Exception;
+
+using hu::varadiistvan::scpl::Thread;
+
+//------------------------------------------------------------------------------
+
+int main(int argc, char* argv[])
+{
+    bool dontregister = false;
+    for(int i = 1; i<argc; ++i) {
+        if (strcmp(argv[i], "dontregister")) {
+            dontregister = true;
+        }
+    }
+
+    try {
+        XPlane xplane;
+
+        printf("Connecting to X-Plane...\n");
+        xplane.connect();
+        printf("Connected to X-Plane.\n\n");
+
+        MultiGetter getter(xplane);
+
+        const size_t pausedID = getter.addInt("sim/time/paused");
+        const size_t latitudeID = getter.addDouble("sim/flightmodel/position/latitude");
+        const size_t longitudeID = getter.addDouble("sim/flightmodel/position/longitude");
+        const size_t replayID = getter.addInt("sim/operation/prefs/replay_mode");
+        const size_t overspeedID = getter.addInt("sim/flightmodel/failures/over_vne");
+        const size_t stalledID = getter.addInt("sim/flightmodel/failures/stallwarning");
+        const size_t onTheGroundID = getter.addInt("sim/flightmodel/failures/onground_any");
+        const size_t emptyWeightID = getter.addFloat("sim/aircraft/weight/acf_m_empty");
+        const size_t payloadWeightID = getter.addFloat("sim/flightmodel/weight/m_fixed");
+        const size_t grossWeightID = getter.addFloat("sim/flightmodel/weight/m_total");
+        const size_t headingID = getter.addFloat("sim/flightmodel/position/psi");
+        const size_t pitchID = getter.addFloat("sim/flightmodel/position/theta");
+        const size_t bankID = getter.addFloat("sim/flightmodel/position/phi");
+        const size_t iasID = getter.addFloat("sim/flightmodel/position/indicated_airspeed2");
+        const size_t machID = getter.addFloat("sim/flightmodel/misc/machno");
+        const size_t groundSpeedID = getter.addFloat("sim/flightmodel/position/groundspeed");
+        const size_t vsID = getter.addFloat("sim/flightmodel/position/vh_ind_fpm2");
+        const size_t radioAltitudeID = getter.addFloat("sim/flightmodel/position/y_agl");
+        const size_t altitudeID = getter.addFloat("sim/flightmodel/position/elevation");
+        const size_t gLoadID = getter.addFloat("sim/flightmodel/forces/g_nrml");
+        const size_t flapsControlID = getter.addFloat("sim/flightmodel/controls/flaprqst");
+        const size_t flapsLeftID = getter.addFloat("sim/flightmodel/controls/flaprat");
+        const size_t flapsRightID = getter.addFloat("sim/flightmodel/controls/flap2rat");
+        const size_t navLightsID = getter.addInt("sim/cockpit/electrical/nav_lights_on");
+        const size_t beaconLightsID = getter.addInt("sim/cockpit/electrical/beacon_lights_on");
+        const size_t strobeLightsID = getter.addInt("sim/cockpit/electrical/strobe_lights_on");
+        const size_t landingLightsID = getter.addInt("sim/cockpit/electrical/landing_lights_on");
+        const size_t pitotID = getter.addInt("sim/cockpit/switches/pitot_heat_on");
+        const size_t parkingID = getter.addFloat("sim/flightmodel/controls/parkbrake");
+        //const size_t gearControlID = getter.addInt("sim/cockpit/switches/gear_handle_status");
+        const size_t gearControlID = getter.addInt("sim/cockpit2/controls/gear_handle_down");
+        const size_t noseGearID = getter.addFloatArray("sim/flightmodel2/gear/deploy_ratio", 1);
+        const size_t altimeterID = getter.addFloat("sim/cockpit/misc/barometer_setting");
+        const size_t qnhID = getter.addFloat("sim/flightmodel/misc/Qstatic");
+
+        if (dontregister) {
+            getter.finalize();
+        } else {
+            printf("Registering getter\n\n");
+            getter.registerInXPlane();
+        }
+
+        const int32_t& paused = getter.getIntRef(pausedID);
+        const double& latitude = getter.getDoubleRef(latitudeID);
+        const double& longitude = getter.getDoubleRef(longitudeID);
+        // frozen
+        // slew
+        const int32_t& replay = getter.getIntRef(replayID);
+        const int32_t& overspeed = getter.getIntRef(overspeedID);
+        const int32_t& stalled = getter.getIntRef(stalledID);
+        const int32_t& onTheGround = getter.getIntRef(onTheGroundID);
+        const float& emptyWeight = getter.getFloatRef(emptyWeightID);
+        const float& payloadWeight = getter.getFloatRef(payloadWeightID);
+        const float& grossWeight = getter.getFloatRef(grossWeightID);
+        const float& heading = getter.getFloatRef(headingID);
+        const float& pitch = getter.getFloatRef(pitchID);
+        const float& bank = getter.getFloatRef(bankID);
+        const float& ias = getter.getFloatRef(iasID);
+        const float& mach = getter.getFloatRef(machID);
+        const float& groundSpeed = getter.getFloatRef(groundSpeedID);
+        const float& vs = getter.getFloatRef(vsID);
+        const float& radioAltitude = getter.getFloatRef(radioAltitudeID);
+        const float& altitude = getter.getFloatRef(altitudeID);
+        const float& gLoad = getter.getFloatRef(gLoadID);
+        const float& flapsControl = getter.getFloatRef(flapsControlID);
+        const float& flapsLeft = getter.getFloatRef(flapsLeftID);
+        const float& flapsRight = getter.getFloatRef(flapsRightID);
+        const int32_t& navLights = getter.getIntRef(navLightsID);
+        const int32_t& beaconLights = getter.getIntRef(beaconLightsID);
+        const int32_t& strobeLights = getter.getIntRef(strobeLightsID);
+        const int32_t& landingLights = getter.getIntRef(landingLightsID);
+        const int32_t& pitot = getter.getIntRef(pitotID);
+        const float& parking = getter.getFloatRef(parkingID);
+        const int32_t& gearControl = getter.getInt(gearControlID);
+        const float& noseGear = getter.getFloatArray(noseGearID)[0];
+        const float& altimeter = getter.getFloatRef(altimeterID);
+        const float& qnh = getter.getFloatRef(qnhID);
+
+        while(true) {
+            getter.execute();
+            printf("paused=%d, replay=%d, overspeed=%d, stalled=%d, onTheGround=%d\n",
+                   paused, replay, overspeed, stalled, onTheGround);
+            printf("emptyWeight=%f, payloadWeight=%f, grossWeight=%f\n",
+                   emptyWeight, payloadWeight, grossWeight);
+            printf("latitude=%f, longitude=%f, radioAltitude=%f, altitude=%f, gLoad=%f\n",
+                   latitude, longitude, radioAltitude/.3048, altitude/.3048, gLoad);
+            printf("heading=%f, pitch=%f, bank=%f, ias=%f, mach=%f, groundSpeed=%f, vs=%f\n",
+                   heading, pitch,bank, ias, mach, groundSpeed, vs);
+            printf("flapsControl=%f, flapsLeft=%f, flapsRight=%f\n",
+                   flapsControl, flapsLeft, flapsRight);
+            printf("Lights: NAV: %d, beacon: %d, strobe: %d, landing: %d\n",
+                   navLights, beaconLights, strobeLights, landingLights);
+            printf("pitot: %d, parking: %f, gearControl: %d, noseGear: %f\n",
+                   pitot, parking, gearControl, noseGear);
+            printf("altimeter: %f, qnh: %f\n",
+                   altimeter, qnh);
+            printf("\n");
+            Thread::sleep(1000);
+        }
+
+        return 0;
+    } catch(Exception& exception) {
+        printf("\n>>>>>>>>>>>>>>>>> Exception caugth: %s\n", exception.what());
+
+        return 1;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 4
+// indent-tabs-mode: nil
+// End:
