Line data Source code
1 : /**
2 : * Copyright (c) 2026 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 TSD_PACKAGE_HASH_STORE_H
12 : #define TSD_PACKAGE_HASH_STORE_H
13 :
14 : #include "hdc_message_builder.h"
15 : #include "proto/tsd_message.pb.h"
16 :
17 : #include <map>
18 : #include <string>
19 :
20 : namespace tsd {
21 :
22 : class PackageHashStore {
23 : public:
24 263 : PackageHashStore() = default;
25 263 : ~PackageHashStore() = default;
26 :
27 : void SetDeviceCommonSinkPackHashValue(const std::string& pkgName, const std::string& hashValue);
28 : std::string GetDeviceCommonSinkPackHashValue(const std::string& pkgName) const;
29 : void SetHostCommonSinkPackHashValue(const std::string& pkgName, const std::string& hashValue);
30 : std::string GetHostCommonSinkPackHashValue(const std::string& pkgName) const;
31 : bool IsCommonSinkHostAndDevicePkgSame(const std::string& pkgName) const;
32 : void StoreAllPkgHashValue(const HDCMessage& msg);
33 : void Clear();
34 :
35 : std::map<std::string, std::string> pkgHostHashValue_;
36 : std::map<std::string, std::string> pkgDeviceHashValue_;
37 : };
38 :
39 : } // namespace tsd
40 :
41 : #endif // TSD_PACKAGE_HASH_STORE_H
|