]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMILibrary/src/XML/include/FMI2/fmi2_xml_type.h
Add FMILibrary-2.0.3 to org.simantics.fmil.core\native.
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / XML / include / FMI2 / fmi2_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 fmi2_xml_type.h
19 *  \brief Public interface to the FMI XML C-library: variable types handling.
20 */
21
22 #ifndef FMI2_XML_TYPE_H_
23 #define FMI2_XML_TYPE_H_
24
25 #include "FMI2/fmi2_xml_model_description.h"
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31         /**
32         \addtogroup fmi2_xml
33         @{
34         \addtogroup fmi2_xml_types Support for processing variable types
35         @}
36         \addtogroup fmi2_xml_types Support for processing variable types
37         @{
38         */
39
40 fmi2_xml_display_unit_t* fmi2_xml_get_type_display_unit(fmi2_xml_real_typedef_t*);
41
42 fmi2_xml_type_definitions_t* fmi2_xml_get_type_definitions(fmi2_xml_model_description_t* md);
43
44 /* Convert base type constant to string */
45
46 unsigned int fmi2_xml_get_type_definition_number(fmi2_xml_type_definitions_t* td);
47
48 fmi2_xml_variable_typedef_t* fmi2_xml_get_typedef(fmi2_xml_type_definitions_t* td, unsigned int  index);
49
50 const char* fmi2_xml_get_type_name(fmi2_xml_variable_typedef_t*);
51
52 /* Note that NULL pointer is returned if the attribute is not present in the XML.*/
53 const char* fmi2_xml_get_type_description(fmi2_xml_variable_typedef_t*);
54
55 fmi2_base_type_enu_t fmi2_xml_get_base_type(fmi2_xml_variable_typedef_t*);
56
57 /* Boolean and String has no extra attributes -> not needed*/
58
59 fmi2_xml_real_typedef_t* fmi2_xml_get_type_as_real(fmi2_xml_variable_typedef_t*);
60 fmi2_xml_integer_typedef_t* fmi2_xml_get_type_as_int(fmi2_xml_variable_typedef_t*);
61 fmi2_xml_enumeration_typedef_t* fmi2_xml_get_type_as_enum(fmi2_xml_variable_typedef_t*);
62
63 /* Note that NULL-pointer is always returned for strings and booleans */
64 const char* fmi2_xml_get_type_quantity(fmi2_xml_variable_typedef_t*);
65
66 double fmi2_xml_get_real_type_min(fmi2_xml_real_typedef_t*);
67 double fmi2_xml_get_real_type_max(fmi2_xml_real_typedef_t*);
68 double fmi2_xml_get_real_type_nominal(fmi2_xml_real_typedef_t*);
69 fmi2_xml_unit_t* fmi2_xml_get_real_type_unit(fmi2_xml_real_typedef_t*);
70 int fmi2_xml_get_real_type_is_relative_quantity(fmi2_xml_real_typedef_t*);
71 int fmi2_xml_get_real_type_is_unbounded(fmi2_xml_real_typedef_t*);
72
73 fmi2_integer_t fmi2_xml_get_integer_type_min(fmi2_xml_integer_typedef_t*);
74 fmi2_integer_t fmi2_xml_get_integer_type_max(fmi2_xml_integer_typedef_t*);
75
76 int fmi2_xml_get_enum_type_min(fmi2_xml_enumeration_typedef_t*);
77 int fmi2_xml_get_enum_type_max(fmi2_xml_enumeration_typedef_t*);
78 unsigned int  fmi2_xml_get_enum_type_size(fmi2_xml_enumeration_typedef_t*);
79 const char* fmi2_xml_get_enum_type_item_name(fmi2_xml_enumeration_typedef_t*, unsigned int  item);
80 int fmi2_xml_get_enum_type_item_value(fmi2_xml_enumeration_typedef_t*, unsigned int  item);
81 const char* fmi2_xml_get_enum_type_item_description(fmi2_xml_enumeration_typedef_t*, unsigned int  item);
82 const char* fmi2_xml_get_enum_type_value_name(fmi2_xml_enumeration_typedef_t* t, int value);
83
84 /*
85 *  @}
86 */
87 #ifdef __cplusplus
88 }
89 #endif
90 #endif
91