• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025-2026 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 #include "networkslice_service_base.h"
17 #include "networkslice_loop_manager.h"
18 #include "networkslicemsgcenter.h"
19 
20 namespace OHOS {
21 namespace NetManagerStandard {
22 
NetworkSliceServiceBase(NetworkSliceSubModule moduleId)23 NetworkSliceServiceBase::NetworkSliceServiceBase(NetworkSliceSubModule moduleId)
24     : AppExecFwk::EventHandler(
25     DelayedSingleton<NetworkSlice_Loop_Manager>::GetInstance()->getLoop(OLLIE_MESSAGE_THREAD)), moduleId_(moduleId) {}
26 
27 NetworkSliceServiceBase::~NetworkSliceServiceBase() = default;
28 
Init()29 void NetworkSliceServiceBase::Init()
30 {
31     NETMGR_EXT_LOG_I("NetworkSliceServiceBase init start.");
32     Singleton<NetworkSliceMsgCenter>::GetInstance().registHandler(moduleId_, shared_from_this());
33     OnInit();
34     NETMGR_EXT_LOG_I("NetworkSliceServiceBase init end.");
35 }
36 
Subscribe(NetworkSliceEvent event)37 void NetworkSliceServiceBase::Subscribe(NetworkSliceEvent event)
38 {
39     Singleton<NetworkSliceMsgCenter>::GetInstance().Subscribe(event, moduleId_);
40 }
41 
UnSubscribe(NetworkSliceEvent event)42 void NetworkSliceServiceBase::UnSubscribe(NetworkSliceEvent event)
43 {
44     Singleton<NetworkSliceMsgCenter>::GetInstance().UnSubscribe(event, moduleId_);
45 }
46 
RecvKernelData(void * rcvMsg,int32_t dataLen)47 void NetworkSliceServiceBase::RecvKernelData(void *rcvMsg, int32_t dataLen)
48 {
49     return;
50 }
51 
52 }
53 }
54