LCOV - code coverage report
Current view: top level - io/include/xmi - xmi_element_info_map.inl (source / functions) Hit Total Coverage
Test: crystal-facet-uml_v1.61.0_covts Lines: 0 310 0.0 %
Date: 2024-10-26 21:44:38 Functions: 0 3 0.0 %

          Line data    Source code
       1             : /* File: xmi_element_info_map.inl; Copyright and License: see below */
       2             : 
       3             : #include "u8/u8_trace.h"
       4             : #include "u8/u8_log.h"
       5             : #include <assert.h>
       6             : #include <stdlib.h>
       7             : 
       8             : extern const xmi_element_info_t xmi_element_info_map_unknown_type;
       9             : extern const xmi_element_info_t xmi_element_info_map_unknown_rel_type;
      10             : 
      11           0 : static inline int xmi_element_info_map_get_classifier ( const xmi_element_info_map_t *this_,
      12             :                                                         data_classifier_type_t parent_type,
      13             :                                                         data_classifier_type_t classifier_type,
      14             :                                                         const xmi_element_info_t **out_element_info )
      15             : {
      16           0 :     assert( NULL != out_element_info );
      17           0 :     const xmi_element_info_t * result = NULL;
      18             : 
      19           0 :     const bool statemachine_context = ( parent_type == DATA_CLASSIFIER_TYPE_STATE );
      20           0 :     const bool activity_context
      21           0 :         = ( parent_type == DATA_CLASSIFIER_TYPE_ACTIVITY )||( parent_type == DATA_CLASSIFIER_TYPE_DYN_INTERRUPTABLE_REGION );
      22             : 
      23           0 :     switch ( classifier_type )
      24             :     {
      25           0 :         case DATA_CLASSIFIER_TYPE_BLOCK:
      26             :         {
      27           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_BLOCK]);
      28           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_BLOCK );
      29             :         }
      30           0 :         break;
      31             : 
      32           0 :         case DATA_CLASSIFIER_TYPE_CONSTRAINT_BLOCK:
      33             :         {
      34           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_CONSTRAINT_BLOCK]);
      35           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_CONSTRAINT_BLOCK );
      36             :         }
      37           0 :         break;
      38             : 
      39           0 :         case DATA_CLASSIFIER_TYPE_REQUIREMENT:
      40             :         {
      41           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_REQUIREMENT]);
      42           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_REQUIREMENT );
      43             :         }
      44           0 :         break;
      45             : 
      46           0 :         case DATA_CLASSIFIER_TYPE_ACTOR:
      47             :         {
      48           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_ACTOR]);
      49           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_ACTOR );
      50             :         }
      51           0 :         break;
      52             : 
      53           0 :         case DATA_CLASSIFIER_TYPE_USE_CASE:
      54             :         {
      55           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_USE_CASE]);
      56           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_USE_CASE );
      57             :         }
      58           0 :         break;
      59             : 
      60           0 :         case DATA_CLASSIFIER_TYPE_SUBSYSTEM:
      61             :         {
      62           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_SUBSYSTEM]);
      63           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_SUBSYSTEM );
      64             :         }
      65           0 :         break;
      66             : 
      67           0 :         case DATA_CLASSIFIER_TYPE_ACTIVITY:
      68             :         {
      69           0 :             if ( activity_context )
      70             :             {
      71           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_STRUCTURED_ACTIVITY_NODE]);
      72           0 :                 assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_ACTIVITY );
      73             :             }
      74             :             else
      75             :             {
      76           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_ACTIVITY]);
      77           0 :                 assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_ACTIVITY );
      78             :             }
      79             :         }
      80           0 :         break;
      81             : 
      82           0 :         case DATA_CLASSIFIER_TYPE_STATE:
      83             :         {
      84           0 :             if ( statemachine_context )
      85             :             {
      86           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_STATE]);
      87           0 :                 assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_STATE );
      88             :             }
      89             :             else
      90             :             {
      91           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_STATEMACHINE]);
      92           0 :                 assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_STATE );
      93             :             }
      94             :         }
      95           0 :         break;
      96             : 
      97           0 :         case DATA_CLASSIFIER_TYPE_DIAGRAM_REFERENCE:
      98             :         {
      99           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_INTERACTION_USE]);
     100           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DIAGRAM_REFERENCE );
     101             :         }
     102           0 :         break;
     103             : 
     104           0 :         case DATA_CLASSIFIER_TYPE_NODE:
     105             :         {
     106           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_NODE]);
     107           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_NODE );
     108             :         }
     109           0 :         break;
     110             : 
     111           0 :         case DATA_CLASSIFIER_TYPE_COMPONENT:
     112             :         {
     113           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_COMPONENT]);
     114           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_COMPONENT );
     115             :         }
     116           0 :         break;
     117             : 
     118           0 :         case DATA_CLASSIFIER_TYPE_PART:
     119             :         {
     120           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_COMPONENT]);
     121           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_COMPONENT );
     122             :         }
     123           0 :         break;
     124             : 
     125           0 :         case DATA_CLASSIFIER_TYPE_INTERFACE:
     126             :         {
     127           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_INTERFACE]);
     128           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_INTERFACE );
     129             :         }
     130           0 :         break;
     131             : 
     132           0 :         case DATA_CLASSIFIER_TYPE_PACKAGE:
     133             :         {
     134           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_PACKAGE]);
     135           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_PACKAGE );
     136             :         }
     137           0 :         break;
     138             : 
     139           0 :         case DATA_CLASSIFIER_TYPE_CLASS:
     140             :         {
     141           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_CLASS]);
     142           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_CLASS );
     143             :         }
     144           0 :         break;
     145             : 
     146           0 :         case DATA_CLASSIFIER_TYPE_OBJECT:
     147             :         {
     148           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_CLASS]);
     149           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_CLASS );
     150             :         }
     151           0 :         break;
     152             : 
     153           0 :         case DATA_CLASSIFIER_TYPE_ARTIFACT:
     154             :         {
     155           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_ARTIFACT]);
     156           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_ARTIFACT );
     157             :         }
     158           0 :         break;
     159             : 
     160           0 :         case DATA_CLASSIFIER_TYPE_COMMENT:
     161             :         {
     162           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_COMMENT]);
     163           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_COMMENT );
     164             :         }
     165           0 :         break;
     166             : 
     167           0 :         case DATA_CLASSIFIER_TYPE_IMAGE:
     168             :         {
     169           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_IMAGE]);
     170           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_IMAGE );
     171             :         }
     172           0 :         break;
     173             : 
     174           0 :         case DATA_CLASSIFIER_TYPE_STEREOTYPE:
     175             :         {
     176           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_STEREOTYPE]);
     177           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_STEREOTYPE );
     178             :         }
     179           0 :         break;
     180             : 
     181           0 :         case DATA_CLASSIFIER_TYPE_DYN_INTERRUPTABLE_REGION:
     182             :         {
     183           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_INTERRUPTABLE_REGION]);
     184           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_INTERRUPTABLE_REGION );
     185             :         }
     186           0 :         break;
     187             : 
     188           0 :         case DATA_CLASSIFIER_TYPE_DYN_INITIAL_NODE:
     189             :         {
     190           0 :             if ( statemachine_context )
     191             :             {
     192           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_STATE_INITIAL_NODE]);
     193           0 :                 assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_INITIAL_NODE );
     194             :             }
     195             :             else
     196             :             {
     197           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_ACTIVITY_INITIAL_NODE]);
     198           0 :                 assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_INITIAL_NODE );
     199             :             }
     200             :         }
     201           0 :         break;
     202             : 
     203           0 :         case DATA_CLASSIFIER_TYPE_DYN_FINAL_NODE:
     204             :         {
     205           0 :             if ( statemachine_context )
     206             :             {
     207           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_STATE_FINAL_NODE]);
     208           0 :                 assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_FINAL_NODE );
     209             :             }
     210             :             else
     211             :             {
     212           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_ACTIVITY_FINAL_NODE]);
     213           0 :                 assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_FINAL_NODE );
     214             :             }
     215             :         }
     216           0 :         break;
     217             : 
     218           0 :         case DATA_CLASSIFIER_TYPE_DYN_FORK_NODE:
     219             :         {
     220           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_FORK_NODE]);
     221           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_FORK_NODE );
     222             :         }
     223           0 :         break;
     224             : 
     225           0 :         case DATA_CLASSIFIER_TYPE_DYN_JOIN_NODE:
     226             :         {
     227           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_JOIN_NODE]);
     228           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_JOIN_NODE );
     229             :         }
     230           0 :         break;
     231             : 
     232           0 :         case DATA_CLASSIFIER_TYPE_DYN_DECISION_NODE:
     233             :         {
     234           0 :             if ( statemachine_context )
     235             :             {
     236           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_STATE_DECISION_NODE]);
     237           0 :                 assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_DECISION_NODE );
     238             :             }
     239             :             else
     240             :             {
     241           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_ACTIVITY_DECISION_NODE]);
     242           0 :                 assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_DECISION_NODE );
     243             :             }
     244             :         }
     245           0 :         break;
     246             : 
     247           0 :         case DATA_CLASSIFIER_TYPE_DYN_SHALLOW_HISTORY:
     248             :         {
     249           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_SHALLOW_HISTORY]);
     250           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_SHALLOW_HISTORY );
     251             :         }
     252           0 :         break;
     253             : 
     254           0 :         case DATA_CLASSIFIER_TYPE_DYN_DEEP_HISTORY:
     255             :         {
     256           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_DEEP_HISTORY]);
     257           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_DEEP_HISTORY );
     258             :         }
     259           0 :         break;
     260             : 
     261             :         /*
     262             :         case DATA_CLASSIFIER_TYPE_DYN_PARTITION:
     263             :         {
     264             :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_PARTITION]);
     265             :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_PARTITION );
     266             :         }
     267             :         break;
     268             :         */
     269             : 
     270           0 :         case DATA_CLASSIFIER_TYPE_DYN_ACCEPT_EVENT:
     271             :         {
     272           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_ACCEPT_EVENT]);
     273           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_ACCEPT_EVENT );
     274             :         }
     275           0 :         break;
     276             : 
     277           0 :         case DATA_CLASSIFIER_TYPE_DYN_ACCEPT_TIME_EVENT:
     278             :         {
     279           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_ACCEPT_TIME_EVENT]);
     280           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_ACCEPT_TIME_EVENT );
     281             :         }
     282           0 :         break;
     283             : 
     284           0 :         case DATA_CLASSIFIER_TYPE_DYN_SEND_SIGNAL:
     285             :         {
     286           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DYN_SEND_SIGNAL]);
     287           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_DYN_SEND_SIGNAL );
     288             :         }
     289           0 :         break;
     290             : 
     291           0 :         case DATA_CLASSIFIER_TYPE_INTERACTION:
     292             :         {
     293           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_INTERACTION]);
     294           0 :             assert ( (*result).data_type_checksum == (int)DATA_CLASSIFIER_TYPE_INTERACTION );
     295             :         }
     296           0 :         break;
     297             : 
     298           0 :         default:
     299             :         {
     300           0 :             U8_LOG_ANOMALY_INT( "switch case statement for data_classifier_type_t incomplete", classifier_type );
     301             :             /* this is a possible error case that can happen when a database created with a newer version of the program is opened with this version */
     302           0 :             result = NULL;
     303             :         }
     304           0 :         break;
     305             :     }
     306             : 
     307           0 :     *out_element_info = (result==NULL) ? &xmi_element_info_map_unknown_type : result;
     308           0 :     return (result==NULL) ? U8_ERROR_NOT_FOUND : U8_ERROR_NONE;
     309             : }
     310             : 
     311           0 : static inline int xmi_element_info_map_get_feature ( const xmi_element_info_map_t *this_,
     312             :                                                      data_classifier_type_t parent_type,
     313             :                                                      data_feature_type_t feature_type,
     314             :                                                      const xmi_element_info_t **out_element_info )
     315             : {
     316           0 :     assert( NULL != out_element_info );
     317           0 :     const xmi_element_info_t * result = NULL;
     318             : 
     319           0 :     switch ( feature_type )
     320             :     {
     321           0 :         case DATA_FEATURE_TYPE_PROPERTY:
     322             :         {
     323           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_PROPERTY]);
     324           0 :             assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_PROPERTY );
     325             :         }
     326           0 :         break;
     327             : 
     328           0 :         case DATA_FEATURE_TYPE_OPERATION:
     329             :         {
     330           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_OPERATION]);
     331           0 :             assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_OPERATION );
     332             :         }
     333           0 :         break;
     334             : 
     335           0 :         case DATA_FEATURE_TYPE_PORT:
     336             :         {
     337           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_PORT]);
     338           0 :             assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_PORT );
     339             :         }
     340           0 :         break;
     341             : 
     342           0 :         case DATA_FEATURE_TYPE_IN_PORT_PIN:
     343             :         {
     344           0 :             const bool is_behavioral_parent = data_classifier_type_is_behavioral( parent_type );
     345           0 :             if ( is_behavioral_parent )
     346             :             {
     347           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_INPUT_PIN]);
     348           0 :                 assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_IN_PORT_PIN );
     349             :             }
     350             :             else
     351             :             {
     352           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_PORT]);
     353           0 :                 assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_PORT );
     354             :             }
     355             :         }
     356           0 :         break;
     357             : 
     358           0 :         case DATA_FEATURE_TYPE_OUT_PORT_PIN:
     359             :         {
     360           0 :             const bool is_behavioral_parent = data_classifier_type_is_behavioral( parent_type );
     361           0 :             if ( is_behavioral_parent )
     362             :             {
     363           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_OUTPUT_PIN]);
     364           0 :                 assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_OUT_PORT_PIN );
     365             :             }
     366             :             else
     367             :             {
     368           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_PORT]);
     369           0 :                 assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_PORT );
     370             :             }
     371             :         }
     372           0 :         break;
     373             : 
     374           0 :         case DATA_FEATURE_TYPE_ENTRY:
     375             :         {
     376           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_STATE_ENTRY]);
     377           0 :             assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_ENTRY );
     378             :         }
     379           0 :         break;
     380             : 
     381           0 :         case DATA_FEATURE_TYPE_EXIT:
     382             :         {
     383           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_STATE_EXIT]);
     384           0 :             assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_EXIT );
     385             :         }
     386           0 :         break;
     387             : 
     388           0 :         case DATA_FEATURE_TYPE_LIFELINE:
     389             :         {
     390           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_LIFELINE]);
     391           0 :             assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_LIFELINE );
     392             :         }
     393           0 :         break;
     394             : 
     395           0 :         case DATA_FEATURE_TYPE_PROVIDED_INTERFACE:
     396             :         {
     397           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_PROVIDED_INTERFACE]);
     398           0 :             assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_PROVIDED_INTERFACE );
     399             :         }
     400           0 :         break;
     401             : 
     402           0 :         case DATA_FEATURE_TYPE_REQUIRED_INTERFACE:
     403             :         {
     404           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_REQUIRED_INTERFACE]);
     405           0 :             assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_REQUIRED_INTERFACE );
     406             :         }
     407           0 :         break;
     408             : 
     409           0 :         case DATA_FEATURE_TYPE_TAGGED_VALUE:
     410             :         {
     411           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_TAGGED_VALUE]);
     412           0 :             assert ( (*result).data_type_checksum == (int)DATA_FEATURE_TYPE_TAGGED_VALUE );
     413             :         }
     414           0 :         break;
     415             : 
     416           0 :         default:
     417             :         {
     418           0 :             U8_LOG_ANOMALY_INT( "switch case statement for data_relationship_type_t incomplete", feature_type );
     419             :             /* this is a possible error case that can happen when a database created with a newer version of the program is opened with this version */
     420           0 :             result = NULL;
     421             :         }
     422           0 :         break;
     423             :     }
     424             : 
     425           0 :     *out_element_info = (result==NULL) ? &xmi_element_info_map_unknown_type : result;
     426           0 :     return (result==NULL) ? U8_ERROR_NOT_FOUND : U8_ERROR_NONE;
     427             : }
     428             : 
     429           0 : static inline int xmi_element_info_map_get_relationship ( const xmi_element_info_map_t *this_,
     430             :                                                           bool statemachine_context,
     431             :                                                           data_relationship_type_t rel_type,
     432             :                                                           const xmi_element_info_t **out_element_info )
     433             : {
     434           0 :     assert( NULL != out_element_info );
     435           0 :     const xmi_element_info_t * result = NULL;
     436             : 
     437           0 :     switch ( rel_type )
     438             :     {
     439           0 :         case DATA_RELATIONSHIP_TYPE_UML_DEPENDENCY:
     440             :         {
     441           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DEPENDENCY]);
     442           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_DEPENDENCY );
     443             :         }
     444           0 :         break;
     445             : 
     446           0 :         case DATA_RELATIONSHIP_TYPE_UML_ASSOCIATION:
     447             :         {
     448           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_ASSOCIATION]);
     449           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_ASSOCIATION );
     450             :         }
     451           0 :         break;
     452             : 
     453           0 :         case DATA_RELATIONSHIP_TYPE_UML_AGGREGATION:
     454             :         {
     455           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_AGGREGATION]);
     456           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_AGGREGATION );
     457             :         }
     458           0 :         break;
     459             : 
     460           0 :         case DATA_RELATIONSHIP_TYPE_UML_COMPOSITION:
     461             :         {
     462           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_COMPOSITION]);
     463           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_COMPOSITION );
     464             :         }
     465           0 :         break;
     466             : 
     467           0 :         case DATA_RELATIONSHIP_TYPE_UML_GENERALIZATION:
     468             :         {
     469           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_GENERALIZATION]);
     470           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_GENERALIZATION );
     471             :         }
     472           0 :         break;
     473             : 
     474           0 :         case DATA_RELATIONSHIP_TYPE_UML_REALIZATION:
     475             :         {
     476           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_REALIZATION]);
     477           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_REALIZATION );
     478             :         }
     479           0 :         break;
     480             : 
     481           0 :         case DATA_RELATIONSHIP_TYPE_UML_ASYNC_CALL:
     482             :         {
     483           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_ASYNC_CALL]);
     484           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_ASYNC_CALL );
     485             :         }
     486           0 :         break;
     487             : 
     488           0 :         case DATA_RELATIONSHIP_TYPE_UML_SYNC_CALL:
     489             :         {
     490           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_SYNC_CALL]);
     491           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_SYNC_CALL );
     492             :         }
     493           0 :         break;
     494             : 
     495           0 :         case DATA_RELATIONSHIP_TYPE_UML_RETURN_CALL:
     496             :         {
     497           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_RETURN_CALL]);
     498           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_RETURN_CALL );
     499             :         }
     500           0 :         break;
     501             : 
     502           0 :         case DATA_RELATIONSHIP_TYPE_UML_COMMUNICATION_PATH:
     503             :         {
     504           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_COMMUNICATION_PATH]);
     505           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_COMMUNICATION_PATH );
     506             :         }
     507           0 :         break;
     508             : 
     509           0 :         case DATA_RELATIONSHIP_TYPE_UML_CONTROL_FLOW:
     510             :         {
     511           0 :             if ( statemachine_context )
     512             :             {
     513           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_TRANSITION]);
     514           0 :                 assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_CONTROL_FLOW );
     515             :             }
     516             :             else
     517             :             {
     518           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_CONTROL_FLOW]);
     519           0 :                 assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_CONTROL_FLOW );
     520             :             }
     521             :         }
     522           0 :         break;
     523             : 
     524           0 :         case DATA_RELATIONSHIP_TYPE_UML_OBJECT_FLOW:
     525             :         {
     526           0 :             if ( statemachine_context )
     527             :             {
     528           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_TRANSITION]);
     529           0 :                 assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_CONTROL_FLOW ); /*mix on purpose*/
     530             :             }
     531             :             else
     532             :             {
     533           0 :                 result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_OBJECT_FLOW]);
     534           0 :                 assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_OBJECT_FLOW );
     535             :             }
     536             :         }
     537           0 :         break;
     538             : 
     539           0 :         case DATA_RELATIONSHIP_TYPE_UML_DEPLOY:
     540             :         {
     541           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_DEPLOY]);
     542           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_DEPLOY );
     543             :         }
     544           0 :         break;
     545             : 
     546           0 :         case DATA_RELATIONSHIP_TYPE_UML_MANIFEST:
     547             :         {
     548           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_MANIFEST]);
     549           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_MANIFEST );
     550             :         }
     551           0 :         break;
     552             : 
     553           0 :         case DATA_RELATIONSHIP_TYPE_UML_EXTEND:
     554             :         {
     555           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_EXTEND]);
     556           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_EXTEND );
     557             :         }
     558           0 :         break;
     559             : 
     560           0 :         case DATA_RELATIONSHIP_TYPE_UML_INCLUDE:
     561             :         {
     562           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_INCLUDE]);
     563           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_INCLUDE );
     564             :         }
     565           0 :         break;
     566             : 
     567           0 :         case DATA_RELATIONSHIP_TYPE_UML_CONTAINMENT:
     568             :         {
     569           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_CONTAINMENT]);
     570           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_CONTAINMENT );
     571             :         }
     572           0 :         break;
     573             : 
     574           0 :         case DATA_RELATIONSHIP_TYPE_UML_REFINE:
     575             :         {
     576           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_REFINE]);
     577           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_REFINE );
     578             :         }
     579           0 :         break;
     580             : 
     581           0 :         case DATA_RELATIONSHIP_TYPE_UML_TRACE:
     582             :         {
     583           0 :             result = &((*this_)[XMI_ELEMENT_INFO_MAP_INDEX_TRACE]);
     584           0 :             assert ( (*result).data_type_checksum == (int)DATA_RELATIONSHIP_TYPE_UML_TRACE );
     585             :         }
     586           0 :         break;
     587             : 
     588           0 :         default:
     589             :         {
     590           0 :             U8_LOG_ANOMALY_INT( "switch case statement for data_relationship_type_t incomplete", rel_type );
     591             :             /* this is a possible error case that can happen when */
     592             :             /* a database created with a newer version of the program is opened with this version */
     593           0 :             result = NULL;
     594             :         }
     595           0 :         break;
     596             :     }
     597             : 
     598           0 :     *out_element_info = (result==NULL) ? &xmi_element_info_map_unknown_rel_type : result;
     599           0 :     return (result==NULL) ? U8_ERROR_NOT_FOUND : U8_ERROR_NONE;
     600             : }
     601             : 
     602             : 
     603             : /*
     604             : Copyright 2020-2024 Andreas Warnke
     605             : 
     606             : Licensed under the Apache License, Version 2.0 (the "License");
     607             : you may not use this file except in compliance with the License.
     608             : You may obtain a copy of the License at
     609             : 
     610             :     http://www.apache.org/licenses/LICENSE-2.0
     611             : 
     612             : Unless required by applicable law or agreed to in writing, software
     613             : distributed under the License is distributed on an "AS IS" BASIS,
     614             : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     615             : See the License for the specific language governing permissions and
     616             : limitations under the License.
     617             : */

Generated by: LCOV version 1.16