Replace MethodCallHandler::setCaller() with a parameterized constructor 69/136269/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Thu, 29 Jun 2017 01:55:26 +0000 (10:55 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Thu, 29 Jun 2017 01:55:26 +0000 (10:55 +0900)
Change-Id: I2f1b7c954419dd4b9247eefb38e4598c1d127aae
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
include/private/SensorRecorderService.h
src/server-dummy/SensorRecorderService.cpp
src/server/MethodCallHandler.cpp
src/server/MethodCallHandler.h
src/server/SensorRecorderService.cpp

index 90520f4..0235691 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <IService.h>
 #include <IServiceRunner.h>
+#include <IClient.h>
 #include <IMethodCallHandler.h>
 
 namespace ctx {
@@ -43,7 +44,7 @@ namespace ctx {
                void onUserActivated();
                void onUserDeactivated();
 
-               IMethodCallHandler* createMethodCallHandler();
+               IMethodCallHandler* createMethodCallHandler(IClient* client);
 
                GDBusConnection* getConnection();
 
index 06cf899..5ef92f8 100644 (file)
@@ -66,7 +66,7 @@ void SensorRecorderService::onUserDeactivated()
 {
 }
 
-IMethodCallHandler* SensorRecorderService::createMethodCallHandler()
+IMethodCallHandler* SensorRecorderService::createMethodCallHandler(IClient* client)
 {
        return NULL;
 }
index 8a20944..6acc120 100644 (file)
@@ -24,8 +24,8 @@
 
 using namespace ctx;
 
-MethodCallHandler::MethodCallHandler() :
-       __caller(NULL)
+MethodCallHandler::MethodCallHandler(IClient* client) :
+       __caller(client)
 {
 }
 
@@ -33,11 +33,6 @@ MethodCallHandler::~MethodCallHandler()
 {
 }
 
-void MethodCallHandler::setCaller(IClient* client)
-{
-       __caller = client;
-}
-
 void MethodCallHandler::onMethodCalled(IMethodCall* methodCall)
 {
        try {
index cde2a2b..83ff751 100644 (file)
@@ -27,10 +27,9 @@ namespace ctx {
 
        class MethodCallHandler : public IMethodCallHandler {
        public:
-               MethodCallHandler();
+               MethodCallHandler(IClient* client);
                ~MethodCallHandler();
 
-               void setCaller(IClient* client);
                void onMethodCalled(IMethodCall* methodCall);
                void onDisconnected();
 
index 9846d00..8fba83b 100644 (file)
@@ -82,9 +82,9 @@ void SensorRecorderService::onUserDeactivated()
 {
 }
 
-IMethodCallHandler* SensorRecorderService::createMethodCallHandler()
+IMethodCallHandler* SensorRecorderService::createMethodCallHandler(IClient* client)
 {
-       return new MethodCallHandler();
+       return new MethodCallHandler(client);
 }
 
 GDBusConnection* SensorRecorderService::getConnection()