LCOV - code coverage report
Current view: top level - ctrl/include/consistency - consistency_stat.inl (source / functions) Coverage Total Hit
Test: crystal-facet-uml_v1.70.2_covts Lines: 93.2 % 59 55
Test Date: 2026-05-03 11:56:31 Functions: 100.0 % 17 17

            Line data    Source code
       1              : /* File: consistency_stat.inl; Copyright and License: see below */
       2              : 
       3              : #include "utf8stringbuf/utf8stringbuf.h"
       4              : #include "u8/u8_trace.h"
       5              : #include <assert.h>
       6              : 
       7           14 : static inline void consistency_stat_init ( consistency_stat_t *this_ )
       8              : {
       9           14 :     *this_ = CONSISTENCY_STAT_ZERO;
      10           14 : }
      11              : 
      12           15 : static inline void consistency_stat_destroy ( consistency_stat_t *this_ )
      13              : {
      14           15 : }
      15              : 
      16           17 : static inline int32_t consistency_stat_get_total_count ( const consistency_stat_t *this_ )
      17              : {
      18           17 :     const int32_t result
      19           17 :         = (*this_).classifiers + (*this_).features + (*this_).lifelines + (*this_).relationships;
      20           17 :     return result;
      21              : }
      22              : 
      23           10 : static inline void consistency_stat_transfer_to ( const consistency_stat_t *this_, data_stat_t *io_target )
      24              : {
      25           10 :     assert( NULL != io_target );
      26           10 :     if ( (*this_).classifiers > 0 )
      27              :     {
      28            0 :         data_stat_add_count ( io_target, DATA_STAT_TABLE_CLASSIFIER, DATA_STAT_SERIES_CREATED, (*this_).classifiers );
      29              :     }
      30              :     else
      31              :     {
      32           10 :         data_stat_add_count ( io_target, DATA_STAT_TABLE_CLASSIFIER, DATA_STAT_SERIES_DELETED, -((*this_).classifiers) );
      33              :     }
      34           10 :     if ( (*this_).features > 0 )
      35              :     {
      36            0 :         data_stat_add_count ( io_target, DATA_STAT_TABLE_FEATURE, DATA_STAT_SERIES_CREATED, (*this_).features );
      37              :     }
      38              :     else
      39              :     {
      40           10 :         data_stat_add_count ( io_target, DATA_STAT_TABLE_FEATURE, DATA_STAT_SERIES_DELETED, -((*this_).features) );
      41              :     }
      42           10 :     if ( (*this_).lifelines > 0 )
      43              :     {
      44            0 :         data_stat_add_count ( io_target, DATA_STAT_TABLE_LIFELINE, DATA_STAT_SERIES_CREATED, (*this_).lifelines );
      45              :     }
      46              :     else
      47              :     {
      48           10 :         data_stat_add_count ( io_target, DATA_STAT_TABLE_LIFELINE, DATA_STAT_SERIES_DELETED, -((*this_).lifelines) );
      49              :     }
      50           10 :     if ( (*this_).relationships > 0 )
      51              :     {
      52            0 :         data_stat_add_count ( io_target, DATA_STAT_TABLE_RELATIONSHIP, DATA_STAT_SERIES_CREATED, (*this_).relationships );
      53              :     }
      54              :     else
      55              :     {
      56           10 :         data_stat_add_count ( io_target, DATA_STAT_TABLE_RELATIONSHIP, DATA_STAT_SERIES_DELETED, -((*this_).relationships) );
      57              :     }
      58           10 : }
      59              : 
      60            1 : static inline void consistency_stat_increment_classifiers ( consistency_stat_t *this_ )
      61              : {
      62            1 :     (*this_).classifiers ++;
      63            1 : }
      64              : 
      65            5 : static inline void consistency_stat_decrement_classifiers ( consistency_stat_t *this_ )
      66              : {
      67            5 :     (*this_).classifiers --;
      68            5 : }
      69              : 
      70            4 : static inline int32_t consistency_stat_get_classifiers ( const consistency_stat_t *this_ )
      71              : {
      72            4 :     return (*this_).classifiers;
      73              : }
      74              : 
      75            1 : static inline void consistency_stat_increment_features ( consistency_stat_t *this_ )
      76              : {
      77            1 :     (*this_).features ++;
      78            1 : }
      79              : 
      80            9 : static inline void consistency_stat_decrement_features ( consistency_stat_t *this_ )
      81              : {
      82            9 :     (*this_).features --;
      83            9 : }
      84              : 
      85           26 : static inline int32_t consistency_stat_get_features ( const consistency_stat_t *this_ )
      86              : {
      87           26 :     return (*this_).features;
      88              : }
      89              : 
      90            5 : static inline void consistency_stat_increment_lifelines ( consistency_stat_t *this_ )
      91              : {
      92            5 :     (*this_).lifelines ++;
      93            5 : }
      94              : 
      95           11 : static inline void consistency_stat_decrement_lifelines ( consistency_stat_t *this_ )
      96              : {
      97           11 :     (*this_).lifelines --;
      98           11 : }
      99              : 
     100           12 : static inline int32_t consistency_stat_get_lifelines ( const consistency_stat_t *this_ )
     101              : {
     102           12 :     return (*this_).lifelines;
     103              : }
     104              : 
     105            1 : static inline void consistency_stat_increment_relationships ( consistency_stat_t *this_ )
     106              : {
     107            1 :     (*this_).relationships ++;
     108            1 : }
     109              : 
     110            3 : static inline void consistency_stat_decrement_relationships ( consistency_stat_t *this_ )
     111              : {
     112            3 :     (*this_).relationships --;
     113            3 : }
     114              : 
     115           19 : static inline void consistency_stat_subtract_relationships ( consistency_stat_t *this_, int32_t deleted_relationships )
     116              : {
     117           19 :     (*this_).relationships -= deleted_relationships;
     118           19 : }
     119              : 
     120            5 : static inline int32_t consistency_stat_get_relationships ( const consistency_stat_t *this_ )
     121              : {
     122            5 :     return (*this_).relationships;
     123              : }
     124              : 
     125              : static inline void consistency_stat_trace ( const consistency_stat_t *this_ )
     126              : {
     127              :     U8_TRACE_INFO_INT_INT( "consistency_stat_t[CLAS,REL] ", (*this_).classifiers, (*this_).relationships );
     128              :     U8_TRACE_INFO_INT_INT( "consistency_stat_t[FEAT,LIFE]", (*this_).features, (*this_).lifelines );
     129              : }
     130              : 
     131              : 
     132              : /*
     133              : Copyright 2026-2026 Andreas Warnke
     134              : 
     135              : Licensed under the Apache License, Version 2.0 (the "License");
     136              : you may not use this file except in compliance with the License.
     137              : You may obtain a copy of the License at
     138              : 
     139              :     http://www.apache.org/licenses/LICENSE-2.0
     140              : 
     141              : Unless required by applicable law or agreed to in writing, software
     142              : distributed under the License is distributed on an "AS IS" BASIS,
     143              : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     144              : See the License for the specific language governing permissions and
     145              : limitations under the License.
     146              : */
        

Generated by: LCOV version 2.0-1