1 /*
2  * Copyright (c) 2022 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 RENDER_SERVICE_CLIENT_CORE_TRANSACTION_RS_APPLICATION_AGENT_IMPL_H
17 #define RENDER_SERVICE_CLIENT_CORE_TRANSACTION_RS_APPLICATION_AGENT_IMPL_H
18 
19 #include <mutex>
20 
21 #ifdef ROSEN_OHOS
22 #include "ipc_callbacks/rs_application_agent_stub.h"
23 #endif
24 
25 namespace OHOS {
26 namespace Rosen {
27 #ifdef ROSEN_OHOS
28 class RSApplicationAgentImpl final : public RSApplicationAgentStub {
29 #else
30 class RSApplicationAgentImpl final {
31 #endif
32 public:
33     static RSApplicationAgentImpl* Instance();
34     void RegisterRSApplicationAgent();
35 
36     RSApplicationAgentImpl() = default;
37     virtual ~RSApplicationAgentImpl() = default;
38 
39 private:
40     RSApplicationAgentImpl(const RSApplicationAgentImpl&) = delete;
41     RSApplicationAgentImpl(const RSApplicationAgentImpl&&) = delete;
42     RSApplicationAgentImpl& operator=(const RSApplicationAgentImpl&) = delete;
43     RSApplicationAgentImpl& operator=(const RSApplicationAgentImpl&&) = delete;
44 
45 #ifdef ROSEN_OHOS
46     void OnTransaction(std::shared_ptr<RSTransactionData> transactionData) override;
47 #endif
48 
49     static inline std::mutex mutex_;
50 };
51 }
52 }
53 #endif // RENDER_SERVICE_CLIENT_CORE_TRANSACTION_RS_APPLICATION_AGENT_IMPL_H
54