Add PID setter/getter at db handler
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 8 Mar 2021 07:27:36 +0000 (16:27 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 8 Mar 2021 07:27:36 +0000 (16:27 +0900)
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/common/database/abstract_db_handler.cc
src/common/database/abstract_db_handler.hh

index d0e002b..0168e6b 100644 (file)
@@ -284,6 +284,12 @@ void AbstractDBHandler::SetOpType(OperationType type) {
 
 std::string AbstractDBHandler::GetLocale() { return locale_; }
 
+int AbstractDBHandler::GetPID() { return pid_; }
+
+void AbstractDBHandler::SetPID(int pid) {
+  pid_ = pid;
+}
+
 void AbstractDBHandler::SetLocale(const std::string& locale) {
   locale_ = locale;
 }
index daa33f6..bcea655 100644 (file)
@@ -47,6 +47,7 @@ class EXPORT_API AbstractDBHandler {
   AbstractDBHandler(uid_t uid);
   virtual ~AbstractDBHandler();
   virtual int Execute() = 0;
+  void SetPID(int pid);
   void SetLocale(const std::string& locale);
   void SetDBType(DBType type);
   void SetOpType(OperationType type);
@@ -54,6 +55,7 @@ class EXPORT_API AbstractDBHandler {
 
  protected:
   bool Connect();
+  int GetPID();
   std::vector<sqlite3*> GetConnection();
   std::string GetLocale();
 
@@ -62,6 +64,7 @@ class EXPORT_API AbstractDBHandler {
   DBType db_type_ = DB_TYPE_NONE;
   OperationType op_type_ = OPERATION_TYPE_NONE;
   uid_t uid_;
+  int pid_;
   std::string locale_;
   std::vector<sqlite3*> db_handle_list_;
 };