1 /* 2 * Copyright (C) 2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef OHOS_AP_ROOT_STATE_H 16 #define OHOS_AP_ROOT_STATE_H 17 18 #include "ap_macro.h" 19 #include "state.h" 20 21 namespace OHOS { 22 namespace Wifi { 23 class ApRootState : public State { 24 FRIEND_GTEST(ApRootState); 25 public: 26 /** 27 * @Description construction method. 28 * @param None 29 * @return None 30 */ 31 explicit ApRootState(int id = 0); 32 /** 33 * @Description destructor method. 34 * @param None 35 * @return None 36 */ 37 virtual ~ApRootState(); 38 39 public: 40 /** 41 * @Description realize pure base class method: called when enter root state. 42 * @param None 43 * @return None 44 */ 45 virtual void GoInState() override; 46 /** 47 * @Description realize pure base class method: called when exit root state. 48 * @param None 49 * @return None 50 */ 51 virtual void GoOutState() override; 52 /** 53 * @Description realize pure base class method: Messages that cannot be 54 processed in the sub-state are recorded in the root state. 55 * @param msg - message to be processed 56 * @return HANDLED:Processed successfully 57 */ 58 virtual bool ExecuteStateMsg(InternalMessagePtr msg) override; 59 60 private: 61 int m_id; 62 }; 63 } // namespace Wifi 64 } // namespace OHOS 65 66 #endif