Changeset 11:215163a309ee in xplra


Ignore:
Timestamp:
01/20/13 09:50:28 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Updated to the new, separated VSCPL and XPLCOMMON libraries

Files:
2 added
21 edited

Legend:

Unmodified
Added
Removed
  • .hgignore

    r0 r11  
    1010config.sub
    1111ltmain.sh
     12m4/.*\.m4
  • Makefile.am

    r0 r11  
    11SUBDIRS=src
     2ACLOCAL_AMFLAGS=-I m4
  • configure.ac

    r1 r11  
    77AC_PROG_CC
    88AC_PROG_CXX
     9AC_CONFIG_MACRO_DIR([m4])
    910
    1011PKG_PROG_PKG_CONFIG
    1112
    12 AC_CHECK_HEADERS([windows.h winsock2.h])
    13 
    14 test "$ac_cv_header_windows_h" = "yes" -a "$ac_cv_header_winsock2_h" = "yes"
    15 _target_win32=$?
    16 
    17 AM_CONDITIONAL([TARGET_API_WIN32], test $_target_win32 -eq 0)
    18 AM_CONDITIONAL([TARGET_API_WIN64], test $_target_win32 -eq 0 -a "$host_cpu" = "x86_64")
    19 AM_CONDITIONAL([TARGET_API_POSIX], test $_target_win32 -ne 0)
    20 if test $_target_win32 -eq 0; then
    21    if test "$host_cpu" = "x86_64"; then
    22        AC_DEFINE([TARGET_API_WIN64], [1], [Define if the target is the 64-bit Win32 API.])
    23    fi
    24    AC_DEFINE([TARGET_API_WIN32], [1], [Define if the target is the Win32 API.])
    25 else
    26    AC_DEFINE([TARGET_API_POSIX], [1], [Define if the target is the POSIX API.])
    27 fi
     13AM_VSCPL_TARGET_API
    2814
    2915AC_MSG_CHECKING([where to find the X-Plane Plugin SDK])
     
    5137AC_SUBST(XPSDK_LDFLAGS)
    5238
     39AM_VSCPL
    5340PKG_CHECK_MODULES([LIBXPLCOMMON], [libxplcommon >= 0.1])
    5441
  • src/xplra/DataRefTask.cc

    r3 r11  
    3131#include "DataRefTask.h"
    3232
    33 #include "xplcommon/Util.h"
     33#include "hu/varadiistvan/xplcommon/Util.h"
    3434
    3535//------------------------------------------------------------------------------
     
    3737using xplra::DataRefTask;
    3838
    39 using xplcommon::Util;
     39using hu::varadiistvan::xplcommon::Util;
    4040
    4141//------------------------------------------------------------------------------
  • src/xplra/GetDataRefTask.cc

    r8 r11  
    3232#include "Protocol.h"
    3333
    34 #include "xplcommon/Util.h"
     34#include "hu/varadiistvan/xplcommon/Util.h"
    3535
    3636//------------------------------------------------------------------------------
     
    4141using xplra::GetDoubleDataRefTask;
    4242
    43 using xplcommon::DataStream;
    44 using xplcommon::Util;
     43using hu::varadiistvan::scpl::io::DataStream;
     44using hu::varadiistvan::xplcommon::Util;
    4545
    4646using std::string;
  • src/xplra/GetDataRefTask.h

    r6 r11  
    3333#include "DataRefTask.h"
    3434
    35 #include <xplcommon/DataStream.h>
     35#include <hu/varadiistvan/scpl/io/DataStream.h>
    3636
    3737//------------------------------------------------------------------------------
     
    5555     * unless the stream failed, in which case it remains RESULT_OK.
    5656     */
    57     static GetDataRefTask* create(uint8_t& result, xplcommon::DataStream& stream);
     57    static GetDataRefTask* create(uint8_t& result,
     58                                  hu::varadiistvan::scpl::io::DataStream& stream);
    5859
    5960    /**
     
    7071     * Write the value into the given stream.
    7172     */
    72     virtual void writeValue(xplcommon::DataStream& stream) = 0;
     73    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream) = 0;
    7374};
    7475
     
    141142     * Write the value into the given stream.
    142143     */
    143     virtual void writeValue(xplcommon::DataStream& stream);
     144    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream);
    144145};
    145146
     
    173174     * Write the value into the given stream.
    174175     */
    175     virtual void writeValue(xplcommon::DataStream& stream);
     176    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream);
    176177};
    177178
     
    205206     * Write the value into the given stream.
    206207     */
    207     virtual void writeValue(xplcommon::DataStream& stream);
     208    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream);
    208209};
    209210
     
    289290     * Write the value into the given stream.
    290291     */
    291     virtual void writeValue(xplcommon::DataStream& stream);
     292    virtual void writeValue(hu::varadiistvan::scpl::io::DataStream& stream);
    292293};
    293294
     
    533534template <typename T, class ConcreteClass>
    534535void GetArrayDataRefTask<T, ConcreteClass>::
    535 writeValue(xplcommon::DataStream& stream)
     536writeValue(hu::varadiistvan::scpl::io::DataStream& stream)
    536537{
    537538    stream.writeS32(length);
  • src/xplra/GetMultiDataRefRequest.cc

    r10 r11  
    3333#include "Protocol.h"
    3434
    35 #include <xplcommon/Util.h>
     35#include <hu/varadiistvan/xplcommon/Util.h>
    3636
    3737//------------------------------------------------------------------------------
     
    3939using xplra::GetMultiDataRefRequest;
    4040
    41 using xplcommon::DataStream;
    42 using xplcommon::Util;
     41using hu::varadiistvan::scpl::io::DataStream;
     42using hu::varadiistvan::xplcommon::Util;
    4343
    4444//------------------------------------------------------------------------------
     
    6666//------------------------------------------------------------------------------
    6767
    68 void GetMultiDataRefRequest::writeResult(xplcommon::DataStream& stream) const
     68void GetMultiDataRefRequest::writeResult(DataStream& stream) const
    6969{
    7070    // Util::debug("hu.varadiistvan.xplra.GetMultiDataRefRequest[%p]::writeResult\n", this);
  • src/xplra/GetMultiDataRefRequest.h

    r10 r11  
    5050     * specifications from the given stream.
    5151     */
    52     GetMultiDataRefRequest(uint8_t& result, xplcommon::DataStream& stream);
     52    GetMultiDataRefRequest(uint8_t& result, hu::varadiistvan::scpl::io::DataStream& stream);
    5353
    5454    /**
     
    6262     * the datarefs queried.
    6363     */
    64     void writeResult(xplcommon::DataStream& stream) const;
     64    void writeResult(hu::varadiistvan::scpl::io::DataStream& stream) const;
    6565};
    6666
  • src/xplra/ListenThread.cc

    r3 r11  
    3333#include "ServerThread.h"
    3434
    35 #include <xplcommon/LocalServerSocket.h>
    36 #include <xplcommon/LocalAcceptor.h>
    37 #include <xplcommon/Util.h>
     35#include <hu/varadiistvan/scpl/io/LocalServerSocket.h>
     36#include <hu/varadiistvan/scpl/io/LocalAcceptor.h>
     37#include <hu/varadiistvan/xplcommon/Util.h>
    3838
    3939//------------------------------------------------------------------------------
     
    4141using xplra::ListenThread;
    4242
    43 using xplcommon::LocalServerSocket;
    44 using xplcommon::LocalAcceptor;
    45 using xplcommon::Util;
     43using hu::varadiistvan::scpl::io::LocalServerSocket;
     44using hu::varadiistvan::scpl::io::LocalAcceptor;
     45using hu::varadiistvan::xplcommon::Util;
    4646
    4747//------------------------------------------------------------------------------
  • src/xplra/ListenThread.h

    r2 r11  
    3131//------------------------------------------------------------------------------
    3232
     33#include <hu/varadiistvan/scpl/Thread.h>
     34
    3335#include "RequestQueue.h"
    3436
    35 #include <xplcommon/Thread.h>
    36 #include <xplcommon/Waiter.h>
    37 #include <xplcommon/WaitableEvent.h>
     37#include <hu/varadiistvan/scpl/io/Waiter.h>
     38#include <hu/varadiistvan/scpl/io/WaitableEvent.h>
    3839
    3940//------------------------------------------------------------------------------
     
    4950 * This is a detached thread, to allow it to quit automatically.
    5051 */
    51 class ListenThread : public xplcommon::Thread
     52class ListenThread : public hu::varadiistvan::scpl::Thread
    5253{
    5354private:
     
    5556     * The waiter used in the thread.
    5657     */
    57     xplcommon::Waiter waiter;
     58    hu::varadiistvan::scpl::io::Waiter waiter;
    5859
    5960    /**
     
    6162     * quit.
    6263     */
    63     xplcommon::WaitableEvent quitEvent;
     64    hu::varadiistvan::scpl::io::WaitableEvent quitEvent;
    6465
    6566    /**
  • src/xplra/Makefile.am

    r9 r11  
    11INCLUDES=@XPSDK_INCLUDES@
    22
    3 AM_CXXFLAGS=$(LIBXPLCOMMON_CFLAGS)
     3AM_CXXFLAGS=$(VSCPL_CFLAGS) $(LIBXPLCOMMON_CFLAGS)
    44
    55AM_CPPFLAGS=-DXPLM210
     
    1818AM_CPPFLAGS+=-DLIN
    1919AM_CXXFLAGS+=-fPIC -fno-stack-protector
     20AM_LDFLAGS=-rdynamic -nodefaultlibs -undefined_warning -Wl,-version-script=$(srcdir)/version.ldscript
    2021endif
    2122
     
    3637        SetMultiDataRefRequest.cc
    3738
    38 libxplra_la_LIBADD=$(LIBXPLCOMMON_LIBS)
     39libxplra_la_LIBADD=$(VSCPL_LIBS) $(LIBXPLCOMMON_LIBS)
    3940
    4041noinst_HEADERS= \
  • src/xplra/MultiTaskRequest.cc

    r8 r11  
    3333#include "Task.h"
    3434
    35 #include <xplcommon/Util.h>
     35#include <hu/varadiistvan/xplcommon/Util.h>
    3636
    3737//------------------------------------------------------------------------------
     
    3939using xplra::MultiTaskRequest;
    4040
    41 using xplcommon::Util;
     41using hu::varadiistvan::xplcommon::Util;
    4242
    4343//------------------------------------------------------------------------------
  • src/xplra/RequestQueue.cc

    r2 r11  
    3333#include "Request.h"
    3434
    35 #include <xplcommon/Util.h>
     35#include <hu/varadiistvan/xplcommon/Util.h>
    3636
    3737//------------------------------------------------------------------------------
     
    3939using xplra::RequestQueue;
    4040
    41 using xplcommon::Util;
     41using hu::varadiistvan::xplcommon::Util;
    4242
    4343//------------------------------------------------------------------------------
  • src/xplra/RequestQueue.h

    r2 r11  
    3131//------------------------------------------------------------------------------
    3232
    33 #include <xplcommon/Mutex.h>
    34 #include <xplcommon/CondVar.h>
     33#include <hu/varadiistvan/scpl/Mutex.h>
     34#include <hu/varadiistvan/scpl/CondVar.h>
    3535
    3636#include <XPLMProcessing.h>
     
    9696     * The mutex protecting the queue.
    9797     */
    98     xplcommon::Mutex mutex;
     98    hu::varadiistvan::scpl::Mutex mutex;
    9999
    100100    /**
     
    102102     * request to be executed.
    103103     */
    104     xplcommon::CondVar requestsDone;
     104    hu::varadiistvan::scpl::CondVar requestsDone;
    105105
    106106    /**
  • src/xplra/ServerThread.cc

    r10 r11  
    3939#include "SetMultiDataRefRequest.h"
    4040
    41 #include <xplcommon/Util.h>
     41#include <hu/varadiistvan/xplcommon/Util.h>
    4242
    4343#include <cstdio>
     
    4747using xplra::ServerThread;
    4848
    49 using xplcommon::LocalAcceptor;
    50 using xplcommon::Mutex;
    51 using xplcommon::Util;
     49using hu::varadiistvan::scpl::io::LocalAcceptor;
     50using hu::varadiistvan::scpl::Mutex;
     51using hu::varadiistvan::xplcommon::Util;
    5252
    5353using std::string;
  • src/xplra/ServerThread.h

    r10 r11  
    3131//------------------------------------------------------------------------------
    3232
    33 #include <xplcommon/Thread.h>
    34 
    35 #include <xplcommon/Mutex.h>
    36 
    37 #include <xplcommon/Waiter.h>
    38 #include <xplcommon/BufferedStream.h>
    39 #include <xplcommon/DataStream.h>
    40 #include <xplcommon/LocalAcceptor.h>
     33#include <hu/varadiistvan/scpl/Thread.h>
     34
     35#include <hu/varadiistvan/scpl/io/Waiter.h>
     36#include <hu/varadiistvan/scpl/io/BufferedStream.h>
     37#include <hu/varadiistvan/scpl/io/DataStream.h>
     38#include <hu/varadiistvan/scpl/io/LocalAcceptor.h>
     39
     40#include <hu/varadiistvan/scpl/Mutex.h>
    4141
    4242#include <set>
     
    5959 * A thread serving a client.
    6060 */
    61 class ServerThread : public xplcommon::Thread
     61class ServerThread : public hu::varadiistvan::scpl::Thread
    6262{
    6363private:
     
    8080     * A mutex to protect the collection of server threads.
    8181     */
    82     static xplcommon::Mutex instancesMutex;
     82    static hu::varadiistvan::scpl::Mutex instancesMutex;
    8383
    8484    /**
     
    102102     * Our waiter.
    103103     */
    104     xplcommon::Waiter waiter;
     104    hu::varadiistvan::scpl::io::Waiter waiter;
    105105
    106106    /**
    107107     * The buffered stream to use for communication at the low-level.
    108108     */
    109     xplcommon::BufferedStream* bufferedStream;
     109    hu::varadiistvan::scpl::io::BufferedStream* bufferedStream;
    110110
    111111    /**
    112112     * The data stream being used for communication.
    113113     */
    114     xplcommon::DataStream stream;
     114    hu::varadiistvan::scpl::io::DataStream stream;
    115115
    116116    /**
     
    140140     */
    141141    ServerThread(RequestQueue& requestQueue,
    142                  xplcommon::LocalAcceptor& acceptor);
     142                 hu::varadiistvan::scpl::io::LocalAcceptor& acceptor);
    143143
    144144    /**
  • src/xplra/SetDataRefTask.cc

    r9 r11  
    4040using xplra::SetDoubleDataRefTask;
    4141
    42 using xplcommon::DataStream;
     42using hu::varadiistvan::scpl::io::DataStream;
    4343
    4444using std::string;
  • src/xplra/SetDataRefTask.h

    r9 r11  
    3333#include "DataRefTask.h"
    3434
    35 #include <xplcommon/DataStream.h>
     35#include <hu/varadiistvan/scpl/io/DataStream.h>
    3636
    3737//------------------------------------------------------------------------------
     
    6565     * @return the new instance or 0 on error.
    6666     */
    67     static SetDataRefTask* create(uint8_t& result, xplcommon::DataStream& stream);
     67    static SetDataRefTask* create(uint8_t& result, hu::varadiistvan::scpl::io::DataStream& stream);
    6868
    6969    /**
     
    8080     * Read and set the value to update from the given stream
    8181     */
    82     virtual void readValue(xplcommon::DataStream& stream) = 0;
     82    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream) = 0;
    8383};
    8484
     
    150150     * Read and set the value to update from the given stream
    151151     */
    152     virtual void readValue(xplcommon::DataStream& stream);
     152    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream);
    153153};
    154154
     
    181181     * Read and set the value to update from the given stream
    182182     */
    183     virtual void readValue(xplcommon::DataStream& stream);
     183    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream);
    184184};
    185185
     
    212212     * Read and set the value to update from the given stream
    213213     */
    214     virtual void readValue(xplcommon::DataStream& stream);
     214    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream);
    215215};
    216216
     
    270270     * Read and set the value to update from the given stream
    271271     */
    272     virtual void readValue(xplcommon::DataStream& stream);
     272    virtual void readValue(hu::varadiistvan::scpl::io::DataStream& stream);
    273273
    274274protected:
     
    424424template <typename T, class ConcreteClass>
    425425void SetArrayDataRefTask<T, ConcreteClass>::
    426 readValue(xplcommon::DataStream& stream)
     426readValue(hu::varadiistvan::scpl::io::DataStream& stream)
    427427{
    428428    stream.read(value, count * sizeof(T));
  • src/xplra/SetMultiDataRefRequest.cc

    r10 r11  
    3737using xplra::SetMultiDataRefRequest;
    3838
    39 using xplcommon::DataStream;
     39using hu::varadiistvan::scpl::io::DataStream;
    4040
    4141//------------------------------------------------------------------------------
  • src/xplra/SetMultiDataRefRequest.h

    r10 r11  
    5050     * the given stream.
    5151     */
    52     SetMultiDataRefRequest(uint8_t& result, xplcommon::DataStream& stream,
     52    SetMultiDataRefRequest(uint8_t& result,
     53                           hu::varadiistvan::scpl::io::DataStream& stream,
    5354                           bool readValues);
    5455
     
    5657     * Read the values of all tasks.
    5758     */
    58     void readValues(xplcommon::DataStream& stream);
     59    void readValues(hu::varadiistvan::scpl::io::DataStream& stream);
    5960
    6061    /**
     
    6768     * Otherwise the result is RESULT_OK.
    6869     */
    69     void writeResult(xplcommon::DataStream& stream) const;
     70    void writeResult(hu::varadiistvan::scpl::io::DataStream& stream) const;
    7071};
    7172
  • src/xplra/plugin.cc

    r9 r11  
    3131#include "ListenThread.h"
    3232
    33 #include <xplcommon/Util.h>
    34 #include <xplcommon/config.h>
     33#include <hu/varadiistvan/xplcommon/Util.h>
     34#include <hu/varadiistvan/scpl/config.h>
    3535
    3636#include <XPLMDefs.h>
     
    5050using xplra::ListenThread;
    5151
    52 using xplcommon::Util;
     52using hu::varadiistvan::xplcommon::Util;
    5353
    5454//------------------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.