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.
5 #ifndef SERVER_ABSTRACT_REQUEST_HANDLER_HH_
6 #define SERVER_ABSTRACT_REQUEST_HANDLER_HH_
8 #include "abstract_parcelable.hh"
12 #include <sys/types.h>
16 namespace pkgmgr_server {
17 namespace request_handler {
20 #define EXPORT_API __attribute__((visibility("default")))
23 class EXPORT_API AbstractRequestHandler {
25 virtual ~AbstractRequestHandler() = default;
26 virtual bool HandleRequest(unsigned char* data, size_t size,
27 const std::string& locale) = 0;
29 virtual tizen_base::Parcel ExtractResult();
31 virtual void PreExec();
32 virtual void PostExec();
33 void SetPID(pid_t pid);
34 void SetUID(uid_t uid);
37 std::shared_ptr<pkgmgr_common::parcel::AbstractParcelable> result_;
46 } // namespace request_handler
47 } // namespace pkgmgr_server
49 #endif // SERVER_ABSTRACT_REQUEST_HANDLER_HH_