LCOV - code coverage report
Current view: top level - data/include/entity - data_type.inl (source / functions) Hit Total Coverage
Test: crystal-facet-uml_v1.65.6_covts Lines: 43 43 100.0 %
Date: 2025-09-25 21:07:53 Functions: 13 13 100.0 %

          Line data    Source code
       1             : /* File: data_type.inl; Copyright and License: see below */
       2             : 
       3          12 : static inline void data_type_init_void ( data_type_t *this_ )
       4             : {
       5          12 :     (*this_).context = DATA_TABLE_VOID;
       6          12 :     (*this_).specific_type = -1;
       7          12 : }
       8             : 
       9           6 : static inline void data_type_init_diagram ( data_type_t *this_, data_diagram_type_t type )
      10             : {
      11           6 :     (*this_).context = DATA_TABLE_DIAGRAM;
      12           6 :     (*this_).specific_type = (int) type;
      13           6 : }
      14             : 
      15           4 : static inline void data_type_init_classifier ( data_type_t *this_, data_classifier_type_t type )
      16             : {
      17           4 :     (*this_).context = DATA_TABLE_CLASSIFIER;
      18           4 :     (*this_).specific_type = (int) type;
      19           4 : }
      20             : 
      21           4 : static inline void data_type_init_feature ( data_type_t *this_, data_feature_type_t type )
      22             : {
      23           4 :     (*this_).context = DATA_TABLE_FEATURE;
      24           4 :     (*this_).specific_type = (int) type;
      25           4 : }
      26             : 
      27           3 : static inline void data_type_init_relationship ( data_type_t *this_, data_relationship_type_t type )
      28             : {
      29           3 :     (*this_).context = DATA_TABLE_RELATIONSHIP;
      30           3 :     (*this_).specific_type = (int) type;
      31           3 : }
      32             : 
      33          10 : static inline void data_type_destroy ( data_type_t *this_ )
      34             : {
      35          10 : }
      36             : 
      37           9 : static inline data_table_t data_type_get_context ( const data_type_t *this_ )
      38             : {
      39           9 :     return ( (*this_).context );
      40             : }
      41             : 
      42          15 : static inline int data_type_get_type_as_int ( const data_type_t *this_ )
      43             : {
      44          15 :     return ( (*this_).specific_type );
      45             : }
      46             : 
      47           2 : static inline const data_diagram_type_t data_type_get_diagram_type ( const data_type_t *this_ )
      48             : {
      49           2 :     return ( ((*this_).context == DATA_TABLE_DIAGRAM)
      50             :         ? (data_diagram_type_t) (*this_).specific_type
      51           2 :         : DATA_DIAGRAM_TYPE_VOID );
      52             : }
      53             : 
      54           2 : static inline data_classifier_type_t data_type_get_classifier_type ( const data_type_t *this_ )
      55             : {
      56           2 :     return ( ((*this_).context == DATA_TABLE_CLASSIFIER)
      57             :         ? (data_diagram_type_t) (*this_).specific_type
      58           2 :         : DATA_CLASSIFIER_TYPE_VOID );
      59             : }
      60             : 
      61           3 : static inline data_feature_type_t data_type_get_feature_type ( const data_type_t *this_ )
      62             : {
      63           3 :     return ( ((*this_).context == DATA_TABLE_FEATURE)
      64             :         ? (data_diagram_type_t) (*this_).specific_type
      65           3 :         : DATA_FEATURE_TYPE_VOID );
      66             : }
      67             : 
      68           3 : static inline data_relationship_type_t data_type_get_relationship_type ( const data_type_t *this_ )
      69             : {
      70           3 :     return ( ((*this_).context == DATA_TABLE_RELATIONSHIP)
      71             :         ? (data_diagram_type_t) (*this_).specific_type
      72           3 :         : DATA_RELATIONSHIP_TYPE_VOID );
      73             : }
      74             : 
      75           5 : static inline bool data_type_equals ( const data_type_t *this_, const data_type_t *that )
      76             : {
      77           5 :     return ( ( (*this_).context != DATA_TABLE_VOID )
      78           4 :         && ( (*this_).context == (*that).context )
      79           3 :         && ( (*this_).specific_type != -1 )
      80           9 :         && ( (*this_).specific_type == (*that).specific_type ) );
      81             : }
      82             : 
      83             : 
      84             : /*
      85             : Copyright 2023-2025 Andreas Warnke
      86             : 
      87             : Licensed under the Apache License, Version 2.0 (the "License");
      88             : you may not use this file except in compliance with the License.
      89             : You may obtain a copy of the License at
      90             : 
      91             :     http://www.apache.org/licenses/LICENSE-2.0
      92             : 
      93             : Unless required by applicable law or agreed to in writing, software
      94             : distributed under the License is distributed on an "AS IS" BASIS,
      95             : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      96             : See the License for the specific language governing permissions and
      97             : limitations under the License.
      98             : */

Generated by: LCOV version 1.16