summaryrefslogtreecommitdiff
path: root/sap/sapconnection.cc
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2016-01-01 22:05:42 +0100
committerJavier <dev.git@javispedro.com>2016-01-01 22:05:42 +0100
commita45977185a485624095bff1a15024e9199eee676 (patch)
tree6cc57d085bdd01e493477c870dbe0548137998e1 /sap/sapconnection.cc
parenta24034bdfea259cdc09c74217be75d4f9de0dce5 (diff)
downloadsapd-a45977185a485624095bff1a15024e9199eee676.tar.gz
sapd-a45977185a485624095bff1a15024e9199eee676.zip
reorganize source files into SAP and agents
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);
+}