qthighway/xqserviceipc/xqserviceipc/xqserviceipc_p.h
changeset 24 9d760f716ca8
parent 1 2b40d63a9c3d
equal deleted inserted replaced
19:46686fb6258c 24:9d760f716ca8
    26 #include <QByteArray>
    26 #include <QByteArray>
    27 #include "xqserviceipc.h"
    27 #include "xqserviceipc.h"
    28 
    28 
    29 namespace QtService {
    29 namespace QtService {
    30 
    30 
    31     /**
    31     /*!
    32      *  Private implementation class for IPC
    32         \class ServiceFwIPCPrivate
    33      */
    33         \brief Private implementation class for IPC
       
    34     */
    34     class ServiceFwIPC;
    35     class ServiceFwIPC;
    35     class ServiceFwIPCPrivate
    36     class ServiceFwIPCPrivate
    36     {
    37     {
    37     public:
    38     public:
    38         /**
    39         /*!
    39          * Virtual destructor
    40             Virtual destructor
    40          */
    41         */
    41         virtual ~ServiceFwIPCPrivate() {};
    42         virtual ~ServiceFwIPCPrivate() {};
    42 
    43 
    43     
    44     
    44         // Virtual functions 
    45         // Virtual functions 
    45     
    46     
    46         /**
    47         /*!
    47          * Connect to the server
    48             Connect to the server.
    48          * @param aServerName name of the server to connect to
    49             \param aServerName Name of the server to connect to.
    49          * @return true if connected, false if not
    50             \return true if connected, false if not.
    50          */
    51         */
    51         virtual bool connect(const QString& aServerName) = 0;
    52         virtual bool connect(const QString& aServerName) = 0;
    52     
    53     
    53         /**
    54         /*!
    54          * Disconnect from the server
    55             Disconnect from the server.
    55          */
    56         */
    56         virtual void disconnect() = 0;
    57         virtual void disconnect() = 0;
    57     
    58     
    58         /**
    59         /*!
    59          * Starts the service
    60             Starts the service.
    60          * @note: refer to public API ServiceFwIPC
    61             \note Refer to public API ServiceFwIPC.
    61          */
    62         */
    62         virtual bool startServer(const QString& aServerName,
    63         virtual bool startServer(const QString& aServerName,
    63                                  const QString& aExeName,
    64                                  const QString& aExeName,
    64                                  quint64& processId,
    65                                  quint64& processId,
    65                                  int options = 0 ) = 0;
    66                                  int options = 0 ) = 0;
    66     
    67     
    67         /**
    68         /*!
    68          * Send a request synchronously
    69             Send a request synchronously.
    69          * @note: refer to public API ServiceFwIPC
    70             \note Refer to public API ServiceFwIPC.
    70          */
    71         */
    71         virtual bool sendSync(const QString& aRequestType,
    72         virtual bool sendSync(const QString& aRequestType,
    72                               const QByteArray& aData) = 0;
    73                               const QByteArray& aData) = 0;
    73     
    74     
    74         /**
    75         /*!
    75          * Send a request asynchronously
    76             Send a request asynchronously.
    76          * @note: refer to public API ServiceFwIPC
    77             \note Refer to public API ServiceFwIPC.
    77          */
    78         */
    78         virtual void sendAsync(const QString& aRequestType,
    79         virtual void sendAsync(const QString& aRequestType,
    79                                const QByteArray& aData) = 0;
    80                                const QByteArray& aData) = 0;
    80     
    81     
    81         /**
    82         /*!
    82          * Reads all data pending in the buffer
    83             Reads all data pending in the buffer.
    83          * @note: refer to public API ServiceFwIPC
    84             \note Refer to public API ServiceFwIPC.
    84          */
    85         */
    85         virtual void readAll(QByteArray& aArray) = 0;
    86         virtual void readAll(QByteArray& aArray) = 0;
    86         
    87         
    87         virtual QByteArray readAll() = 0;
    88         virtual QByteArray readAll() = 0;
    88 		
    89 		
    89         /**
    90         /*!
    90          * Waits until data is available for reading 
    91             Waits until data is available for reading.
    91          * @note: refer to public API ServiceFwIPC
    92             \note Refer to public API ServiceFwIPC.
    92          */
    93         */
    93         virtual bool waitForRead() = 0;
    94         virtual bool waitForRead() = 0;
    94 
    95 
    95         virtual void setUserData(const void *data) {userData = data;};
    96         virtual void setUserData(const void *data) {userData = data;};
    96         
    97         
    97     protected:
    98     protected: