summaryrefslogtreecommitdiff
path: root/src/CommonAPI/DBus/DBusServicePublisher.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/CommonAPI/DBus/DBusServicePublisher.h')
-rw-r--r--src/CommonAPI/DBus/DBusServicePublisher.h24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/CommonAPI/DBus/DBusServicePublisher.h b/src/CommonAPI/DBus/DBusServicePublisher.h
index 4559386..f09a6dc 100644
--- a/src/CommonAPI/DBus/DBusServicePublisher.h
+++ b/src/CommonAPI/DBus/DBusServicePublisher.h
@@ -20,6 +20,8 @@
namespace CommonAPI {
namespace DBus {
+class DBusFactory;
+class DBusObjectManagerStub;
class DBusServicePublisher: public ServicePublisher {
public:
@@ -27,12 +29,28 @@ class DBusServicePublisher: public ServicePublisher {
static std::shared_ptr<DBusServicePublisher> getInstance();
- bool registerService(const std::string& serviceAddress, std::shared_ptr<DBusStubAdapter> adapter);
+ bool registerService(const std::shared_ptr<DBusStubAdapter>& dbusStubAdapter);
+ virtual bool unregisterService(const std::string& serviceAddress);
- bool unregisterService(const std::string& serviceAddress);
+ bool registerManagedService(const std::shared_ptr<DBusStubAdapter>& managedDBusStubAdapter);
+ bool unregisterManagedService(const std::string& serviceAddress);
+
+ std::shared_ptr<DBusStubAdapter> getRegisteredService(const std::string&);
+
+ protected:
+ virtual bool registerService(const std::shared_ptr<StubBase>& stubBase,
+ const char* interfaceId,
+ const std::string& participantId,
+ const std::string& serviceName,
+ const std::string& domain,
+ const std::shared_ptr<Factory>& factory);
private:
- std::unordered_map<std::string, std::shared_ptr<DBusStubAdapter>> registeredServices_;
+ typedef std::unordered_map<std::string, std::shared_ptr<DBusStubAdapter>> DBusServicesMap;
+
+ void unregisterManagedService(DBusServicesMap::iterator& managedServiceIterator);
+
+ DBusServicesMap registeredServices_;
};
} // namespace DBus