Apply cpu priority inheritance
[platform/core/appfw/pkgmgr-info.git] / src / client / pkginfo_client.hh
index 9390739..67d50d0 100644 (file)
@@ -5,7 +5,9 @@
 #ifndef CLIENT_PKGINFO_CLIENT_HH_
 #define CLIENT_PKGINFO_CLIENT_HH_
 
-#include "../common/parcel/abstract_parcelable.hh"
+#include "abstract_parcelable.hh"
+#include "client_socket.hh"
+#include "request_type.hh"
 
 #include <string>
 
@@ -13,15 +15,34 @@ namespace pkgmgr_client {
 
 class PkgInfoClient {
  public:
-  PkgInfoClient(std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> parcel,
-      uid_t uid, std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable::IFactory> factory);
+  class CPUInheritanceInvoker {
+   public:
+    CPUInheritanceInvoker();
+    ~CPUInheritanceInvoker();
+    void SetCPUInheritance();
+    void ClearCPUInheritance();
+
+   private:
+    bool set_complete_;
+  };
+
+  PkgInfoClient(
+      std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> parcel,
+      uid_t uid, pkgmgr_common::ReqType req_type);
+  ~PkgInfoClient() = default;
   bool SendRequest();
   std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> GetResultParcel();
 
  private:
+  bool RequestHandlerDirectAccess(const std::vector<uint8_t>& raw);
+
   std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> parcel_;
+  std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> result_parcel_;
+  std::unique_ptr<pkgmgr_common::socket::ClientSocket> socket_;
   uid_t uid_;
-  std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable::IFactory> factory_;
+  pkgmgr_common::ReqType req_type_;
+  bool is_offline_;
+  CPUInheritanceInvoker cpu_inheritance_invoker_;
 };
 
 }  // namespace pkgmgr_client