This class is a set of all Commands of OpenCAGE.
The class Commands is heavily related to the Command Pipeline Motivation (the Section called Motivation). If you use a Command Pipeline, you will certainly need Commands, too.
See Figure 6-1 (Command and Command Factory).
During the initalization phase of OpenCAGE the Commands are not created. They are created at run time. For every different Command type, there is a Command Factory. The Command Factory creates a Command. Then the Command is handed over to the Master Inpile (MIP) (see Command Pipeline ,the Section called Command Pipeline) and then starts its pass trough the Command Pipeline.
Every Command has one of the following status: init, cancelled_by_user, cancelled_by_error, wait, run and done. This status and other information can be transformed by the method To_String.
A Command can create other Commands during its execution phase which are handed over to the Master Inpile (MIP).
A Command can register Observers (see Observer the Section called Observer in Chapter 9), like a Skript Observer. The Command notifies the Observer, when there is a change (for example the Command's status changed).
A Command has to manage all Ada Tasks that are initialized in its execution phase. That includes initialization, execution and destruction of the Ada Task.