Line data Source code
1 : /* File: data_database_listener.inl; Copyright and License: see below */
2 :
3 : #include "u8/u8_trace.h"
4 : #include <assert.h>
5 :
6 234 : static inline void data_database_listener_init ( data_database_listener_t *this_,
7 : void *listener_instance,
8 : void (*listener_callback)(void* listener_instance, data_database_listener_signal_t signal_id) )
9 : {
10 234 : (*this_).listener_instance = listener_instance;
11 234 : (*this_).listener_callback = listener_callback;
12 234 : }
13 :
14 23 : static inline void data_database_listener_destroy ( data_database_listener_t *this_ )
15 : {
16 23 : (*this_).listener_instance = NULL;
17 23 : (*this_).listener_callback = NULL;
18 23 : }
19 :
20 49 : static inline void data_database_listener_notify ( data_database_listener_t *this_, data_database_listener_signal_t signal_id )
21 : {
22 49 : assert( (*this_).listener_instance != NULL );
23 49 : assert( (*this_).listener_callback != NULL );
24 49 : U8_TRACE_INFO("data_database_listener_notify()");
25 49 : ((*this_).listener_callback)( (*this_).listener_instance, signal_id );
26 49 : }
27 :
28 :
29 : /*
30 : Copyright 2016-2025 Andreas Warnke
31 :
32 : Licensed under the Apache License, Version 2.0 (the "License");
33 : you may not use this file except in compliance with the License.
34 : You may obtain a copy of the License at
35 :
36 : http://www.apache.org/licenses/LICENSE-2.0
37 :
38 : Unless required by applicable law or agreed to in writing, software
39 : distributed under the License is distributed on an "AS IS" BASIS,
40 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 : See the License for the specific language governing permissions and
42 : limitations under the License.
43 : */
|