File: server.h

package info (click to toggle)
qxmlrpc 0.0.svn6-2
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch, wheezy
  • size: 392 kB
  • ctags: 200
  • sloc: cpp: 1,621; python: 29; makefile: 23
file content (62 lines) | stat: -rw-r--r-- 2,050 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// vim:tabstop=4:shiftwidth=4:expandtab:cinoptions=(s,U1,m1
// Copyright (C) 2005 Dmitry Poplavsky <dima@thekompany.com>

#ifndef XMLRPC_SERVER_H
#define XMLRPC_SERVER_H

#include <QTcpServer>
#include <QPointer>

#include "variant.h"

namespace  xmlrpc {
class IncomingConnection;
/*!
 \class xmlrpc::Server server.h
 \brief The xmlrpc::Server class provides an implementation of the XML-RPC server.
 */
class Server : public QObject {
friend class IncomingConnection;    
Q_OBJECT
public:
	Server( QObject * parent = 0 );
	virtual ~Server();

    bool listen ( quint16 port, const QHostAddress & address = QHostAddress::Any );
    bool isListening() const;

    void registerMethod( QString methodName, QVariant::Type returnType, 
                         QList<QVariant::Type> parameterTypes );

    void registerMethod( QString methodName, QVariant::Type returnType );
    void registerMethod( QString methodName, QVariant::Type returnType, 
                         QVariant::Type parameter1Type );
    void registerMethod( QString methodName, QVariant::Type returnType, 
                         QVariant::Type parameter1Type, QVariant::Type parameter2Type );
    void registerMethod( QString methodName, QVariant::Type returnType, 
                         QVariant::Type parameter1Type, QVariant::Type parameter2Type, QVariant::Type parameter3Type );
    void registerMethod( QString methodName, QVariant::Type returnType, 
                         QVariant::Type parameter1Type, QVariant::Type parameter2Type, QVariant::Type parameter3Type, QVariant::Type parameter4Type );

signals:
    void incomingRequest( int requestId, QString methodName, QList<xmlrpc::Variant> parameters );

public slots:
    void sendReturnValue( int requestId, const xmlrpc::Variant& value );
    void sendFault( int requestId, int faultCode, QString faultMessage );


protected slots:
    void newConnection();
    void processRequest( QByteArray data, QTcpSocket *socket );

private:
	class Private;
	Private *d;
}; 

} // namespace

#endif // XMLRPC_SERVER_H