Line data Source code
1 : /**
2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 : #ifndef CCU_RES_PACK_H
11 : #define CCU_RES_PACK_H
12 :
13 : #include "ccu_types.h"
14 : #include "ccu_res_desc.h"
15 : #include "ccu_device_pub.h"
16 :
17 : namespace hcomm {
18 :
19 : class CcuResPack {
20 : public:
21 1564 : explicit CcuResPack() {};
22 : ~CcuResPack();
23 : // 基于实例类型初始化
24 : CcuResult InitByInsType(const CcuInstanceType insType);
25 : // 基于资源描述符数组初始化(资源数量由 resDesc 驱动,与 Init 的 insType 路径区分)
26 : CcuResult InitByResDescs(const CcuResDesc* descs[], uint32_t descNum);
27 : CcuResult Reset();
28 :
29 : CcuResRepository& GetCcuResRepo();
30 :
31 : private:
32 : CcuResPack(const CcuResPack& that) = delete;
33 : CcuResPack& operator=(const CcuResPack& that) = delete;
34 : CcuResPack(CcuResPack&& that) = delete;
35 : CcuResPack& operator=(CcuResPack&& that) = delete;
36 :
37 : int32_t devLogicId_{0};
38 : CcuResHandle resHandle_{nullptr};
39 : CcuResRepository resRepo_{};
40 : };
41 :
42 : } // namespace hcomm
43 :
44 : #endif // CCU_RES_PACK_H
|