]> gerrit.simantics Code Review - simantics/fmil.git/blob - org.simantics.fmil.core/native/FMILibrary/src/XML/src/FMI2/fmi2_xml_unit_impl.h
Switch to full JavaSE-11+ compatibility
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / XML / src / FMI2 / fmi2_xml_unit_impl.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 #ifndef FMI2_XML_UNITIMPL_H
17 #define FMI2_XML_UNITIMPL_H
18
19 #include <JM/jm_vector.h>
20 #include <JM/jm_named_ptr.h>
21 #include "FMI2/fmi2_xml_model_description.h"
22 #include "fmi2_xml_parser.h"
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 /* Structure encapsulating base unit information */
28
29 struct fmi2_xml_display_unit_t {
30     double factor;
31     double offset;
32     fmi2_xml_unit_t* baseUnit;
33     char displayUnit[1];
34 };
35
36 struct fmi2_xml_unit_t {
37         jm_vector(jm_voidp) displayUnits;
38                 int SI_base_unit_exp[fmi2_SI_base_units_Num];
39                 double factor;
40                 double offset;
41         fmi2_xml_display_unit_t defaultDisplay;
42         char baseUnit[1];
43 };
44
45 struct fmi2_xml_unit_definitions_t {
46     jm_vector(jm_named_ptr) definitions;
47 };
48
49 fmi2_xml_display_unit_t* fmi2_xml_get_parsed_unit(fmi2_xml_parser_context_t *context, jm_vector(char)* name, int sorted);
50
51 #ifdef __cplusplus
52 }
53 #endif
54
55 #endif /* FMI2_XML_UNITIMPL_H */