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_
10 #include <sys/types.h>
14 namespace pkgmgr_server {
15 namespace request_handler {
18 #define EXPORT_API __attribute__((visibility("default")))
21 class EXPORT_API AbstractRequestHandler {
23 virtual ~AbstractRequestHandler() = default;
24 virtual bool HandleRequest(unsigned char* data, int size,
25 const std::string& locale) = 0;
27 virtual std::vector<uint8_t> ExtractResult() = 0;
29 virtual void PreExec();
30 virtual void PostExec();
31 void SetPID(pid_t pid);
32 void SetUID(uid_t uid);
43 } // namespace request_handler
44 } // namespace pkgmgr_server
46 #endif // SERVER_ABSTRACT_REQUEST_HANDLER_HH_