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 : #ifndef DGW_IDLE_STATE_H
12 : #define DGW_IDLE_STATE_H
13 :
14 : #include "fsm/state_base.h"
15 :
16 : namespace dgw {
17 : class IdleState : public StateBase {
18 : public:
19 : explicit IdleState() noexcept = default;
20 3 : virtual ~IdleState() override = default;
21 :
22 : FsmStatus PreProcess(Entity &entity) override;
23 : FsmStatus ProcessMessage(Entity &entity, const InnerMessage &msg) override;
24 : FsmStatus PostProcess(Entity &entity) override;
25 : FsmStatus ProcessWaitingData(Entity &entity) const;
26 :
27 : private:
28 : IdleState(const IdleState &) = delete;
29 : IdleState(const IdleState &&) = delete;
30 : IdleState &operator = (const IdleState &) = delete;
31 : IdleState &operator = (IdleState &&) = delete;
32 : };
33 :
34 : class GroupIdleState : public IdleState {
35 : public:
36 : explicit GroupIdleState() noexcept = default;
37 1 : ~GroupIdleState() override = default;
38 :
39 : FsmStatus ProcessMessage(Entity &entity, const InnerMessage &msg) override;
40 : };
41 : }
42 : #endif
|