Add session & system dbus signal subscribing functions 24/57024/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Thu, 14 Jan 2016 11:01:33 +0000 (20:01 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Thu, 14 Jan 2016 11:01:33 +0000 (20:01 +0900)
Change-Id: I7765587f1a3c00f847d5522b21f8b0e156599df9
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
include/dbus_server.h
include/dbus_server_iface.h
src/dbus_server.cpp

index 009d34e..d5965e1 100644 (file)
@@ -34,12 +34,14 @@ namespace ctx {
                 * @return      A subscription identifier that can be used with signal_unsubscribe().@n
                 *                      If failed, a negative value.
                 */
-               int64_t signal_subscribe(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener);
+               int64_t subscribe_system_signal(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener);
+               int64_t subscribe_session_signal(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener);
 
                /**
                 * @brief       Unsubscribes from signals.
                 */
-               void signal_unsubscribe(int64_t subscription_id);
+               void unsubscribe_system_signal(int64_t subscription_id);
+               void unsubscribe_session_signal(int64_t subscription_id);
 
        }       /* namespace ctx::dbus_server */
 }      /* namespace ctx */
index 6f10940..08dbb44 100644 (file)
@@ -26,8 +26,10 @@ namespace ctx {
        class dbus_server_iface {
                public:
                        virtual ~dbus_server_iface() {}
-                       virtual int64_t signal_subscribe(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener) = 0;
-                       virtual void signal_unsubscribe(int64_t subscription_id) = 0;
+                       virtual int64_t subscribe_system_signal(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener) = 0;
+                       virtual int64_t subscribe_session_signal(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener) = 0;
+                       virtual void unsubscribe_system_signal(int64_t subscription_id) = 0;
+                       virtual void unsubscribe_session_signal(int64_t subscription_id) = 0;
        };      /* class ctx::dbus_server */
 
        namespace dbus_server {
index 9f0b927..4e185d1 100644 (file)
@@ -27,14 +27,26 @@ void ctx::dbus_server::set_instance(dbus_server_iface* svr)
        _instance = svr;
 }
 
-int64_t ctx::dbus_server::signal_subscribe(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener)
+int64_t ctx::dbus_server::subscribe_system_signal(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener)
 {
        IF_FAIL_RETURN_TAG(_instance, false, _E, "Not initialized");
-       return _instance->signal_subscribe(sender, path, iface, name, listener);
+       return _instance->subscribe_system_signal(sender, path, iface, name, listener);
 }
 
-void ctx::dbus_server::signal_unsubscribe(int64_t subscription_id)
+int64_t ctx::dbus_server::subscribe_session_signal(const char* sender, const char* path, const char* iface, const char* name, dbus_listener_iface* listener)
+{
+       IF_FAIL_RETURN_TAG(_instance, false, _E, "Not initialized");
+       return _instance->subscribe_session_signal(sender, path, iface, name, listener);
+}
+
+void ctx::dbus_server::unsubscribe_system_signal(int64_t subscription_id)
+{
+       IF_FAIL_VOID_TAG(_instance, _E, "Not initialized");
+       _instance->unsubscribe_system_signal(subscription_id);
+}
+
+void ctx::dbus_server::unsubscribe_session_signal(int64_t subscription_id)
 {
        IF_FAIL_VOID_TAG(_instance, _E, "Not initialized");
-       _instance->signal_unsubscribe(subscription_id);
+       _instance->unsubscribe_session_signal(subscription_id);
 }