breakpoint_type_provider con_input
API Reference Manual  /  7 Simulator-to-Simulator Interfaces  / 

checkpoint

Description
The save function in this interface is called when a checkpoint is saved, right before the attributes of an object is read. If defined, it should prepare the object for checkpointing, saving any state to path that is not directly included in the attributes. Errors are signalled through exceptions.

The path argument may be the empty string, which indicates that the checkpoint bundle directory is the same as the current working directory while the checkpoint is being saved.

The finish function is called after the checkpoint has been saved, for all objects that save was called for. If success is nonzero, the checkpoint was saved successfully; otherwise there was a failure. This permits the object to clean up temporary data structures and files in either case. In particular, any files written to path in the save method must be removed in finish if success is zero.

The function has_persistent_data, if implemented, should return 0 if the object only has volatile attributes, 1 otherwise. This overrides Sim_Attr_Persistent on individual attributes.

SIM_INTERFACE(checkpoint) {
        void (*save)(conf_object_t *obj, const char *NOTNULL path);
        void (*finish)(conf_object_t *obj, int success);
        int (*has_persistent_data)(conf_object_t *obj);
};

#define CHECKPOINT_INTERFACE "checkpoint"

Execution Context
Global Context for all methods.

breakpoint_type_provider con_input