fmi2TypesPlatform.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef fmi2TypesPlatform_h
  2. #define fmi2TypesPlatform_h
  3. /* Standard header file to define the argument types of the
  4. functions of the Functional Mock-up Interface 2.0.
  5. This header file must be utilized both by the model and
  6. by the simulation engine.
  7. Revisions:
  8. - Apr. 9, 2014: all prefixes "fmi" renamed to "fmi2" (decision from April 8)
  9. - Mar 31, 2014: New datatype fmiChar introduced.
  10. - Feb. 17, 2013: Changed fmiTypesPlatform from "standard32" to "default".
  11. Removed fmiUndefinedValueReference since no longer needed
  12. (because every state is defined in ScalarVariables).
  13. - March 20, 2012: Renamed from fmiPlatformTypes.h to fmiTypesPlatform.h
  14. - Nov. 14, 2011: Use the header file "fmiPlatformTypes.h" for FMI 2.0
  15. both for "FMI for model exchange" and for "FMI for co-simulation"
  16. New types "fmiComponentEnvironment", "fmiState", and "fmiByte".
  17. The implementation of "fmiBoolean" is change from "char" to "int".
  18. The #define "fmiPlatform" changed to "fmiTypesPlatform"
  19. (in order that #define and function call are consistent)
  20. - Oct. 4, 2010: Renamed header file from "fmiModelTypes.h" to fmiPlatformTypes.h"
  21. for the co-simulation interface
  22. - Jan. 4, 2010: Renamed meModelTypes_h to fmiModelTypes_h (by Mauss, QTronic)
  23. - Dec. 21, 2009: Changed "me" to "fmi" and "meModel" to "fmiComponent"
  24. according to meeting on Dec. 18 (by Martin Otter, DLR)
  25. - Dec. 6, 2009: Added meUndefinedValueReference (by Martin Otter, DLR)
  26. - Sept. 9, 2009: Changes according to FMI-meeting on July 21:
  27. Changed "version" to "platform", "standard" to "standard32",
  28. Added a precise definition of "standard32" as comment
  29. (by Martin Otter, DLR)
  30. - July 19, 2009: Added "me" as prefix to file names, added meTrue/meFalse,
  31. and changed meValueReferenced from int to unsigned int
  32. (by Martin Otter, DLR).
  33. - March 2, 2009: Moved enums and function pointer definitions to
  34. ModelFunctions.h (by Martin Otter, DLR).
  35. - Dec. 3, 2008 : First version by Martin Otter (DLR) and
  36. Hans Olsson (Dynasim).
  37. Copyright (C) 2008-2011 MODELISAR consortium,
  38. 2012-2013 Modelica Association Project "FMI"
  39. All rights reserved.
  40. This file is licensed by the copyright holders under the BSD 2-Clause License
  41. (http://www.opensource.org/licenses/bsd-license.html):
  42. ----------------------------------------------------------------------------
  43. Redistribution and use in source and binary forms, with or without
  44. modification, are permitted provided that the following conditions are met:
  45. - Redistributions of source code must retain the above copyright notice,
  46. this list of conditions and the following disclaimer.
  47. - Redistributions in binary form must reproduce the above copyright notice,
  48. this list of conditions and the following disclaimer in the documentation
  49. and/or other materials provided with the distribution.
  50. - Neither the name of the copyright holders nor the names of its
  51. contributors may be used to endorse or promote products derived
  52. from this software without specific prior written permission.
  53. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  54. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  55. TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  56. PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
  57. CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  58. EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  59. PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  60. OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  61. WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  62. OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  63. ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  64. ----------------------------------------------------------------------------
  65. with the extension:
  66. You may distribute or publicly perform any modification only under the
  67. terms of this license.
  68. (Note, this means that if you distribute a modified file,
  69. the modified file must also be provided under this license).
  70. */
  71. /* Platform (unique identification of this header file) */
  72. #define fmi2TypesPlatform "default"
  73. /* Type definitions of variables passed as arguments
  74. Version "default" means:
  75. fmi2Component : an opaque object pointer
  76. fmi2ComponentEnvironment: an opaque object pointer
  77. fmi2FMUstate : an opaque object pointer
  78. fmi2ValueReference : handle to the value of a variable
  79. fmi2Real : double precision floating-point data type
  80. fmi2Integer : basic signed integer data type
  81. fmi2Boolean : basic signed integer data type
  82. fmi2Char : character data type
  83. fmi2String : a pointer to a vector of fmi2Char characters
  84. ('\0' terminated, UTF8 encoded)
  85. fmi2Byte : smallest addressable unit of the machine, typically one byte.
  86. */
  87. typedef void* fmi2Component; /* Pointer to FMU instance */
  88. typedef void* fmi2ComponentEnvironment; /* Pointer to FMU environment */
  89. typedef void* fmi2FMUstate; /* Pointer to internal FMU state */
  90. typedef unsigned int fmi2ValueReference;
  91. typedef double fmi2Real ;
  92. typedef int fmi2Integer;
  93. typedef int fmi2Boolean;
  94. typedef char fmi2Char;
  95. typedef const fmi2Char* fmi2String;
  96. typedef char fmi2Byte;
  97. /* Values for fmi2Boolean */
  98. #define fmi2True 1
  99. #define fmi2False 0
  100. #endif /* fmi2TypesPlatform_h */