LCOV - code coverage report
Current view: top level - legacy/ascend950/framework/resource_manager/notify/aicpu - cnt_1ton_notify_lite_mgr.cc (source / functions) Coverage Total Hit
Test: coverage.info Lines: 61.9 % 21 13
Test Date: 2026-08-18 17:47:01 Functions: 33.3 % 3 1

            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              : #include "cnt_1ton_notify_lite_mgr.h"
      12              : #include "binary_stream.h"
      13              : #include "log.h"
      14              : #include "stl_util.h"
      15              : 
      16              : namespace Hccl {
      17              : 
      18            0 : Cnt1tonNotifyLite* Cnt1tonNotifyLiteMgr::Get(u32 postQId, u32 topicId)
      19              : {
      20            0 :     auto key = std::make_pair(postQId, topicId);
      21            0 :     if (!Contain(notifys, key)) {
      22            0 :         HCCL_WARNING("Cnt1tonNotifyLiteMgr::%s can not find key[%u][%u]", __func__, postQId, topicId);
      23            0 :         return nullptr;
      24              :     }
      25            0 :     HCCL_INFO("Cnt1tonNotifyLiteMgr::%s postQId [%u] topicId [%u]", __func__, postQId, topicId);
      26            0 :     return notifys[key].get();
      27              : }
      28              : 
      29            0 : void Cnt1tonNotifyLiteMgr::Reset() { notifys.clear(); }
      30              : 
      31            1 : void Cnt1tonNotifyLiteMgr::ParsePackedData(std::vector<char>& data)
      32              : {
      33              :     u32 poolSize;
      34            1 :     BinaryStream binaryStream(data);
      35            1 :     binaryStream >> poolSize;
      36              : 
      37            4 :     for (u32 idx = 0; idx < poolSize; idx++) {
      38            3 :         std::pair<u32, u32> key;
      39            3 :         binaryStream >> key.first;
      40            3 :         binaryStream >> key.second;
      41            3 :         std::vector<char> uniqueId;
      42            3 :         binaryStream >> uniqueId;
      43            3 :         if (!Contain(notifys, key)) {
      44            3 :             notifys[key] = std::make_unique<Cnt1tonNotifyLite>(uniqueId);
      45              :         }
      46            3 :     }
      47            1 : }
      48              : 
      49              : } // namespace Hccl
        

Generated by: LCOV version 2.0-1