diff options
author | Javier <dev.git@javispedro.com> | 2014-10-19 18:45:03 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2014-10-19 18:45:03 +0200 |
commit | d8d8fc7a0d139e7b864eee3b573bd208f823ad4f (patch) | |
tree | a9b54d6e6e6941c620f4f10cef4b5def9be86f82 /capabilitypeer.h | |
download | sapd-d8d8fc7a0d139e7b864eee3b573bd208f823ad4f.tar.gz sapd-d8d8fc7a0d139e7b864eee3b573bd208f823ad4f.zip |
initial import, no crypto
Diffstat (limited to 'capabilitypeer.h')
-rw-r--r-- | capabilitypeer.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/capabilitypeer.h b/capabilitypeer.h new file mode 100644 index 0000000..0ad6fc6 --- /dev/null +++ b/capabilitypeer.h @@ -0,0 +1,49 @@ +#ifndef CAPABILITYPEER_H +#define CAPABILITYPEER_H + +#include <QtCore/QObject> +#include <QtCore/QHash> +#include <QtCore/QMap> + +#include "sapserviceinfo.h" + +class SAPPeer; +class SAPConnection; +class SAPConnectionRequest; +class SAPSocket; + +class CapabilityPeer : public QObject +{ + Q_OBJECT +public: + CapabilityPeer(SAPPeer *peer, QObject *parent = 0); + + void requestConnection(SAPConnectionRequest *request); + + int remoteAgentId(const QString &profile, SAPServiceInfo::Role role); + SAPServiceInfo remoteServiceInfo(int agentId) const; + +private: + QHash<QString, int>* profilesByRole(SAPServiceInfo::Role role); + +private slots: + void handleConnected(); + void handleMessageReceived(); + +private: + SAPPeer *_peer; + SAPConnection *_conn; + SAPSocket *_socket; + + struct RemoteAgent { + int agentId; + SAPServiceInfo info; + }; + + QMap<int, RemoteAgent> _remoteAgents; + + QHash<QString, int> _consumerProfiles; + QHash<QString, int> _providerProfiles; +}; + +#endif // CAPABILITYPEER_H |