summaryrefslogtreecommitdiff
path: root/sap/sapconnection.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sap/sapconnection.cc')
-rw-r--r--sap/sapconnection.cc33
1 files changed, 33 insertions, 0 deletions
diff --git a/sap/sapconnection.cc b/sap/sapconnection.cc
new file mode 100644
index 0000000..9a624b6
--- /dev/null
+++ b/sap/sapconnection.cc
@@ -0,0 +1,33 @@
+#include "sappeer.h"
+#include "sapconnection.h"
+
+SAPConnection::SAPConnection(SAPPeer *peer, const QString &profile)
+ : QObject(peer), _profile(profile)
+{
+}
+
+SAPPeer* SAPConnection::peer()
+{
+ return static_cast<SAPPeer*>(parent());
+}
+
+QString SAPConnection::profile() const
+{
+ return _profile;
+}
+
+SAPSocket * SAPConnection::getSocket(int channelId)
+{
+ return _sockets.value(channelId, 0);
+}
+
+QList<SAPSocket*> SAPConnection::sockets()
+{
+ return _sockets.values();
+}
+
+void SAPConnection::setSocket(int channelId, SAPSocket *socket)
+{
+ Q_ASSERT(!_sockets.contains(channelId));
+ _sockets.insert(channelId, socket);
+}