Line data Source code
1 : /* File: data_feature_type.c; Copyright and License: see below */
2 :
3 : #include "entity/data_feature_type.h"
4 : #include <stddef.h>
5 : #include <assert.h>
6 :
7 : const data_feature_type_t DATA_FEATURE_TYPE_ARRAY [DATA_FEATURE_TYPE_COUNT]
8 : = {
9 : DATA_FEATURE_TYPE_PROPERTY,
10 : DATA_FEATURE_TYPE_OPERATION,
11 : DATA_FEATURE_TYPE_PORT,
12 : DATA_FEATURE_TYPE_LIFELINE,
13 : DATA_FEATURE_TYPE_PROVIDED_INTERFACE,
14 : DATA_FEATURE_TYPE_REQUIRED_INTERFACE,
15 : DATA_FEATURE_TYPE_IN_PORT_PIN,
16 : DATA_FEATURE_TYPE_OUT_PORT_PIN,
17 : DATA_FEATURE_TYPE_ENTRY,
18 : DATA_FEATURE_TYPE_EXIT,
19 : DATA_FEATURE_TYPE_TAGGED_VALUE
20 : };
21 :
22 : static const char *const DATA_FEATURE_TYPE_NAME_ARRAY [DATA_FEATURE_TYPE_HASH_MOD]
23 : = {
24 : [ DATA_FEATURE_TYPE_PROPERTY ] = "Property",
25 : [ DATA_FEATURE_TYPE_OPERATION ] = "Operation",
26 : [ DATA_FEATURE_TYPE_PORT ] = "Port",
27 : [ DATA_FEATURE_TYPE_LIFELINE ] = "Lifeline",
28 : [ DATA_FEATURE_TYPE_PROVIDED_INTERFACE ] = "Provided Interface",
29 : [ DATA_FEATURE_TYPE_REQUIRED_INTERFACE ] = "Required Interface",
30 : [ DATA_FEATURE_TYPE_IN_PORT_PIN ] = "Input Port",
31 : [ DATA_FEATURE_TYPE_OUT_PORT_PIN ] = "Output Port",
32 : [ DATA_FEATURE_TYPE_ENTRY ] = "Entry",
33 : [ DATA_FEATURE_TYPE_EXIT ] = "Exit",
34 : [ DATA_FEATURE_TYPE_TAGGED_VALUE ] = "Tagged Value",
35 : [11] = "",
36 : [12] = "",
37 : [13] = "",
38 : [14] = "",
39 : [15] = "",
40 : };
41 :
42 350 : const char * data_feature_type_get_name( data_feature_type_t this_ )
43 : {
44 0 : const char * result
45 350 : = ( this_ == DATA_FEATURE_TYPE_VOID ) ? "" : DATA_FEATURE_TYPE_NAME_ARRAY[ this_ % DATA_FEATURE_TYPE_HASH_MOD ];
46 350 : assert( result != NULL );
47 350 : return ( result == NULL ) ? "" : result;
48 : }
49 :
50 :
51 : /*
52 : Copyright 2021-2025 Andreas Warnke
53 :
54 : Licensed under the Apache License, Version 2.0 (the "License");
55 : you may not use this file except in compliance with the License.
56 : You may obtain a copy of the License at
57 :
58 : http://www.apache.org/licenses/LICENSE-2.0
59 :
60 : Unless required by applicable law or agreed to in writing, software
61 : distributed under the License is distributed on an "AS IS" BASIS,
62 : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
63 : See the License for the specific language governing permissions and
64 : limitations under the License.
65 : */
|