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 16 #ifndef OHOS_STATE_H 17 #define OHOS_STATE_H 18 19 #include <iostream> 20 #include "message_queue.h" 21 22 namespace OHOS { 23 namespace Wifi { 24 class State { 25 public: 26 /** 27 * @Description Construct a new State:: State object. 28 * 29 * @param name - State name.[in] 30 */ 31 explicit State(const std::string &name); 32 33 /** 34 * @Description Destroy the State:: State object. 35 * 36 */ 37 virtual ~State(); 38 39 public: 40 virtual void GoInState() = 0; 41 virtual void GoOutState() = 0; 42 virtual bool ExecuteStateMsg(InternalMessagePtr msg) = 0; 43 44 /** 45 * @Description : Obtains state name. 46 * 47 * @return std::string 48 */ 49 std::string GetStateName(); 50 51 private: 52 std::string mStateName; 53 }; 54 } // namespace Wifi 55 } // namespace OHOS 56 #endif