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