1 /* 2 * Copyright (C) 2021-2022 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_DHCP_EVENT_SUBSCRIBER_H 17 #define OHOS_DHCP_EVENT_SUBSCRIBER_H 18 19 #include <memory> 20 #ifdef OHOS_ARCH_LITE 21 namespace OHOS { 22 namespace Wifi { 23 class DhcpEventSubscriber { 24 public: DhcpEventSubscriber()25 explicit DhcpEventSubscriber() 26 {} 27 ~DhcpEventSubscriber()28 ~DhcpEventSubscriber() 29 {} 30 }; 31 #else 32 #include "common_event_subscriber.h" 33 #include "common_event_data.h" 34 35 namespace OHOS { 36 namespace Wifi { 37 class DhcpEventSubscriber : public OHOS::EventFwk::CommonEventSubscriber { 38 public: 39 explicit DhcpEventSubscriber(const OHOS::EventFwk::CommonEventSubscribeInfo &subscribeInfo) 40 : CommonEventSubscriber(subscribeInfo) 41 {} 42 43 ~DhcpEventSubscriber() 44 {} 45 void OnReceiveEvent(const OHOS::EventFwk::CommonEventData &data) override; 46 47 private: 48 std::mutex onReceivedLock_; 49 }; 50 #endif 51 } // namespace Wifi 52 } // namespace OHOS 53 #endif