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_COMMON_COMMON_COMPONENT_H
11 : #define ADX_COMMON_COMMON_COMPONENT_H
12 : #include "adx_component.h"
13 : namespace Adx {
14 : class AdxCommonComponent : public AdxComponent {
15 : public:
16 10 : AdxCommonComponent(AdxComponentInit init, AdxComponentProcess process, AdxComponentUnInit uninit,
17 20 : ComponentType componentType) : init_(init), process_(process), uninit_(uninit),
18 10 : componentType_(componentType) {}
19 : ~AdxCommonComponent() override;
20 : int32_t Init() override;
21 : const std::string GetInfo() override;
22 : ComponentType GetType() override;
23 : int32_t Process(const CommHandle &handle, const SharedPtr<MsgProto> &proto) override;
24 : int32_t UnInit() override;
25 : void SetType(ComponentType componentType);
26 : private:
27 : AdxComponentInit init_;
28 : AdxComponentProcess process_;
29 : AdxComponentUnInit uninit_;
30 : ComponentType componentType_;
31 : };
32 : }
33 : #endif // ADX_COMMON_COMMON_COMPONENT_H
|