#include "mbs_loader.h"
#include "mbs_binder_public.h"
#include "mbs_binder_private.h"
#include "mbs_load_libraries.h"
#include "useful_functions.h"
#include "mbs_path.h"
#include "mbs_message.h"
#include "mbs_check.h"
#include "mbs_errors_names.h"
#include <string.h>
Macros | |
#define | mbs_new_user_model() s->fct.user.mbs_new_user_model() |
#define | mbs_load_user_model(mbs_infos, um) s->fct.user.mbs_load_user_model(mbs_infos, um) |
#define | mbs_bind_user_model(mbs_infos, um) s->fct.user.mbs_bind_user_model(mbs_infos, um) |
#define | mbs_delete_user_model(um) s->fct.user.mbs_delete_user_model(um) |
#define | mbs_get_user_model_size(n_usr_model) s->fct.user.mbs_get_user_model_size(n_usr_model) |
#define | mbs_get_user_model_list(user_model_list) s->fct.user.mbs_get_user_model_list(user_model_list) |
#define | mbs_new_user_IO(a) s->fct.user.mbs_new_user_IO(a) |
#define | mbs_delete_user_IO(uio) s->fct.user.mbs_delete_user_IO(uio) |
#define | mbs_get_user_IO_size(n_in, n_out, n_user_IO) s->fct.user.mbs_get_user_IO_size(n_in, n_out, n_user_IO) |
#define | user_load_post(data) s->fct.user.user_load_post(data); |
#define | user_free(data) s->fct.user.user_free(data); |
Functions | |
MbsData * | mbs_load (const char *mbs_filename, const char *build_path) |
Load the data from the given *.mbs file (data in the xml format). More... | |
MbsData * | mbs_load_with_loader (const char *mbs_filename, const char *build_path, MbsLoader *mbs_loader) |
Load the data from the given MbsInfos. More... | |
MbsLoadOptions * | mbs_new_load_options () |
Create a new structure with options for the loading. More... | |
void | mbs_delete_load_options (MbsLoadOptions *opts) |
Free the memory associated to the given MbsLoadOptions. More... | |
MbsLoader * | mbs_new_loader () |
Create a new structure loader used for the loading with options. More... | |
void | mbs_delete_loader (MbsLoader *loader) |
Free the memory associated to the given MbsLoader. More... | |
void | mbs_set_symb_fun_null (MbsData *s) |
Set the pointer to project symbolic functions to NULL. More... | |
void | mbs_set_user_fun_null (MbsData *s) |
Set the pointer to project user functions to NULL. More... | |
void | mbs_set_user_IO (UserIoInfo *ioInfo, double val) |
Implementation of utility function for user_IO ==> should be moved (see def in mbs_user_interface.h) More... | |
UserIoInfo * | mbs_xml_create_user_IO_info (MbsInfos *mbs_infos, MbsData *s) |
void | mbs_delete_user_IO_info (UserIoInfo *ioInfo) |
int * | MDS_translate_q (int *q_mds, int nq, int nj) |
return a (nj sized) vector (starting at index 1) of integer which is a copy of the provided (nq sized) vector (starting at index 0) with all value incremented by 1. If nj is greater than nq, the unused value are set to 0. More... | |
MbsData * | mbs_info_to_data (MbsInfos *mbs_infos, MbsData *s) |
Retrieve a MbsData structure from the given MbsInfos. More... | |
MbsData * | mbs_new_data () |
Allocate an MbsData structure with default field values (NULL, 0). More... | |
void | mbs_delete_data (MbsData *s) |
Free the memory used by the given MbsData structure. More... | |
#define mbs_bind_user_model | ( | mbs_infos, | |
um | |||
) | s->fct.user.mbs_bind_user_model(mbs_infos, um) |
#define mbs_delete_user_IO | ( | uio | ) | s->fct.user.mbs_delete_user_IO(uio) |
#define mbs_delete_user_model | ( | um | ) | s->fct.user.mbs_delete_user_model(um) |
#define mbs_get_user_IO_size | ( | n_in, | |
n_out, | |||
n_user_IO | |||
) | s->fct.user.mbs_get_user_IO_size(n_in, n_out, n_user_IO) |
#define mbs_get_user_model_list | ( | user_model_list | ) | s->fct.user.mbs_get_user_model_list(user_model_list) |
#define mbs_get_user_model_size | ( | n_usr_model | ) | s->fct.user.mbs_get_user_model_size(n_usr_model) |
#define mbs_load_user_model | ( | mbs_infos, | |
um | |||
) | s->fct.user.mbs_load_user_model(mbs_infos, um) |
#define mbs_new_user_IO | ( | a | ) | s->fct.user.mbs_new_user_IO(a) |
#define mbs_new_user_model | ( | ) | s->fct.user.mbs_new_user_model() |
#define user_free | ( | data | ) | s->fct.user.user_free(data); |
#define user_load_post | ( | data | ) | s->fct.user.user_load_post(data); |
void mbs_delete_data | ( | MbsData * | s | ) |
Free the memory used by the given MbsData structure.
s | the structure to be freed. |
void mbs_delete_load_options | ( | MbsLoadOptions * | opts | ) |
Free the memory associated to the given MbsLoadOptions.
! For the moment, does not free the char* fields !
opts | the MbsLoadOptions to delete |
void mbs_delete_loader | ( | MbsLoader * | loader | ) |
void mbs_delete_user_IO_info | ( | UserIoInfo * | ioInfo | ) |
MbsData* mbs_load | ( | const char * | mbs_filename, |
const char * | build_name | ||
) |
Load the data from the given *.mbs file (data in the xml format).
The memory of a new MbsData is allocated.
mbs_filename | path to the file to load including filename and extension. |
build_path,path | to the build folder (including build) of MBsysC libraries |
MbsData* mbs_load_with_loader | ( | const char * | mbs_filename, |
const char * | build_path, | ||
MbsLoader * | mbs_loader | ||
) |
Load the data from the given MbsInfos.
The memory of a new MbsData is allocated. Options on paths (symbolic and/or user librairies) can be passed.
mbs_filename | path to the file to load including filename and extension. |
build_path | path to the build folder (including build) of MBsysC libraries |
mbs_load_opts | options for loading (mainly a collection of paths and names) |
MbsData* mbs_new_data | ( | ) |
Allocate an MbsData structure with default field values (NULL, 0).
MbsLoadOptions* mbs_new_load_options | ( | ) |
Create a new structure with options for the loading.
The memory of a new MbsLoadOptions is allocated. The options mainly consist in char variables that can contain name and path for separate libraries.
MbsLoader* mbs_new_loader | ( | ) |
Create a new structure loader used for the loading with options.
The memory of a new MbsLoader and its options is allocated. The memory for the "mds" field is not allocated (left to the user if needed)
void mbs_set_symb_fun_null | ( | MbsData * | s | ) |
Set the pointer to project symbolic functions to NULL.
[in,out] | fct | the MbsData instance containing the pointer of functions |
void mbs_set_user_fun_null | ( | MbsData * | s | ) |
Set the pointer to project user functions to NULL.
[in,out] | fct | the MbsData instance containing the pointer of functions |
void mbs_set_user_IO | ( | UserIoInfo * | ioInfo, |
double | val | ||
) |
Implementation of utility function for user_IO ==> should be moved (see def in mbs_user_interface.h)
Set all the user_IO to the given value (generic code)
UserIoInfo* mbs_xml_create_user_IO_info | ( | MbsInfos * | mbs_infos, |
MbsData * | s | ||
) |
int* MDS_translate_q | ( | int * | q_mds, |
int | nq, | ||
int | nj | ||
) |
return a (nj sized) vector (starting at index 1) of integer which is a copy of the provided (nq sized) vector (starting at index 0) with all value incremented by 1. If nj is greater than nq, the unused value are set to 0.
[in] | q_mds | the original (nq sized) vector of integers, starting at index 0 |
[in] | nq | the size of the q_mds vector |
[in] | nj | the size of the returned (starting at index 1) vector (0 element not taken into account) |