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 :
11 : #ifndef CCU_RES_PACK_H
12 : #define CCU_RES_PACK_H
13 :
14 : #include "ccu_types.h"
15 : #include "ccu_res_desc.h"
16 : #include "ccu_device_pub.h"
17 :
18 : namespace hcomm {
19 :
20 : class CcuResPack {
21 : public:
22 1564 : explicit CcuResPack() {};
23 : ~CcuResPack();
24 : // 基于实例类型初始化
25 : CcuResult InitByInsType(const CcuInstanceType insType);
26 : // 基于资源描述符数组初始化(资源数量由 resDesc 驱动,与 Init 的 insType 路径区分)
27 : CcuResult InitByResDescs(const CcuResDesc* descs[], uint32_t descNum);
28 : CcuResult Reset();
29 :
30 : CcuResRepository& GetCcuResRepo();
31 :
32 : private:
33 : CcuResPack(const CcuResPack& that) = delete;
34 : CcuResPack& operator=(const CcuResPack& that) = delete;
35 : CcuResPack(CcuResPack&& that) = delete;
36 : CcuResPack& operator=(CcuResPack&& that) = delete;
37 :
38 : int32_t devLogicId_{0};
39 : CcuResHandle resHandle_{nullptr};
40 : CcuResRepository resRepo_{};
41 : };
42 :
43 : } // namespace hcomm
44 :
45 : #endif // CCU_RES_PACK_H
|