#include "auto_output.h"#include "useful_functions.h"#include "mbs_message.h"#include <stdlib.h>#include <string.h>Macros | |
| #define | MSG_ERR ">> BUFFERS>> " |
| #define | MSG_PRE " >> " |
Functions | |
| AutoOutput * | init_auto_output (int max_nb) |
| initialize the AutoOutput structure More... | |
| int | define_auto_output_vector (AutoOutput *auto_output, char *label, int size) |
| set memory for a vector in AutoOutput More... | |
| void | free_auto_output (AutoOutput *auto_output) |
| release memory for AutoOutput More... | |
| int | update_auto_output (AutoOutput *auto_output, double value, char *label) |
| update auto_output when a 'set_output' is encountered More... | |
| int | update_auto_output_vector (AutoOutput *auto_output, double *vector, char *label, int output_id) |
| update auto_output when a 'set_output_vector' is encountered More... | |
| int | update_auto_output_partial_vector (AutoOutput *auto_output, double *vector, char *label, int output_id, int start, int number) |
| update auto_output when a 'set_output_partial_vector' is encountered. More... | |
| int | update_auto_output_value (AutoOutput *auto_output, double value, int val_index, char *label, int output_id) |
| update auto_output when a 'set_output_value' is encountered It can take the label and/or the output_id as input. If the two are present, a check is done to assess these are coherent More... | |
| int | index_output_string (AutoOutput *auto_output, char *label) |
| get index for a output with its label More... | |
| int | index_output_vector_string (AutoOutput *auto_output, char *label) |
| get index for a output vector with its label More... | |
| double | get_output_value_auto (AutoOutput *auto_output, int index) |
| get the output value corresponding to the requested index More... | |
| double * | get_output_vector_ptr_auto (AutoOutput *auto_output, int index) |
| get the pointer to the output vector at the requested index More... | |
| char * | get_output_label_auto (AutoOutput *auto_output, int index) |
| get the output label corresponding to the requested index More... | |
| char * | get_output_vector_label_auto (AutoOutput *auto_output, int index) |
| get the output vector label corresponding to the requested index More... | |
| int | get_output_vector_size_auto (AutoOutput *auto_output, int index) |
| get the output vector size corresponding to the requested index More... | |
Define functions used to automatically update the user output values.
| #define MSG_ERR ">> BUFFERS>> " |
| #define MSG_PRE " >> " |
| int define_auto_output_vector | ( | AutoOutput * | auto_output, |
| char * | label, | ||
| int | size | ||
| ) |
set memory for a vector in AutoOutput
| [out] | auto_output | AutoOutput structure to update |
| [in] | size | number of element in the vector to output |
| [in] | label | output vector label |
| void free_auto_output | ( | AutoOutput * | auto_output | ) |
release memory for AutoOutput
| [out] | auto_output | AutoOutput structure to free |
| char* get_output_label_auto | ( | AutoOutput * | auto_output, |
| int | index | ||
| ) |
get the output label corresponding to the requested index
| [in] | auto_output | AutoOutput structure |
| [in] | index | requested index |
| double get_output_value_auto | ( | AutoOutput * | auto_output, |
| int | index | ||
| ) |
get the output value corresponding to the requested index
| [in] | auto_output | AutoOutput structure |
| [in] | index | requested index |
| char* get_output_vector_label_auto | ( | AutoOutput * | auto_output, |
| int | index | ||
| ) |
get the output vector label corresponding to the requested index
| [in] | auto_output | AutoOutput structure |
| [in] | index | requested index |
| double* get_output_vector_ptr_auto | ( | AutoOutput * | auto_output, |
| int | index | ||
| ) |
get the pointer to the output vector at the requested index
| [in] | auto_output | AutoOutput structure |
| [in] | index | requested index |
| int get_output_vector_size_auto | ( | AutoOutput * | auto_output, |
| int | index | ||
| ) |
get the output vector size corresponding to the requested index
| [in] | auto_output | AutoOutput structure |
| [in] | index | requested index |
| int index_output_string | ( | AutoOutput * | auto_output, |
| char * | label | ||
| ) |
get index for a output with its label
| [in] | auto_output | AutoOutput structure |
| [in] | label | label of the output |
| int index_output_vector_string | ( | AutoOutput * | auto_output, |
| char * | label | ||
| ) |
get index for a output vector with its label
| [in] | auto_output | AutoOutput structure |
| [in] | label | label of the output vector |
| AutoOutput* init_auto_output | ( | int | max_nb | ) |
initialize the AutoOutput structure
| [in] | max_nb | maximum number of user outputs |
| int update_auto_output | ( | AutoOutput * | auto_output, |
| double | value, | ||
| char * | label | ||
| ) |
update auto_output when a 'set_output' is encountered
| [out] | auto_output | AutoOutput structure |
| [in] | value | current output value |
| [in] | label | current output label |
| int update_auto_output_partial_vector | ( | AutoOutput * | auto_output, |
| double * | vector, | ||
| char * | label, | ||
| int | output_id, | ||
| int | start, | ||
| int | number | ||
| ) |
update auto_output when a 'set_output_partial_vector' is encountered.
| [out] | auto_output | AutoOutput structure |
| [in] | vector | Pointer to the vector with values to be send to buffer. |
| [in] | label | Current output label, NULL can be provided (no coherence check). |
| [in] | output_id | Index of the output vector. To search from buffer label, set the value to "-1" (minus one). |
| [in] | start | Index in the buffer array to start to save the provided vector. The value must be strictly positive and fit in the buffer size. The first index is 0. |
| [in] | number | Number of value to be saved from the vector to the buffer. If this number exceed the size of the vector, an undefined behavior occurs. If start + number exceed the buffer size, an error is raised. |
| int update_auto_output_value | ( | AutoOutput * | auto_output, |
| double | value, | ||
| int | val_index, | ||
| char * | label, | ||
| int | output_id | ||
| ) |
update auto_output when a 'set_output_value' is encountered It can take the label and/or the output_id as input. If the two are present, a check is done to assess these are coherent
| [out] | auto_output | AutoOutput structure |
| [in] | value | current output value |
| [in] | val_index | index of the value in the saved vector |
| [in] | label | current output label (NULL if not known) |
| [in] | output_id | id of the output vector (if not known, put it to -1 : the function will search for the correct index) |
| int update_auto_output_vector | ( | AutoOutput * | auto_output, |
| double * | vector, | ||
| char * | label, | ||
| int | output_id | ||
| ) |
update auto_output when a 'set_output_vector' is encountered
| [out] | auto_output | AutoOutput structure |
| [in] | vector | pointer to the current outputs vector |
| [in] | label | current output label (NULL if not know) |
| [in] | output_id | index of the output vector (if not known, put it to -1 : the function will search for the correct index) |
1.8.17