Interface giving functions to be supplied by an Integra bridge. More...
#include <integra_bridge.h>
Data Fields | |
int(* | module_load )(const ntg_id id, const char *implementation_name) |
Load an Integra module in a target environment. | |
int(* | module_remove )(ntg_id id) |
Remove an Integra module from a target environment. | |
int(* | module_connect )(const ntg_port *target, const ntg_port *source) |
Connect two ports in a target environment. | |
int(* | module_disconnect )(const ntg_port *target, const ntg_port *source) |
Disconnect a port in a target environment. | |
void(* | send_value )(const ntg_port *target, const ntg_value *value) |
send a value to a particular port | |
void(* | bridge_init )(const char *ip, const int port) |
Initialise the bridge. | |
void(* | post )(const char *message) |
Post a message to the module host. | |
void *(* | bridge_callback )(int argc, void *data) |
Callback function that gets passed to the module host from the bridge when the server starts. | |
void *(* | server_receive_callback )(ntg_id id, unsigned int port, const int argc, const ntg_value *message, bridge_send_callback) |
Callback function that gets set by the instance host when the server starts. |
Interface giving functions to be supplied by an Integra bridge.
Any compliant bridge, must implement all of these functions. However, it is entirely dependent on the given module host how these functions are implemented, and it is expected that bridge implementations will vary considerably between module hosts.
Each bridge will need a mechanism for locating modules in the module host. This might involve creating a table that maps module ids to some local identifier.
void*(* ntg_bridge_interface::bridge_callback)(int argc, void *data) |
Callback function that gets passed to the module host from the bridge when the server starts.
void | *data: Arbitrary environment-specific data |
A pointer can be returned to the module host via the return value of this function. Under normal circumstances the value of the pointer should be NULL
Referenced by ntg_server_run().
void(* ntg_bridge_interface::bridge_init)(const char *ip, const int port) |
Initialise the bridge.
*ip,: | a pointer to a null terminated string representing the IP address of the ntg_instance Host | |
port,: | the port number of the ntg_instance Host |
Referenced by ntg_server_run().
int(* ntg_bridge_interface::module_connect)(const ntg_port *target, const ntg_port *source) |
Connect two ports in a target environment.
Each module has input and output ports corresponding to it's namespace. ntg_ports can be connected arbitrarily, and data types are converted on the fly.
Referenced by handler_module_connect(), ntg_connect(), and ntg_server_update_connection().
int(* ntg_bridge_interface::module_disconnect)(const ntg_port *target, const ntg_port *source) |
Disconnect a port in a target environment.
Referenced by handler_module_disconnect(), ntg_disconnect(), ntg_server_delete_connection(), and ntg_server_update_connection().
int(* ntg_bridge_interface::module_load)(const ntg_id id, const char *implementation_name) |
Load an Integra module in a target environment.
id,: | the unique session id of the module | |
*implementation_name,: | a pointer to a string giving a name that is meaningful to the module host |
Referenced by handler_module_load(), and ntg_new().
int(* ntg_bridge_interface::module_remove)(ntg_id id) |
Remove an Integra module from a target environment.
id,: | the unique session id of the module |
Referenced by handler_module_remove(), and ntg_server_instance_delete().
void(* ntg_bridge_interface::post)(const char *message) |
Post a message to the module host.
*message,: | A pointer to the string to be posted |
This function can be used to post a message to the module host, if the module host supports the printing of messages (e.g. to a special console) This allows for the possibility of passing error messages or debug statements from the instance host to the module host
Referenced by handler_module_load(), handler_module_post(), and ntg_new().
void(* ntg_bridge_interface::send_value)(const ntg_port *target, const ntg_value *value) |
send a value to a particular port
Referenced by handler_namespace_method(), handler_send_process(), handler_send_value(), and ntg_instance_attribute_send_value().
void*(* ntg_bridge_interface::server_receive_callback)(ntg_id id, unsigned int port, const int argc, const ntg_value *message, bridge_send_callback) |
Callback function that gets set by the instance host when the server starts.
This is the mechanism by which data gets passed from the bridge *back* to the instance host
const | ntg_id id The source module id | |
const | ntg_id port The source port id | |
const | int argc The number of elements in the array pointed to by *mesage | |
ntg_value | *message An array of ntg_values to passed to the destination port(s) as determined by the IH connection graph |
A pointer can be returned to the bridge via the return value of this function. Under normal circumstances the value of the pointer should be NULL
Referenced by ntg_server_run().