This interface is intended for objects that post events. Each events has a pointer to a call-back function and a data pointer associated with it. These pointers need to be converted to values that can be represented in a file when a configuration is written (a checkpoint is taken), and converted back to pointers when a configuration is read (a checkpoint is opened). Simics also needs some way to get a text description of an event that can be presented to the user. These functions should be implemented through the event-poster interface by all objects posting event.
struct event_poster_interface { attr_value_t (*get_event_info_val)(conf_object_t *NOTNULL obj, void (*NOTNULL func)( conf_object_t *obj, lang_void *param), void *user_data); const char *(*describe_event)(conf_object_t *NOTNULL obj, void (*NOTNULL func)(conf_object_t *obj, lang_void *param), void *user_data); void (*get_event_info)(attr_value_t *NOTNULL checkpoint_value, conf_object_t *NOTNULL obj, void (*NOTNULL func)(conf_object_t *obj, lang_void *param), void *user_data); int (*set_event_info)(conf_object_t *NOTNULL obj, attr_value_t *NOTNULL checkpoint_value, void (**NOTNULL out_func)(conf_object_t *obj, lang_void *param), void **NOTNULL out_info); }; #define EVENT_POSTER_INTERFACE "event_poster"
get_event_info_val() is called for each event posted by the object obj present in the event queues when writing a configuration. Using the func and the info parameters get_event_info_val() should return a checkpoint value so that set_event_info() can restore both func and info when the configuration is later read. If the event should not be saved, get_event_info_val() should return Sim_Val_Nil.
get_event_info() is an alternative interface kept for compatibility. It modifies the checkpoint_value parameter instead of returning a value. It is only used if get_event_info_val() is not present.
set_event_info() is called for each event associated with obj found when restoring events from a saved configuration. Using the checkpoint_value set_event_info() should fill in out_func and out_info with the associated values. set_event_info() should return one of Sim_Set_Ok, Sim_Set_Ignored and Sim_Set_Illegal_Value. Sim_Set_Ok should be returned if the event was recognised and should be posted, Sim_Set_Ignored if the event was recognised for backwards compatibility but should not be posted, and Sim_Set_Illegal_Value if the event was not recognised.
describe_event() should return a string describing the event using the func and user_data parameters. The string is for example used when the event queue is printed.