static void requestHalt ();This function sets the halt bit. The effect is to cause schedulers and targets to cease execution. It is important to note that this function does not alter flow of control; it only sets a flag.
static void declareErrorHalt ();This is the same as
requestHalt
except that it also sets the error bit. It is called, for example, by Error::abortRun.
static int haltRequested ();This function returns true if the halt bit is set, false otherwise. If the poll or interrupt bits are set, it calls handlers for them (see the subsection describing these).
static void clearHalt ();This function clears the halt and error flags.
preaction
; on that is called after a star is a post-action
. The functions that can be registered have take two arguments: a pointer to a Star (possibly null), and a const
char* pointer that points to a string (possibly null). The type definition
typedef void (*SimActionFunction)(Star*,const char*);gives the name SimActionFunction to functions of this type; several SimControl functions take arguments of this form.
static SimAction* registerAction(SimActionFunction action, int pre,Register a pre-action or post-action. If
const char* textArg = 0, Star* which = 0);
pre
is TRUE it is a preaction. If textArg
is given, it is passed as an argument when the action function is called. If which
is 0, the function will be called unconditionally by doPreActions
(if it is a preaction) or doPostActions
(if it is a post-action; otherwise it will only be called if the star being executed has the same address as which.
The return value represents the registered action; class SimAction is treated as if it is opaque (I'm not telling you what is in it) which can be used for cancel
calls.
static int doPreActions(Star * which);Execute all pre-actions, or post-actions, for a the particular Star
static int doPostActions(Star * which);
which.
The which
pointer is passed to each action function, along with any text argument declared when the action was registered. Return TRUE if no halting condition arises, FALSE if we are to halt.
static int cancel(SimAction* action);Cancel
action.
Warning: argument is deleted. Future versions will provide more ways of cancelling actions.
static void catchInt(int signo = -1, int always = 0);This static member function installs a simple interrupt handler for the signal with Unix signal number
signo.
If always
is true, the signal is always caught; otherwise the signal is not caught if the current status of the signal is that it is ignored (for example, processes running in the background ignore interrupt signals from the keyboard). This handler simply sets the SimControl interrupt bit; on the next call to haltRequested,
the user-specified interrupt handler is called.
static SimHandlerFunction setInterrupt(SimHandlerFunction f);Set the user-specified interrupt handler to
f,
and return the old handler, if any. This function is called in response to any signals specified in catchInt.
static SimHandlerFunction setPoll(SimHandlerFunction f);Register a function to be called by
haltRequested
if the poll flag is set, and set the poll flag. Returns old handler if any.