Add PID related functions into abstract request handler
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 8 Mar 2021 06:29:03 +0000 (15:29 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 8 Mar 2021 06:29:03 +0000 (15:29 +0900)
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/common/request_handler/abstract_request_handler.cc [new file with mode: 0644]
src/common/request_handler/abstract_request_handler.hh

diff --git a/src/common/request_handler/abstract_request_handler.cc b/src/common/request_handler/abstract_request_handler.cc
new file mode 100644 (file)
index 0000000..798130d
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+// Use of this source code is governed by an apache-2.0 license that can be
+// found in the LICENSE file.
+
+#include "abstract_request_handler.hh"
+
+#include "pkgmgrinfo_debug.h"
+
+#include <string>
+
+namespace pkgmgr_server {
+namespace request_handler {
+
+void AbstractRequestHandler::SetPID(int pid) {
+  pid_ = pid;
+}
+
+int AbstractRequestHandler::GetPID() {
+  return pid_;
+}
+
+}  // namespace request_handler
+}  // namespace pkgmgr_server
index 49f0c98..0ddc369 100644 (file)
@@ -21,6 +21,13 @@ class EXPORT_API AbstractRequestHandler {
   virtual bool HandleRequest(unsigned char* data, int size, std::string locale) = 0;
 
   virtual std::vector<uint8_t> GetResult() = 0;
+  void SetPID(int pid);
+
+ protected:
+  int GetPID();
+
+ private:
+  int pid_;
 };
 
 }  // namespace request_handler