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 HCOMM_CONFIG_MGR_H
12 : #define HCOMM_CONFIG_MGR_H
13 :
14 : #include "base_config.h"
15 :
16 : namespace hcomm {
17 :
18 : /**
19 : * @brief 顶层环境变量聚合配置(对齐 legacy EnvConfig)。
20 : *
21 : * 持有各子配置类(如 rdmaCfg),Parse() 统一触发各子配置解析。
22 : * 业务侧通过 HcommResMgr::GetInstance().GetConfigMgr().GetRdmaConfig() 访问
23 : */
24 : class ConfigMgr {
25 : public:
26 : ConfigMgr();
27 2 : ~ConfigMgr() = default;
28 :
29 : EnvRdmaConfig& GetRdmaConfig();
30 :
31 : private:
32 : ConfigMgr(const ConfigMgr&) = delete;
33 : ConfigMgr& operator=(const ConfigMgr&) = delete;
34 :
35 : // 子配置成员
36 : EnvRdmaConfig rdmaCfg_;
37 : };
38 :
39 : } // namespace hcomm
40 :
41 : #endif // HCOMM_CONFIG_MGR_H
|