Fix abstract_db_handler
authorJunghyun Yeon <jungh.yeon@samsung.com>
Fri, 18 Jun 2021 09:22:08 +0000 (18:22 +0900)
committer연정현/Tizen Platform Lab(SR)/Staff Engineer/삼성전자 <jungh.yeon@samsung.com>
Wed, 23 Jun 2021 03:31:11 +0000 (12:31 +0900)
- Check coding rule.
- Move empty constructor implementation into header.

Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/server/database/abstract_db_handler.cc
src/server/database/abstract_db_handler.hh

index f73c8bb..7531899 100644 (file)
@@ -150,11 +150,6 @@ namespace database {
 
 std::shared_timed_mutex AbstractDBHandler::lock_;
 
-AbstractDBHandler::AbstractDBHandler(uid_t uid, int pid) {
-  uid_ = uid;
-  pid_ = pid;
-}
-
 AbstractDBHandler::~AbstractDBHandler() {
   for (auto& db_handle : db_handle_list_)
     sqlite3_close_v2(db_handle.first);
@@ -174,8 +169,9 @@ std::vector<std::pair<std::string, uid_t>> AbstractDBHandler::GetDBPath() {
 }
 
 bool AbstractDBHandler::Connect() {
-  if (db_type_ == pkgmgr_common::DBType::DB_TYPE_NONE || op_type_ == pkgmgr_common::DBOperationType::OPERATION_TYPE_NONE) {
-    // error log
+  if (db_type_ == pkgmgr_common::DBType::DB_TYPE_NONE ||
+      op_type_ == pkgmgr_common::DBOperationType::OPERATION_TYPE_NONE) {
+    _LOGE("Invalid parameter");
     return false;
   }
   auto dbpath_list = GetDBPath();
index 5fb7912..2c8e010 100644 (file)
@@ -36,7 +36,7 @@ namespace database {
 
 class EXPORT_API AbstractDBHandler {
  public:
-  AbstractDBHandler(uid_t uid, pid_t pid);
+  AbstractDBHandler(uid_t uid, pid_t pid) : uid_(uid), pid_(pid) {};
   virtual ~AbstractDBHandler();
   virtual int Execute() = 0;
   void SetLocale(std::string locale);