[−][src]Function dqcsim::bindings::dqcs_pdef_set_advance_cb
#[no_mangle]pub extern "C" fn dqcs_pdef_set_advance_cb(
pdef: dqcs_handle_t,
callback: Option<extern "C" fn(user_data: *mut c_void, state: dqcs_plugin_state_t, cycles: dqcs_cycle_t) -> dqcs_return_t>,
user_free: Option<extern "C" fn(user_data: *mut c_void)>,
user_data: *mut c_void
) -> dqcs_return_t
Sets the callback for advancing time for operators and backends.
The default behavior for operators is to pass through to
dqcs_plugin_advance()
. The default for backends is no-op. This
callback is never called for frontend plugins.
Besides the common arguments, the callback receives an unsigned integer specifying the number of cycles to advance by.
The callback can return an error by setting an error message using
dqcs_error_set()
and returning DQCS_FAILURE
. Otherwise, it should
return DQCS_SUCCESS
.