LCOV - code coverage report
Current view: top level - data/include/storage - data_change_notifier.inl (source / functions) Hit Total Coverage
Test: crystal-facet-uml_v1.57.0_covts Lines: 13 13 100.0 %
Date: 2024-04-07 11:14:42 Functions: 3 3 100.0 %

          Line data    Source code
       1             : /* File: data_change_notifier.inl; Copyright and License: see below */
       2             : 
       3             : #include "data_id.h"
       4             : #include "u8/u8_log.h"
       5             : #include <assert.h>
       6             : 
       7         304 : static inline void data_change_notifier_emit_signal_without_parent ( data_change_notifier_t *this_,
       8             :                                                                      data_change_event_type_t event_type,
       9             :                                                                      data_table_t table,
      10             :                                                                      data_row_id_t row_id )
      11             : {
      12             :     /* only classifier may be created without providing a parent object */
      13         304 :     assert( (DATA_CHANGE_EVENT_TYPE_CREATE != event_type) || (DATA_TABLE_CLASSIFIER == table) );
      14             : 
      15         304 :     data_change_notifier_emit_signal ( this_,
      16             :                                        event_type,
      17             :                                        table,
      18             :                                        row_id,
      19             :                                        DATA_TABLE_VOID,
      20             :                                        DATA_ROW_ID_VOID
      21             :                                      );
      22         304 : }
      23             : 
      24           2 : static inline void data_change_notifier_enable_stealth_mode ( data_change_notifier_t *this_ )
      25             : {
      26           2 :     (*this_).stealth_mode = true;
      27           2 : }
      28             : 
      29         114 : static inline void data_change_notifier_disable_stealth_mode ( data_change_notifier_t *this_ )
      30             : {
      31         114 :     const bool send_notification = (*this_).stealth_mode;
      32         114 :     (*this_).stealth_mode = false;
      33             : 
      34         114 :     if ( send_notification )
      35             :     {
      36             :         /* send notification that things have changed */
      37           2 :         data_change_notifier_emit_signal( this_,
      38             :                                           DATA_CHANGE_EVENT_TYPE_MULTI,
      39             :                                           DATA_TABLE_VOID,
      40             :                                           DATA_ROW_ID_VOID,
      41             :                                           DATA_TABLE_VOID,
      42             :                                           DATA_ROW_ID_VOID
      43             :                                         );
      44             :     }
      45         114 : }
      46             : 
      47             : 
      48             : /*
      49             : Copyright 2018-2024 Andreas Warnke
      50             : 
      51             : Licensed under the Apache License, Version 2.0 (the "License");
      52             : you may not use this file except in compliance with the License.
      53             : You may obtain a copy of the License at
      54             : 
      55             :     http://www.apache.org/licenses/LICENSE-2.0
      56             : 
      57             : Unless required by applicable law or agreed to in writing, software
      58             : distributed under the License is distributed on an "AS IS" BASIS,
      59             : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      60             : See the License for the specific language governing permissions and
      61             : limitations under the License.
      62             : */

Generated by: LCOV version 1.16