Defines a type of MSU. More...
#include <msu_type.h>
Public Attributes | |
char * | name |
Name for the msu type. More... | |
unsigned int | id |
Numerical identifier for the MSU. More... | |
int(* | init_type )(struct msu_type *type) |
Constructor for an MSU_type itself, should initialize whatever context all MSUs of this type might need to rely upon. More... | |
void(* | destroy_type )(struct msu_type *type) |
Destructor for an MSU type, should destroy context initialized in init_type . More... | |
int(* | init )(struct local_msu *self, struct msu_init_data *initial_data) |
Type-specific construction function. More... | |
void(* | destroy )(struct local_msu *self) |
Type-specific destructor that frees any internal data or state. More... | |
int(* | receive )(struct local_msu *self, struct msu_msg *msg) |
Handles the receiving of data sent from other MSUs. More... | |
int(* | receive_error )(struct local_msu *self, struct msu_msg *msg) |
int(* | route )(struct msu_type *type, struct local_msu *sender, struct msu_msg *msg, struct msu_endpoint *output) |
Choose which MSU of this type the previous MSU will route to. More... | |
serialization_fn | serialize |
Defines serialization protocol for data sent to this MSU type If NULL, assumes no pointers in the msu message, and simply serializes the input for the length defined in the msu message header. More... | |
serialization_fn | serialize_error |
Defines serialization protocol for errors returned to this MSU type If NULL, assumes no pointers in the msu message and simply serializes the input for the provided length. More... | |
deserialization_fn | deserialize |
Defines deserialization protocl for data received by this MSU type If NULL, assumes no pointers in the msu message, and simply assigns input as the message. More... | |
deserialization_fn | deserialize_error |
Defines a type of MSU.
This information (mostly callbacks) is shared across all MSUs of the same type.
Definition at line 46 of file msu_type.h.
deserialization_fn msu_type::deserialize |
Defines deserialization protocl for data received by this MSU type If NULL, assumes no pointers in the msu message, and simply assigns input
as the message.
self | The MSU to receive the deserialized buffer |
input_size | Size of the received buffer |
input | Message to be deserialized |
out_size | To be filled with the size of the struct deserialized off of the buffer |
Definition at line 128 of file msu_type.h.
deserialization_fn msu_type::deserialize_error |
Definition at line 130 of file msu_type.h.
void(* msu_type::destroy)(struct local_msu *self) |
Type-specific destructor that frees any internal data or state.
Can be NULL if no additional freeing must occur
self | MSU to be destroyed |
Definition at line 81 of file msu_type.h.
void(* msu_type::destroy_type)(struct msu_type *type) |
Destructor for an MSU type, should destroy context initialized in init_type
.
type | The type to be destroyed |
Definition at line 64 of file msu_type.h.
unsigned int msu_type::id |
Numerical identifier for the MSU.
Definition at line 51 of file msu_type.h.
int(* msu_type::init)(struct local_msu *self, struct msu_init_data *initial_data) |
Type-specific construction function.
Generic construction for an MSU is always handled by local_msu. Can be set to NULL if no additional initialization must occur. If this is non-NULL it provides additional initialization, such as construction of msu state.
self | MSU to be initialized (structure is already allocated) |
initial_data | initial information passed to the runtime by the global controller |
Definition at line 75 of file msu_type.h.
int(* msu_type::init_type)(struct msu_type *type) |
Constructor for an MSU_type itself, should initialize whatever context all MSUs of this type might need to rely upon.
Can be set to NULL if no additional init must occur.
type | MSU type under construction |
Definition at line 59 of file msu_type.h.
char* msu_type::name |
Name for the msu type.
Definition at line 48 of file msu_type.h.
Handles the receiving of data sent from other MSUs.
This field can not be set to NULL, and must be defined for each msu_type.
self | MSU receieving data |
msg | data to receive from previous MSU |
Definition at line 89 of file msu_type.h.
Definition at line 91 of file msu_type.h.
int(* msu_type::route)(struct msu_type *type, struct local_msu *sender, struct msu_msg *msg, struct msu_endpoint *output) |
Choose which MSU of this type the previous MSU will route to.
If NULL, defaults to default_routing()
in runtime/routing_strategies.c
type | MSU type of endpoint |
sender | MSU sending the message |
msg | data to be sent, in case destination depends on specifics of data |
output | Output argument to be filled with the appropriate destination |
Definition at line 101 of file msu_type.h.
serialization_fn msu_type::serialize |
Defines serialization protocol for data sent to this MSU type If NULL, assumes no pointers in the msu message, and simply serializes the input for the length defined in the msu message header.
type | The type of MSU to which the serialized message is to be delivered |
input | The MSU message to be serialized |
output | To be allocated and filled with the serialized MSU message |
Definition at line 112 of file msu_type.h.
serialization_fn msu_type::serialize_error |
Defines serialization protocol for errors returned to this MSU type If NULL, assumes no pointers in the msu message and simply serializes the input for the provided length.
Definition at line 118 of file msu_type.h.