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 NEW_PEER_INFO_H
12 : #define NEW_PEER_INFO_H
13 :
14 : #include "types.h"
15 : #include "binary_stream.h"
16 : #include "nlohmann/json.hpp"
17 :
18 : namespace Hccl {
19 :
20 : constexpr u32 MAX_PEER_LOCAL_ID = 64;
21 : class PeerInfo {
22 : public:
23 152 : PeerInfo() {};
24 683 : ~PeerInfo() {};
25 : u32 localId{0};
26 : void Deserialize(const nlohmann::json& peerInfoJson);
27 : std::string Describe() const;
28 : explicit PeerInfo(BinaryStream& binaryStream);
29 : void GetBinStream(BinaryStream& binaryStream) const;
30 : };
31 : } // namespace Hccl
32 :
33 : #endif // NEW_PEER_INFO_H
|