![]() |
helics
3.0.1
|
Functions dealing with callbacks for the shared library. More...
#include "helicsCore.h"
Go to the source code of this file.
Functions | |
void | helicsBrokerSetLoggingCallback (HelicsBroker broker, void(*logger)(int loglevel, const char *identifier, const char *message, void *userData), void *userdata, HelicsError *err) |
void | helicsCoreSetLoggingCallback (HelicsCore core, void(*logger)(int loglevel, const char *identifier, const char *message, void *userData), void *userdata, HelicsError *err) |
void | helicsFederateSetLoggingCallback (HelicsFederate fed, void(*logger)(int loglevel, const char *identifier, const char *message, void *userData), void *userdata, HelicsError *err) |
void | helicsFilterSetCustomCallback (HelicsFilter filter, void(*filtCall)(HelicsMessage message, void *userData), void *userdata, HelicsError *err) |
void | helicsFederateSetQueryCallback (HelicsFederate fed, void(*queryAnswer)(const char *query, int querySize, HelicsQueryBuffer buffer, void *userdata), void *userdata, HelicsError *err) |
void | helicsQueryBufferFill (HelicsQueryBuffer buffer, const char *str, int strSize, HelicsError *err) |
Functions dealing with callbacks for the shared library.
void helicsBrokerSetLoggingCallback | ( | HelicsBroker | broker, |
void(*)(int loglevel, const char *identifier, const char *message, void *userData) | logger, | ||
void * | userdata, | ||
HelicsError * | err | ||
) |
Set the logging callback to a broker.
Add a logging callback function to a broker. The logging callback will be called when a message flows into a broker from the core or from a broker.
broker | The broker object in which to set the callback. | |
logger | A callback with signature void(int, const char *, const char *, void *); the function arguments are loglevel, an identifier, a message string, and a pointer to user data. | |
userdata | A pointer to user data that is passed to the function when executing. | |
[in,out] | err | A pointer to an error object for catching errors. |
void helicsCoreSetLoggingCallback | ( | HelicsCore | core, |
void(*)(int loglevel, const char *identifier, const char *message, void *userData) | logger, | ||
void * | userdata, | ||
HelicsError * | err | ||
) |
Set the logging callback for a core.
Add a logging callback function to a core. The logging callback will be called when a message flows into a core from the core or from a broker.
core | The core object in which to set the callback. | |
logger | A callback with signature void(int, const char *, const char *, void *); The function arguments are loglevel, an identifier, a message string, and a pointer to user data. | |
userdata | A pointer to user data that is passed to the function when executing. | |
[in,out] | err | A pointer to an error object for catching errors. |
void helicsFederateSetLoggingCallback | ( | HelicsFederate | fed, |
void(*)(int loglevel, const char *identifier, const char *message, void *userData) | logger, | ||
void * | userdata, | ||
HelicsError * | err | ||
) |
Set the logging callback for a federate.
Add a logging callback function to a federate. The logging callback will be called when a message flows into a federate from the core or from a federate.
fed | The federate object in which to create a subscription must have been created with helicsCreateValueFederate or helicsCreateCombinationFederate. | |
logger | A callback with signature void(int, const char *, const char *, void *); The function arguments are loglevel, an identifier string, a message string, and a pointer to user data. | |
userdata | A pointer to user data that is passed to the function when executing. | |
[in,out] | err | A pointer to an error object for catching errors. |
void helicsFederateSetQueryCallback | ( | HelicsFederate | fed, |
void(*)(const char *query, int querySize, HelicsQueryBuffer buffer, void *userdata) | queryAnswer, | ||
void * | userdata, | ||
HelicsError * | err | ||
) |
Set callback for queries executed against a federate.
There are many queries that HELICS understands directly, but it is occasionally useful to have a federate be able to respond to specific queries with answers specific to a federate.
fed | The federate to set the callback for. | |
queryAnswer | A callback with signature const char *(const char *query, int querySize,int *answerSize, void *userdata); The function arguments are the query string requesting an answer along with its size, the string is not guaranteed to be null terminated answerSize is an outputParameter intended to filled out by the userCallback and should contain the length of the return string. The return pointer can be NULL if no answer is given and HELICS will generate the appropriate response. | |
userdata | A pointer to user data that is passed to the function when executing. | |
[in,out] | err | A pointer to an error object for catching errors. |
void helicsFilterSetCustomCallback | ( | HelicsFilter | filter, |
void(*)(HelicsMessage message, void *userData) | filtCall, | ||
void * | userdata, | ||
HelicsError * | err | ||
) |
Set a general callback for a custom filter.
Add a custom filter callback for creating a custom filter operation in the C shared library.
filter | The filter object to set the callback for. | |
filtCall | A callback with signature helics_message_object(helics_message_object, void *); The function arguments are the message to filter and a pointer to user data. The filter should return a new message. | |
userdata | A pointer to user data that is passed to the function when executing. | |
[in,out] | err | A pointer to an error object for catching errors. |
void helicsQueryBufferFill | ( | HelicsQueryBuffer | buffer, |
const char * | str, | ||
int | strSize, | ||
HelicsError * | err | ||
) |
Set the data for a query callback.
There are many queries that HELICS understands directly, but it is occasionally useful to have a federate be able to respond to specific queries with answers specific to a federate.
buffer | The buffer received in a helicsQueryCallback. | |
str | Pointer to the data to fill the buffer with. | |
strSize | The size of the string. | |
[in,out] | err | A pointer to an error object for catching errors. |
References HELICS_ERROR_INVALID_OBJECT.