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 : #ifndef ADX_DEVICE_H
11 : #define ADX_DEVICE_H
12 : #include <vector>
13 : #include <map>
14 : #include <string>
15 : namespace Adx {
16 : enum class DeviceState {
17 : NO_DEVICE_STATE,
18 : ENABLE_STATE,
19 : DISABLE_STATE,
20 : };
21 :
22 : class AdxDevice {
23 : public:
24 5 : virtual ~AdxDevice() {}
25 : virtual void GetAllEnableDevices(int32_t mode, int32_t devId, std::vector<std::string> &devices) = 0;
26 : void EnableNotify(const std::string &devId);
27 : void DisableNotify(const std::string &devId);
28 : void GetEnableDevices(std::vector<std::string> &devices) const;
29 : void GetDisableDevices(std::vector<std::string> &devices) const;
30 : bool NoDevice() const;
31 : void InitDevice(const std::string &devId);
32 : private:
33 : std::map<std::string, DeviceState> devices_;
34 : };
35 : }
36 : #endif
37 :
|