Motr  M0
sim_callout Struct Reference

#include <sim.h>

Collaboration diagram for sim_callout:
Collaboration graph

Data Fields

sim_time_t sc_time
 
sim_call_tsc_call
 
void * sc_datum
 
struct m0_tlink sc_linkage
 
struct simsc_sim
 
uint64_t sc_magic
 

Detailed Description

A call-out (alias timer, alias event) is a representation of an event in simulation. A call-out is allocated to simulate some event that is to happen in the simulation "future". Call-outs are inserted into a per-simulation queue sorted by the logical simulation time. In the fullness of logical time, call-out is "executed", meaning that its ->sc_call() function is called. Execution of call-out might allocate new call-outs advancing the state of simulation.

Definition at line 126 of file sim.h.

Field Documentation

◆ sc_call

sim_call_t* sc_call

call-back function to be invoked when the logical time is ripe. If call-back function returns true (non-0), main simulation loop frees the call-out structure (this is suitable for one-shot call-outs), otherwise it is up to the call-out creator to clean up.

Definition at line 134 of file sim.h.

◆ sc_datum

void* sc_datum

a datum, opaque for generic simulation code, attached to the call-out. This field is for private use by call-back function

Definition at line 138 of file sim.h.

◆ sc_linkage

struct m0_tlink sc_linkage

linkage into a logical time list sim::ss_future

Definition at line 140 of file sim.h.

◆ sc_magic

uint64_t sc_magic

Definition at line 143 of file sim.h.

◆ sc_sim

struct sim* sc_sim

simulation run this call-out is an event in

Definition at line 142 of file sim.h.

◆ sc_time

sim_time_t sc_time

logical time for which the call-out is scheduled

Definition at line 128 of file sim.h.


The documentation for this struct was generated from the following file: