2 Copyright (C) 2012 Modelon AB
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the BSD style license.
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.
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>.
18 /** \file fmi2_xml_type.h
19 * \brief Public interface to the FMI XML C-library: variable types handling.
22 #ifndef FMI2_XML_TYPE_H_
23 #define FMI2_XML_TYPE_H_
25 #include "FMI2/fmi2_xml_model_description.h"
34 \addtogroup fmi2_xml_types Support for processing variable types
36 \addtogroup fmi2_xml_types Support for processing variable types
40 fmi2_xml_display_unit_t* fmi2_xml_get_type_display_unit(fmi2_xml_real_typedef_t*);
42 fmi2_xml_type_definitions_t* fmi2_xml_get_type_definitions(fmi2_xml_model_description_t* md);
44 /* Convert base type constant to string */
46 unsigned int fmi2_xml_get_type_definition_number(fmi2_xml_type_definitions_t* td);
48 fmi2_xml_variable_typedef_t* fmi2_xml_get_typedef(fmi2_xml_type_definitions_t* td, unsigned int index);
50 const char* fmi2_xml_get_type_name(fmi2_xml_variable_typedef_t*);
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*);
55 fmi2_base_type_enu_t fmi2_xml_get_base_type(fmi2_xml_variable_typedef_t*);
57 /* Boolean and String has no extra attributes -> not needed*/
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*);
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*);
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*);
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*);
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);