summaryrefslogtreecommitdiff
path: root/sap/sapconnection.h
blob: 0fdd02508cf374bbc9d881a969b561faa8dff692 (plain)
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
#ifndef SAPCONNECTION_H
#define SAPCONNECTION_H

#include <QtCore/QObject>
#include <QtCore/QMap>

class SAPPeer;
class SAPSocket;

class SAPConnection : public QObject
{
	Q_OBJECT

	SAPConnection(SAPPeer *peer, const QString &profile);

public:
	SAPPeer *peer();

	QString profile() const;

	SAPSocket *getSocket(int channelId);

	QList<SAPSocket*> sockets();

signals:
	void connected();
	void error(int errorCode);
	void disconnected();

private:
	void setSocket(int channelId, SAPSocket *socket);

private:
	const QString _profile;
	QMap<int, SAPSocket*> _sockets;

	friend class SAPPeer;
};

#endif // SAPCONNECTION_H