From d8d8fc7a0d139e7b864eee3b573bd208f823ad4f Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 19 Oct 2014 18:45:03 +0200 Subject: initial import, no crypto --- sapmanager.h | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sapmanager.h (limited to 'sapmanager.h') diff --git a/sapmanager.h b/sapmanager.h new file mode 100644 index 0000000..e9f60cc --- /dev/null +++ b/sapmanager.h @@ -0,0 +1,54 @@ +#ifndef SAPMANAGER_H +#define SAPMANAGER_H + +#include +#include +#include +#include "sapserviceinfo.h" + +class SAPAgent; + +class SAPManager : public QObject +{ + Q_OBJECT + + explicit SAPManager(QObject *parent = 0); + Q_DISABLE_COPY(SAPManager) + +public: + static SAPManager * instance(); + + int registerServiceAgent(const SAPServiceInfo &service, SAPAgent *agent); + void unregisterServiceAgent(int agentId); + void unregisterServiceAgent(const QString &profile, SAPServiceInfo::Role role); + + int registeredAgentId(const QString &profile, SAPServiceInfo::Role role); + + bool isRegisteredAgent(int agentId) const; + SAPAgent *agent(int agentId); + SAPServiceInfo serviceInfo(int agentId) const; + + QSet allProfiles(); + +signals: + +public slots: + +private: + int findUnusedAgentId() const; + QHash* profilesByRole(SAPServiceInfo::Role role); + +private: + struct RegisteredAgent { + int agentId; + SAPServiceInfo info; + SAPAgent *agent; + }; + + QMap _agents; + + QHash _consumerProfiles; + QHash _providerProfiles; +}; + +#endif // SAPMANAGER_H -- cgit v1.2.3