Line data Source code
1 : /* File: data_change_message.inl; Copyright and License: see below */ 2 : 3 : #include "u8/u8_log.h" 4 : 5 2871 : 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 2871 : (*this_).event = event; 11 2871 : (*this_).modified = modified; 12 2871 : (*this_).parent = parent; 13 2871 : } 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 2871 : static inline void data_change_message_destroy ( data_change_message_t *this_ ) 26 : { 27 2871 : } 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 2871 : static inline void data_change_message_trace ( const data_change_message_t *this_ ) 45 : { 46 2871 : U8_TRACE_INFO( "data_change_message_t" ); 47 2871 : switch ( (*this_).event ) 48 : { 49 2368 : case DATA_CHANGE_EVENT_TYPE_CREATE: 50 : { 51 2368 : U8_TRACE_INFO("- event: DATA_CHANGE_EVENT_TYPE_CREATE"); 52 : } 53 2368 : 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 2 : case DATA_CHANGE_EVENT_TYPE_MULTI: 68 : { 69 2 : U8_TRACE_INFO("- event: DATA_CHANGE_EVENT_TYPE_MULTI"); 70 : } 71 2 : 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 0 : default: 92 : { 93 0 : U8_LOG_ERROR("- event: out of range"); 94 : } 95 0 : break; 96 : } 97 2871 : U8_TRACE_INFO( "- modified:" ); 98 2871 : data_id_trace( &((*this_).modified) ); 99 2871 : U8_TRACE_INFO( "- parent:" ); 100 2871 : data_id_trace( &((*this_).parent) ); 101 2871 : } 102 : 103 : 104 : /* 105 : Copyright 2018-2024 Andreas Warnke 106 : 107 : Licensed under the Apache License, Version 2.0 (the "License"); 108 : you may not use this file except in compliance with the License. 109 : You may obtain a copy of the License at 110 : 111 : http://www.apache.org/licenses/LICENSE-2.0 112 : 113 : Unless required by applicable law or agreed to in writing, software 114 : distributed under the License is distributed on an "AS IS" BASIS, 115 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 116 : See the License for the specific language governing permissions and 117 : limitations under the License. 118 : */