• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_ARKCOMPILER_AOTCOMPILER_INTERFACE_PROXY_H
17 #define OHOS_ARKCOMPILER_AOTCOMPILER_INTERFACE_PROXY_H
18 
19 #include <iremote_proxy.h>
20 #include "iaot_compiler_interface.h"
21 
22 namespace OHOS::ArkCompiler {
23 class AotCompilerInterfaceProxy : public IRemoteProxy<IAotCompilerInterface> {
24 public:
AotCompilerInterfaceProxy(const sptr<IRemoteObject> & remote)25     explicit AotCompilerInterfaceProxy(
26         const sptr<IRemoteObject>& remote)
27         : IRemoteProxy<IAotCompilerInterface>(remote)
28     {}
29 
~AotCompilerInterfaceProxy()30     virtual ~AotCompilerInterfaceProxy()
31     {}
32 
33     ErrCode AotCompiler(
34         const std::unordered_map<std::string, std::string>& argsMap,
35         std::vector<int16_t>& sigData) override;
36 
37     ErrCode StopAotCompiler() override;
38 
39     ErrCode GetAOTVersion(std::string& sigData) override;
40 
41     ErrCode NeedReCompile(const std::string& args, bool& sigData) override;
42 
43 private:
44     static constexpr int32_t COMMAND_AOT_COMPILER = MIN_TRANSACTION_ID + 0;
45     static constexpr int32_t COMMAND_STOP_AOT_COMPILER = MIN_TRANSACTION_ID + 1;
46     static constexpr int32_t COMMAND_GET_AOT_VERSION = MIN_TRANSACTION_ID + 2;
47     static constexpr int32_t COMMAND_NEED_RE_COMPILE = MIN_TRANSACTION_ID + 3;
48 
49     static inline BrokerDelegator<AotCompilerInterfaceProxy> delegator_;
50 };
51 } // namespace OHOS::ArkCompiler
52 #endif // OHOS_ARKCOMPILER_AOTCOMPILER_INTERFACE_PROXY_H
53 
54