]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMILibrary/src/XML/include/FMI1/fmi1_xml_type.h
Switch to full JavaSE-11+ compatibility
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / XML / include / FMI1 / fmi1_xml_type.h
1 /*
2     Copyright (C) 2012 Modelon AB
3
4     This program is free software: you can redistribute it and/or modify
5     it under the terms of the BSD style license.
6
7      This program is distributed in the hope that it will be useful,
8     but WITHOUT ANY WARRANTY; without even the implied warranty of
9     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10     FMILIB_License.txt file for more details.
11
12     You should have received a copy of the FMILIB_License.txt file
13     along with this program. If not, contact Modelon AB <http://www.modelon.com>.
14 */
15
16
17
18 /** \file fmi1_xml_type.h
19 *  \brief Public interface to the FMI XML C-library: variable types handling.
20 */
21
22 #ifndef FMI1_XML_TYPE_H_
23 #define FMI1_XML_TYPE_H_
24
25 #include "FMI1/fmi1_xml_model_description.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31         /**
32         \addtogroup fmi1_xml
33         @{
34         \addtogroup fmi1_xml_types Support for processing variable types
35         @}
36         \addtogroup fmi1_xml_types Support for processing variable types
37         @{
38         */
39
40 fmi1_xml_display_unit_t* fmi1_xml_get_type_display_unit(fmi1_xml_real_typedef_t*);
41
42 fmi1_xml_type_definitions_t* fmi1_xml_get_type_definitions(fmi1_xml_model_description_t* md);
43
44 /* Convert base type constant to string */
45
46 size_t fmi1_xml_get_type_definition_number(fmi1_xml_type_definitions_t* td);
47
48 fmi1_xml_variable_typedef_t* fmi1_xml_get_typedef(fmi1_xml_type_definitions_t* td, unsigned int  index);
49
50 const char* fmi1_xml_get_type_name(fmi1_xml_variable_typedef_t*);
51
52 /* Note that NULL pointer is returned if the attribute is not present in the XML.*/
53 const char* fmi1_xml_get_type_description(fmi1_xml_variable_typedef_t*);
54
55 fmi1_base_type_enu_t fmi1_xml_get_base_type(fmi1_xml_variable_typedef_t*);
56
57 /* Boolean and String has no extra attributes -> not needed*/
58
59 fmi1_xml_real_typedef_t* fmi1_xml_get_type_as_real(fmi1_xml_variable_typedef_t*);
60 fmi1_xml_integer_typedef_t* fmi1_xml_get_type_as_int(fmi1_xml_variable_typedef_t*);
61 fmi1_xml_enumeration_typedef_t* fmi1_xml_get_type_as_enum(fmi1_xml_variable_typedef_t*);
62
63 /* Note that NULL-pointer is always returned for strings and booleans */
64 const char* fmi1_xml_get_type_quantity(fmi1_xml_variable_typedef_t*);
65
66 double fmi1_xml_get_real_type_min(fmi1_xml_real_typedef_t*);
67 double fmi1_xml_get_real_type_max(fmi1_xml_real_typedef_t*);
68 double fmi1_xml_get_real_type_nominal(fmi1_xml_real_typedef_t*);
69 fmi1_xml_unit_t* fmi1_xml_get_real_type_unit(fmi1_xml_real_typedef_t*);
70 int fmi1_xml_get_real_type_is_relative_quantity(fmi1_xml_real_typedef_t*);
71
72 fmi1_integer_t fmi1_xml_get_integer_type_min(fmi1_xml_integer_typedef_t*);
73 fmi1_integer_t fmi1_xml_get_integer_type_max(fmi1_xml_integer_typedef_t*);
74
75 int fmi1_xml_get_enum_type_min(fmi1_xml_enumeration_typedef_t*);
76 int fmi1_xml_get_enum_type_max(fmi1_xml_enumeration_typedef_t*);
77 unsigned int  fmi1_xml_get_enum_type_size(fmi1_xml_enumeration_typedef_t*);
78 const char* fmi1_xml_get_enum_type_item_name(fmi1_xml_enumeration_typedef_t*, unsigned int  item);
79 const char* fmi1_xml_get_enum_type_item_description(fmi1_xml_enumeration_typedef_t*, unsigned int  item);
80
81 /*
82 *  @}
83 */
84 #ifdef __cplusplus
85 }
86 #endif
87 #endif
88