|
CLI
2.9
|
Execution context. More...
#include <exec_context.h>

Public Member Functions | |
| virtual | ~ExecutionContext (void) |
| Destructor. More... | |
| ExecutionContextManager & | GetContextManager (void) |
| Execution context manager accessor. More... | |
| const IODevice & | GetInput (void) const |
| Input stream accessor. More... | |
| const OutputDevice & | GetStream (const STREAM_TYPE E_StreamType) const |
| Output stream accessor. More... | |
| const bool | SetStream (const STREAM_TYPE E_StreamType, OutputDevice &CLI_Stream) |
| Output stream positionning. More... | |
| const bool | StreamEnabled (const STREAM_TYPE E_StreamType) const |
| Enabled/disabled stream accessor. More... | |
| const bool | EnableStream (const STREAM_TYPE E_StreamType, const bool B_Enable) |
| Enable/disable stream. More... | |
| void | SetLang (const ResourceString::LANG E_Lang) |
| Language setting. More... | |
| const ResourceString::LANG | GetLang (void) const |
| Language access. More... | |
| void | SetBeep (const bool B_Enable) |
| Beep configuration setting. More... | |
| const bool | GetBeep (void) const |
| Beep configuration access. More... | |
| void | Beep (void) |
| Sends a beep signal. More... | |
| void | Run (IODevice &CLI_IODevice) |
| Runs the execution context onto the corresponding input/output device. More... | |
| void | Run (void) |
| Runs the execution context as a child context of the parent given by the construction. More... | |
| const bool | IsRunning (void) const |
| Tells whether this execution context is running or not. More... | |
| void | StopExecution (void) |
| Terminates this execution context's execution. More... | |
| void | StopAllExecutions (void) |
| Terminates execution for all execution contexts attached to the same top execution context. More... | |
Public Member Functions inherited from Object | |
| virtual | ~Object (void)=0 |
| Pure virtual destructor. More... | |
Protected Member Functions | |
| ExecutionContext (void) | |
| Top context constructor. More... | |
| ExecutionContext (ExecutionContext &CLI_ParentContext) | |
| Child context constructor. More... | |
| virtual const bool | OnStartExecution (void)=0 |
| Beginning of execution handler. More... | |
| virtual void | OnKey (const KEY E_KeyCode)=0 |
| Handler called on character input. More... | |
| virtual const bool | OnStopExecution (void)=0 |
| Execution termination handler. More... | |
Protected Member Functions inherited from Object | |
| Object (void) | |
| Default constructor only available to sub-classes. More... | |
Execution context.
An execution context, in the CLI library, is something that manages:
Input character processing is implemented through the Run method. It may be either blocking or non blocking depending on the type of input/output device given.
When the input/output device is a blocking device (IODevice based class), the execution is done whithin a blocking call as illustrated by the following chart:
When the input/output device is a non blocking device (NonBlockingIODevice based class), the ExecutionContext::Run() is non blocking, and the execution context waits for keys to be notified by the user's integration. Execution result is notified through the ExecutionResult callback interface:
An execution context may be either a top or child execution context, depending on the kind of constructor actually called. A child execution context uses the same context as its parent.
When execution takes place in a blocking call, the flow charts is straight forward:
When it takes place in a non blocking call, the input/output device automatically forwards input keys to the current active context:
Definition at line 149 of file exec_context.h.
|
explicitprotected |
Top context constructor.
|
explicitprotected |
Child context constructor.
Makes this execution context run in the same context as the one given for parent.
| CLI_ParentContext | Parent execution context. |
|
virtual |
Destructor.
| void ExecutionContext::Beep | ( | void | ) |
Sends a beep signal.
Referenced by Float::OnKey(), Int::OnKey(), Choice::OnKey(), Password::OnKey(), Less::OnKey(), and Line::OnKey().
| const bool ExecutionContext::EnableStream | ( | const STREAM_TYPE | E_StreamType, |
| const bool | B_Enable | ||
| ) |
Enable/disable stream.
| E_StreamType | Output stream identifier. |
| B_Enable | Enable flag. |
| const bool ExecutionContext::GetBeep | ( | void | ) | const |
Beep configuration access.
| ExecutionContextManager& ExecutionContext::GetContextManager | ( | void | ) |
Execution context manager accessor.
| const IODevice& ExecutionContext::GetInput | ( | void | ) | const |
Input stream accessor.
| const ResourceString::LANG ExecutionContext::GetLang | ( | void | ) | const |
| const OutputDevice& ExecutionContext::GetStream | ( | const STREAM_TYPE | E_StreamType | ) | const |
Output stream accessor.
| E_StreamType | Output stream identifier. |
Referenced by Password::OnKey(), More::OnKey(), Line::OnKey(), UI::OnStopExecution(), Password::ResetToDefault(), Less::ResetToDefault(), More::ResetToDefault(), and Line::SetLine().
| const bool ExecutionContext::IsRunning | ( | void | ) | const |
Tells whether this execution context is running or not.
|
protectedpure virtual |
|
protectedpure virtual |
|
protectedpure virtual |
| void ExecutionContext::Run | ( | IODevice & | CLI_IODevice | ) |
Runs the execution context onto the corresponding input/output device.
Call this runner method, for top execution contexts.
| CLI_IODevice | Input/output device to run onto. |
| void ExecutionContext::Run | ( | void | ) |
Runs the execution context as a child context of the parent given by the construction.
Call this runner method, for child execution contexts.
| void ExecutionContext::SetBeep | ( | const bool | B_Enable | ) |
Beep configuration setting.
| B_Enable | New value. |
| void ExecutionContext::SetLang | ( | const ResourceString::LANG | E_Lang | ) |
Language setting.
| E_Lang | New value. |
| const bool ExecutionContext::SetStream | ( | const STREAM_TYPE | E_StreamType, |
| OutputDevice & | CLI_Stream | ||
| ) |
Output stream positionning.
| E_StreamType | Output stream identifier. |
| CLI_Stream | Stream reference. |
| void ExecutionContext::StopAllExecutions | ( | void | ) |
Terminates execution for all execution contexts attached to the same top execution context.
| void ExecutionContext::StopExecution | ( | void | ) |
Terminates this execution context's execution.
Referenced by UI::EndControl().
| const bool ExecutionContext::StreamEnabled | ( | const STREAM_TYPE | E_StreamType | ) | const |
Enabled/disabled stream accessor.
| E_StreamType | Output stream identifier. |