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

index 96cbfd0..e5619c9 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <IService.h>
 #include <IServiceRunner.h>
+#include <IClient.h>
 #include <IMethodCallHandler.h>
 
 namespace ctx {
@@ -45,7 +46,7 @@ namespace ctx {
                void onUserActivated();
                void onUserDeactivated();
 
-               IMethodCallHandler* createMethodCallHandler();
+               IMethodCallHandler* createMethodCallHandler(IClient* client);
 
                GMainContext* getMainContext();
 
index 06a518a..469fdc4 100644 (file)
@@ -67,7 +67,7 @@ void ContextStoreService::onUserDeactivated()
 {
 }
 
-IMethodCallHandler* ContextStoreService::createMethodCallHandler()
+IMethodCallHandler* ContextStoreService::createMethodCallHandler(IClient* client)
 {
        return NULL;
 }
index 2f8b4c3..092a0a6 100644 (file)
@@ -91,9 +91,9 @@ void ContextStoreService::onUserDeactivated()
                __storeManager->flushUserCache();
 }
 
-IMethodCallHandler* ContextStoreService::createMethodCallHandler()
+IMethodCallHandler* ContextStoreService::createMethodCallHandler(IClient* client)
 {
-       return new MethodCallHandler();
+       return new MethodCallHandler(client);
 }
 
 GMainContext* ContextStoreService::getMainContext()
index 0d6595f..a16ddbd 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 f6b861e..ee11ad3 100644 (file)
@@ -28,10 +28,9 @@ namespace ctx {
 
        class MethodCallHandler : public IMethodCallHandler {
        public:
-               MethodCallHandler();
+               MethodCallHandler(IClient* client);
                ~MethodCallHandler();
 
-               void setCaller(IClient* client);
                void onMethodCalled(IMethodCall* methodCall);
                void onDisconnected();