FMI Library: part of JModelica.org
Functions
Support for processing variable types

Functions

FMILIB_EXPORT unsigned int fmi2_import_get_type_definition_number (fmi2_import_type_definitions_t *td)
 Get the number of available type definitions. More...
 
FMILIB_EXPORT fmi2_import_variable_typedef_tfmi2_import_get_typedef (fmi2_import_type_definitions_t *td, unsigned int index)
 Get a type definition specified by the index. More...
 
FMILIB_EXPORT fmi2_import_display_unit_tfmi2_import_get_type_display_unit (fmi2_import_real_typedef_t *)
 Get associated display unit for a type defition if any. More...
 
FMILIB_EXPORT const charfmi2_import_get_type_name (fmi2_import_variable_typedef_t *)
 Get the type name. More...
 
FMILIB_EXPORT const charfmi2_import_get_type_description (fmi2_import_variable_typedef_t *)
 Get type description. More...
 
FMILIB_EXPORT fmi2_base_type_enu_t fmi2_import_get_base_type (fmi2_import_variable_typedef_t *)
 Get base type used for the type definition. More...
 
FMILIB_EXPORT fmi2_import_real_typedef_tfmi2_import_get_type_as_real (fmi2_import_variable_typedef_t *)
 Cast the general type definition object to an object with a specific base type. More...
 
FMILIB_EXPORT fmi2_import_integer_typedef_tfmi2_import_get_type_as_int (fmi2_import_variable_typedef_t *)
 Cast the general type definition object to an object with a specific base type. More...
 
FMILIB_EXPORT fmi2_import_enumeration_typedef_tfmi2_import_get_type_as_enum (fmi2_import_variable_typedef_t *)
 Cast the general type definition object to an object with a specific base type. More...
 
FMILIB_EXPORT const charfmi2_import_get_type_quantity (fmi2_import_variable_typedef_t *)
 Get the quantity associated with the type definition. More...
 
FMILIB_EXPORT double fmi2_import_get_real_type_min (fmi2_import_real_typedef_t *)
 Get minimal value for the type. More...
 
FMILIB_EXPORT double fmi2_import_get_real_type_max (fmi2_import_real_typedef_t *)
 Get maximum value for the type. More...
 
FMILIB_EXPORT double fmi2_import_get_real_type_nominal (fmi2_import_real_typedef_t *)
 Get the nominal value associated with the type definition. More...
 
FMILIB_EXPORT fmi2_import_unit_tfmi2_import_get_real_type_unit (fmi2_import_real_typedef_t *)
 Get the unit object associated with the type definition if any. More...
 
FMILIB_EXPORT int fmi2_import_get_real_type_is_relative_quantity (fmi2_import_real_typedef_t *)
 Get the 'relativeQuantity' flag. More...
 
FMILIB_EXPORT int fmi2_import_get_real_type_is_unbounded (fmi2_import_real_typedef_t *)
 Get the 'unbounded' flag. More...
 
FMILIB_EXPORT int fmi2_import_get_integer_type_min (fmi2_import_integer_typedef_t *)
 Get minimal value for the type. More...
 
FMILIB_EXPORT int fmi2_import_get_integer_type_max (fmi2_import_integer_typedef_t *)
 Get maximum value for the type. More...
 
FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_min (fmi2_import_enumeration_typedef_t *)
 Get minimal value for the type. More...
 
FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_max (fmi2_import_enumeration_typedef_t *)
 Get maximum value for the type. More...
 
FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_size (fmi2_import_enumeration_typedef_t *)
 Get the number of elements in the enum. More...
 
FMILIB_EXPORT const charfmi2_import_get_enum_type_item_name (fmi2_import_enumeration_typedef_t *, unsigned int item)
 Get an enumeration item name by index. More...
 
FMILIB_EXPORT int fmi2_import_get_enum_type_item_value (fmi2_import_enumeration_typedef_t *, unsigned int item)
 Get an enumeration item value by index. More...
 
FMILIB_EXPORT const charfmi2_import_get_enum_type_item_description (fmi2_import_enumeration_typedef_t *, unsigned int item)
 Get an enumeration item description by index. More...
 
FMILIB_EXPORT const charfmi2_import_get_enum_type_value_name (fmi2_import_enumeration_typedef_t *t, int value)
 Get an enumeration item name for the given value. More...
 

Type definitions supporting structures

typedef struct fmi2_xml_real_typedef_t fmi2_import_real_typedef_t
 Opaque type definition object. More...
 
typedef struct fmi2_xml_integer_typedef_t fmi2_import_integer_typedef_t
 Opaque integer type definition object. More...
 
typedef struct fmi2_xml_enumeration_typedef_t fmi2_import_enumeration_typedef_t
 Opaque enumeration type definition object. More...
 
typedef struct fmi2_xml_variable_typedef_t fmi2_import_variable_typedef_t
 Opaque general variable type definition object. More...
 
typedef struct fmi2_xml_type_definitions_t fmi2_import_type_definitions_t
 Opaque list of the type definitions in the model. More...
 

Detailed Description

Typedef Documentation

typedef struct fmi2_xml_real_typedef_t fmi2_import_real_typedef_t

Opaque type definition object.

Definition at line 42 of file fmi2_import_type.h.

typedef struct fmi2_xml_integer_typedef_t fmi2_import_integer_typedef_t

Opaque integer type definition object.

Definition at line 44 of file fmi2_import_type.h.

typedef struct fmi2_xml_enumeration_typedef_t fmi2_import_enumeration_typedef_t

Opaque enumeration type definition object.

Definition at line 46 of file fmi2_import_type.h.

typedef struct fmi2_xml_variable_typedef_t fmi2_import_variable_typedef_t

Opaque general variable type definition object.

Definition at line 48 of file fmi2_import_type.h.

typedef struct fmi2_xml_type_definitions_t fmi2_import_type_definitions_t

Opaque list of the type definitions in the model.

Definition at line 50 of file fmi2_import_type.h.

Function Documentation

FMILIB_EXPORT unsigned int fmi2_import_get_type_definition_number ( fmi2_import_type_definitions_t td)

Get the number of available type definitions.

FMILIB_EXPORT fmi2_import_variable_typedef_t* fmi2_import_get_typedef ( fmi2_import_type_definitions_t td,
unsigned int  index 
)

Get a type definition specified by the index.

Parameters
tdthe type definition list object
indexthe index of type definition. Must be less than the numbere returned by fmi2_import_get_type_definition_number()
Returns
A type definition object or NULL if index is out of range.
FMILIB_EXPORT fmi2_import_display_unit_t * fmi2_import_get_type_display_unit ( fmi2_import_real_typedef_t )

Get associated display unit for a type defition if any.

Get display unit associated with a real type definition.

Returns
Display unit object of NULL if none was given.
FMILIB_EXPORT const char* fmi2_import_get_type_name ( fmi2_import_variable_typedef_t )

Get the type name.

FMILIB_EXPORT const char* fmi2_import_get_type_description ( fmi2_import_variable_typedef_t )

Get type description.

Note that an empty string is returned if the attribute is not present in the XML.

Get base type used for the type definition.

Cast the general type definition object to an object with a specific base type.

Returns
Pointer to the specific type object or NULL if base type does not match.

Cast the general type definition object to an object with a specific base type.

Returns
Pointer to the specific type object or NULL if base type does not match.

Cast the general type definition object to an object with a specific base type.

Returns
Pointer to the specific type object or NULL if base type does not match.
FMILIB_EXPORT const char* fmi2_import_get_type_quantity ( fmi2_import_variable_typedef_t )

Get the quantity associated with the type definition.

Returns
NULL-pointer is always returned for strings and booleans. Empty string is returned if attribute is not present for other types.
FMILIB_EXPORT double fmi2_import_get_real_type_min ( fmi2_import_real_typedef_t )

Get minimal value for the type.

Returns
Either the value specified in the XML file or negated DBL_MAX as defined in <float.h>
FMILIB_EXPORT double fmi2_import_get_real_type_max ( fmi2_import_real_typedef_t )

Get maximum value for the type.

Returns
Either the value specified in the XML file or DBL_MAX as defined in <float.h>
FMILIB_EXPORT double fmi2_import_get_real_type_nominal ( fmi2_import_real_typedef_t )

Get the nominal value associated with the type definition.

FMILIB_EXPORT fmi2_import_unit_t* fmi2_import_get_real_type_unit ( fmi2_import_real_typedef_t )

Get the unit object associated with the type definition if any.

FMILIB_EXPORT int fmi2_import_get_real_type_is_relative_quantity ( fmi2_import_real_typedef_t )

Get the 'relativeQuantity' flag.

FMILIB_EXPORT int fmi2_import_get_real_type_is_unbounded ( fmi2_import_real_typedef_t )

Get the 'unbounded' flag.

FMILIB_EXPORT int fmi2_import_get_integer_type_min ( fmi2_import_integer_typedef_t )

Get minimal value for the type.

Returns
Either the value specified in the XML file or INT_MIN as defined in <limits.h>
FMILIB_EXPORT int fmi2_import_get_integer_type_max ( fmi2_import_integer_typedef_t )

Get maximum value for the type.

Returns
Either the value specified in the XML file or INT_MAX as defined in <limits.h>
FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_min ( fmi2_import_enumeration_typedef_t )

Get minimal value for the type.

Returns
Either the value specified in the XML file or 0
FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_max ( fmi2_import_enumeration_typedef_t )

Get maximum value for the type.

Returns
Either the value specified in the XML file or INT_MAX as defined in <limits.h>
FMILIB_EXPORT unsigned int fmi2_import_get_enum_type_size ( fmi2_import_enumeration_typedef_t )

Get the number of elements in the enum.

FMILIB_EXPORT const char* fmi2_import_get_enum_type_item_name ( fmi2_import_enumeration_typedef_t ,
unsigned int  item 
)

Get an enumeration item name by index.

FMILIB_EXPORT int fmi2_import_get_enum_type_item_value ( fmi2_import_enumeration_typedef_t ,
unsigned int  item 
)

Get an enumeration item value by index.

FMILIB_EXPORT const char* fmi2_import_get_enum_type_item_description ( fmi2_import_enumeration_typedef_t ,
unsigned int  item 
)

Get an enumeration item description by index.

FMILIB_EXPORT const char* fmi2_import_get_enum_type_value_name ( fmi2_import_enumeration_typedef_t t,
int  value 
)

Get an enumeration item name for the given value.