1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef DEVICE_SERVICE_LISTENER_HOLDER_H
10 #define DEVICE_SERVICE_LISTENER_HOLDER_H
11 
12 #include "hdf_dlist.h"
13 #include "hdf_service_status_inner.h"
14 
15 struct ServStatListenerHolder {
16     uint16_t listenClass;
17     struct DListHead node;
18     uint64_t index;
19     int32_t (*NotifyStatus)(struct ServStatListenerHolder *holder, struct ServiceStatus *status);
20     void (*Recycle)(struct ServStatListenerHolder *holder);
21 };
22 
23 void ServStatListenerHolderinit(void);
24 
25 struct ServStatListenerHolder *ServStatListenerHolderCreate(uintptr_t listener, uint16_t listenClass);
26 void ServStatListenerHolderRelease(struct ServStatListenerHolder *holder);
27 struct ServStatListenerHolder *ServStatListenerHolderGet(uint64_t index);
28 
29 #endif /* DEVICE_SERVICE_LISTENER_HOLDER_H */
30