]> gerrit.simantics Code Review - simantics/fmil.git/blobdiff - org.simantics.fmil.core/native/FMILibrary/src/Import/include/FMI1/fmi1_import_variable_list.h
Add FMILibrary-2.0.3 to org.simantics.fmil.core\native.
[simantics/fmil.git] / org.simantics.fmil.core / native / FMILibrary / src / Import / include / FMI1 / fmi1_import_variable_list.h
diff --git a/org.simantics.fmil.core/native/FMILibrary/src/Import/include/FMI1/fmi1_import_variable_list.h b/org.simantics.fmil.core/native/FMILibrary/src/Import/include/FMI1/fmi1_import_variable_list.h
new file mode 100644 (file)
index 0000000..3be36df
--- /dev/null
@@ -0,0 +1,130 @@
+/*\r
+    Copyright (C) 2012 Modelon AB\r
+\r
+    This program is free software: you can redistribute it and/or modify\r
+    it under the terms of the BSD style license.
+\r
+    This program is distributed in the hope that it will be useful,\r
+    but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+    FMILIB_License.txt file for more details.\r
+\r
+    You should have received a copy of the FMILIB_License.txt file\r
+    along with this program. If not, contact Modelon AB <http://www.modelon.com>.\r
+*/\r
+\r
+\r
+\r
+/** \file fmi1_import_variable_list.h\r
+*  \brief Public interface to the FMI XML C-library. Handling of variable lists.\r
+*/\r
+\r
+#ifndef FMI1_IMPORT_VARIABLELIST_H_\r
+#define FMI1_IMPORT_VARIABLELIST_H_\r
+\r
+ #include "fmi1_import_variable.h"\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/**\r
+ \addtogroup  fmi1_import\r
+ @{\r
+       \defgroup  fmi1_import_varlist Handling of variable lists\r
+ @}\r
+*/\r
+\r
+/** \addtogroup  fmi1_import_varlist\r
+*  \brief Variable lists are provided to handle sets of variables.\r
+*\r
+* Note that variable lists are allocated dynamically and must be freed when not needed any longer.\r
+ @{ \r
+*/\r
+\r
+/* Allocate an empty list */
+fmi1_import_variable_list_t* fmi1_import_alloc_variable_list(fmi1_import_t* fmu, size_t size);
+\r
+/**  \brief Free a variable list. Note that variable lists are allocated dynamically and must be freed when not needed any longer \r
+       \param vl A variable list.\r
+*/\r
+FMILIB_EXPORT void fmi1_import_free_variable_list(fmi1_import_variable_list_t* vl);\r
+\r
+/** \brief Make a copy of the list.\r
+       \param vl A variable list.\r
+*/\r
+FMILIB_EXPORT fmi1_import_variable_list_t* fmi1_import_clone_variable_list(fmi1_import_variable_list_t* vl);\r
+\r
+/** \brief  Get number of variables in a list */\r
+FMILIB_EXPORT size_t  fmi1_import_get_variable_list_size(fmi1_import_variable_list_t* vl);\r
+\r
+/** \brief  Get a pointer to the list of the value references for all the variables */\r
+FMILIB_EXPORT const fmi1_value_reference_t* fmi1_import_get_value_referece_list(fmi1_import_variable_list_t* vl);\r
+\r
+/** \brief Get a single variable from the list*/\r
+FMILIB_EXPORT fmi1_import_variable_t* fmi1_import_get_variable(fmi1_import_variable_list_t* vl, unsigned int  index);\r
+\r
+/** \name Operations on variable lists. Every operation creates a new list. \r
+@{\r
+*/\r
+/** \brief Select sub-lists.\r
+\param vl A variable list.\r
+\param fromIndex Zero based start index, inclusive.\r
+\param toIndex Zero based end index, inclusive.\r
+\return A sublist. NULL is returned if toIndex is less than fromIndex or is larger than the list size or if memory allocation failed.\r
+*/\r
+FMILIB_EXPORT fmi1_import_variable_list_t* fmi1_import_get_sublist(fmi1_import_variable_list_t* vl, unsigned int  fromIndex, unsigned int  toIndex);\r
+\r
+/** \brief Callback function typedef for the fmiFilterVariables. \r
+\r
+The function should return 0 to prevent a variable from coming to the output list. */\r
+typedef int (*fmi1_import_variable_filter_function_ft)(fmi1_import_variable_t*vl, void * data);\r
+\r
+/** \brief Call the provided 'filter' function on every variable in the list and create a new list.\r
+  \r
+\param vl A variable list.\r
+\param filter A filter function according to ::fmi1_import_variable_filter_function_ft.\r
+\param context A parameter to be forwarded to the filter function.\r
+ @return A sub-list with the variables for which filter returned non-zero value. */\r
+FMILIB_EXPORT fmi1_import_variable_list_t* fmi1_import_filter_variables(fmi1_import_variable_list_t* vl, fmi1_import_variable_filter_function_ft filter, void* context);\r
+\r
+/** \brief Create a new variable list by concatenating two lists.\r
+  \r
+\param a A variable list.\r
+\param b A variable list.\r
+*/\r
+FMILIB_EXPORT fmi1_import_variable_list_t* fmi1_import_join_var_list(fmi1_import_variable_list_t* a, fmi1_import_variable_list_t* b);\r
+\r
+\r
+/** \brief Append a variable to the variable list.\r
+  \r
+\param vl A variable list.\r
+\param v A variable.\r
+*/\r
+FMILIB_EXPORT fmi1_import_variable_list_t* fmi1_import_append_to_var_list(fmi1_import_variable_list_t* vl, fmi1_import_variable_t* v);\r
+\r
+/** \brief Prepend a variable to the variable list.\r
+  \r
+\param vl A variable list.\r
+\param v A variable.\r
+*/\r
+FMILIB_EXPORT fmi1_import_variable_list_t* fmi1_import_prepend_to_var_list(fmi1_import_variable_list_t* vl, fmi1_import_variable_t* v);\r
+\r
+/** \brief Add a variable to a variable list.\r
+  \r
+\param vl A variable list.\r
+\param v A variable.\r
+*/\r
+FMILIB_EXPORT jm_status_enu_t fmi1_import_var_list_push_back(fmi1_import_variable_list_t* vl, fmi1_import_variable_t* v);\r
+/**\r
+  @}\r
+ */\r
+\r
+/**\r
+  @}\r
+ */\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+#endif\r