Fix static analysis issue
[platform/core/appfw/pkgmgr-info.git] / src / client / pkginfo_client.hh
1 // Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by an apache-2.0 license that can be
3 // found in the LICENSE file.
4
5 #ifndef CLIENT_PKGINFO_CLIENT_HH_
6 #define CLIENT_PKGINFO_CLIENT_HH_
7
8 #include "abstract_parcelable.hh"
9 #include "client_socket.hh"
10 #include "request_type.hh"
11
12 #include <string>
13
14 namespace pkgmgr_client {
15
16 class PkgInfoClient {
17  public:
18   class CPUInheritanceInvoker {
19    public:
20     CPUInheritanceInvoker();
21     ~CPUInheritanceInvoker();
22     void SetCPUInheritance();
23     void ClearCPUInheritance();
24
25    private:
26     bool set_complete_;
27   };
28
29   PkgInfoClient(
30       std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> parcel,
31       uid_t uid, pkgmgr_common::ReqType req_type);
32   ~PkgInfoClient() = default;
33   bool SendRequest();
34   std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> GetResultParcel();
35
36  private:
37   bool RequestHandlerDirectAccess(tizen_base::Parcel* parcel);
38
39   std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> parcel_;
40   std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> result_parcel_;
41   std::unique_ptr<pkgmgr_common::socket::ClientSocket> socket_;
42   uid_t uid_;
43   pkgmgr_common::ReqType req_type_;
44   bool is_offline_;
45   CPUInheritanceInvoker cpu_inheritance_invoker_;
46 };
47
48 }  // namespace pkgmgr_client
49
50 #endif  // CLIENT_PKGINFO_CLIENT_HH_