Line data Source code
1 : /* File: data_change_message.inl; Copyright and License: see below */
2 :
3 : #include "u8/u8_log.h"
4 :
5 2133 : static inline void data_change_message_init ( data_change_message_t *this_,
6 : data_change_event_type_t event,
7 : data_id_t modified,
8 : data_id_t parent )
9 : {
10 2133 : (*this_).event = event;
11 2133 : (*this_).modified = modified;
12 2133 : (*this_).parent = parent;
13 2133 : }
14 :
15 : static inline void data_change_message_reinit ( data_change_message_t *this_,
16 : data_change_event_type_t event,
17 : data_id_t modified,
18 : data_id_t parent )
19 : {
20 : (*this_).event = event;
21 : (*this_).modified = modified;
22 : (*this_).parent = parent;
23 : }
24 :
25 2133 : static inline void data_change_message_destroy ( data_change_message_t *this_ )
26 : {
27 2133 : }
28 :
29 0 : static inline data_change_event_type_t data_change_message_get_event ( const data_change_message_t *this_ )
30 : {
31 0 : return (*this_).event;
32 : }
33 :
34 0 : static inline data_id_t data_change_message_get_modified ( const data_change_message_t *this_ )
35 : {
36 0 : return (*this_).modified;
37 : }
38 :
39 : static inline data_id_t data_change_message_get_parent ( const data_change_message_t *this_ )
40 : {
41 : return (*this_).parent;
42 : }
43 :
44 2133 : static inline void data_change_message_trace ( const data_change_message_t *this_ )
45 : {
46 2133 : U8_TRACE_INFO( "data_change_message_t" );
47 2133 : switch ( (*this_).event )
48 : {
49 1473 : case DATA_CHANGE_EVENT_TYPE_CREATE:
50 : {
51 1473 : U8_TRACE_INFO("- event: DATA_CHANGE_EVENT_TYPE_CREATE");
52 : }
53 1473 : break;
54 :
55 135 : case DATA_CHANGE_EVENT_TYPE_UPDATE:
56 : {
57 135 : U8_TRACE_INFO("- event: DATA_CHANGE_EVENT_TYPE_UPDATE");
58 : }
59 135 : break;
60 :
61 177 : case DATA_CHANGE_EVENT_TYPE_DELETE:
62 : {
63 177 : U8_TRACE_INFO("- event: DATA_CHANGE_EVENT_TYPE_DELETE");
64 : }
65 177 : break;
66 :
67 3 : case DATA_CHANGE_EVENT_TYPE_MULTI:
68 : {
69 3 : U8_TRACE_INFO("- event: DATA_CHANGE_EVENT_TYPE_MULTI");
70 : }
71 3 : break;
72 :
73 63 : case DATA_CHANGE_EVENT_TYPE_DB_OPENED:
74 : {
75 63 : U8_TRACE_INFO("- event: DATA_CHANGE_EVENT_TYPE_DB_OPENED");
76 : }
77 63 : break;
78 :
79 63 : case DATA_CHANGE_EVENT_TYPE_DB_PREPARE_CLOSE:
80 : {
81 63 : U8_TRACE_INFO("- event: DATA_CHANGE_EVENT_TYPE_DB_PREPARE_CLOSE");
82 : }
83 63 : break;
84 :
85 63 : case DATA_CHANGE_EVENT_TYPE_DB_CLOSED:
86 : {
87 63 : U8_TRACE_INFO("- event: DATA_CHANGE_EVENT_TYPE_DB_CLOSED");
88 : }
89 63 : break;
90 :
91 156 : case DATA_CHANGE_EVENT_TYPE_REVISION_CHANGED:
92 : {
93 156 : U8_TRACE_INFO("- event: DATA_CHANGE_EVENT_TYPE_REVISION_CHANGED");
94 : }
95 156 : break;
96 :
97 0 : default:
98 : {
99 0 : U8_LOG_ERROR("- event: out of range");
100 : }
101 0 : break;
102 : }
103 2133 : U8_TRACE_INFO( "- modified:" );
104 2133 : data_id_trace( &((*this_).modified) );
105 2133 : U8_TRACE_INFO( "- parent:" );
106 2133 : data_id_trace( &((*this_).parent) );
107 2133 : }
108 :
109 :
110 : /*
111 : Copyright 2018-2025 Andreas Warnke
112 :
113 : Licensed under the Apache License, Version 2.0 (the "License");
114 : you may not use this file except in compliance with the License.
115 : You may obtain a copy of the License at
116 :
117 : http://www.apache.org/licenses/LICENSE-2.0
118 :
119 : Unless required by applicable law or agreed to in writing, software
120 : distributed under the License is distributed on an "AS IS" BASIS,
121 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
122 : See the License for the specific language governing permissions and
123 : limitations under the License.
124 : */
|