Line data Source code
1 : /* File: xmi_type_converter.inl; Copyright and License: see below */ 2 : 3 : #include <assert.h> 4 : 5 : /* ================================ CLASSIFIER ================================ */ 6 : 7 0 : static inline bool xmi_type_converter_can_nest_classifier ( xmi_type_converter_t *this_, 8 : data_classifier_type_t parent_type, 9 : data_classifier_type_t child_type ) 10 : { 11 : char const * xmi_name; 12 : const int err_code 13 0 : = xmi_type_converter_get_xmi_nesting_property_of_classifier ( this_, 14 : parent_type, 15 : child_type, 16 : &xmi_name 17 : ); 18 0 : return ( 0 == err_code ); 19 : } 20 : 21 0 : static inline bool xmi_type_converter_can_nest_relationship ( xmi_type_converter_t *this_, 22 : data_classifier_type_t hosting_type, 23 : data_relationship_type_t child_type ) 24 : { 25 : char const * xmi_name; 26 : const int err_code 27 0 : = xmi_type_converter_get_xmi_nesting_property_of_relationship ( this_, 28 : hosting_type, 29 : child_type, 30 : &xmi_name 31 : ); 32 0 : return ( 0 == err_code ); 33 : } 34 : 35 : /* ================================ FEATURE ================================ */ 36 : 37 : /* ================================ RELATIONSHIP ================================ */ 38 : 39 0 : static inline u8_error_t xmi_type_converter_get_xmi_from_property_of_relationship ( xmi_type_converter_t *this_, 40 : data_classifier_type_t hosting_type, 41 : data_relationship_type_t rel_type, 42 : data_classifier_type_t from_classifier_type, 43 : data_feature_type_t from_feature_type, 44 : char const * *out_xmi_name ) 45 : { 46 0 : return xmi_type_converter_private_get_xmi_end_property_of_relationship( this_, 47 : hosting_type, 48 : rel_type, 49 : true /* = from */, 50 : from_classifier_type, 51 : from_feature_type, 52 : out_xmi_name 53 : ); 54 : } 55 : 56 0 : static inline u8_error_t xmi_type_converter_get_xmi_to_property_of_relationship ( xmi_type_converter_t *this_, 57 : data_classifier_type_t hosting_type, 58 : data_relationship_type_t rel_type, 59 : data_classifier_type_t to_classifier_type, 60 : data_feature_type_t to_feature_type, 61 : char const * *out_xmi_name ) 62 : { 63 0 : return xmi_type_converter_private_get_xmi_end_property_of_relationship( this_, 64 : hosting_type, 65 : rel_type, 66 : false /* = to */, 67 : to_classifier_type, 68 : to_feature_type, 69 : out_xmi_name 70 : ); 71 : } 72 : 73 : 74 : /* 75 : Copyright 2020-2024 Andreas Warnke 76 : 77 : Licensed under the Apache License, Version 2.0 (the "License"); 78 : you may not use this file except in compliance with the License. 79 : You may obtain a copy of the License at 80 : 81 : http://www.apache.org/licenses/LICENSE-2.0 82 : 83 : Unless required by applicable law or agreed to in writing, software 84 : distributed under the License is distributed on an "AS IS" BASIS, 85 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 86 : See the License for the specific language governing permissions and 87 : limitations under the License. 88 : */