Next: Constructors
Up: CommandQueue
Previous: CommandQueue
CommandQueue maintains a queue of Command's, and will
go through this queue and execute them when requested. The queue is
first-in first-out. This object also has the ability to log commands
to a file.
There is one global instance of this class in VMD, called commandQueue.
It is used by all the user interface objects (UIObject classes).
Each time a new action is requested by the user or some other part of
VMD, a new Command instance is created and added to the
CommandQueue. Within the main event loop of VMD, after each
UIObject is checked for new events, the commands in the queue are
all executed until the queue is empty (since the execution of one command
may result in the queuing of a new command, this process continues until
the queue is empty). Each time the queue is checked, the following
occurs:
- The next Command instance at the top of the queue is
fetched to be executed.
- If commands are being logged to a file, the text representation
of the command is written to that file.
- The command itself is executed, and the return code (success of
the command) is stored.
- After it is executed, each UIObject active at that time
(which are stored in the UIList object) are informed about the
command, and are given both the pointer to the command, and it's
success flag. This is done so that user interfaces can update their
visual display or internal state to reflect the fact that something
has changed. In this way, even though a single user interface
component may do some action, ALL user interface's can know when
to update their state to reflect the changes in the program.
- After this, the Command instance is deleted. There is
one routine which does this differently, `runcommand' (see below).
Next: Constructors
Up: CommandQueue
Previous: CommandQueue
Justin Gullingsrud
Tue Apr 6 09:26:48 CDT 1999