![]() |
Contur 2
Educational OS kernel simulator
|
Default MVC controller implementation. More...
#include <i_tui_controller.h>
Public Types | |
| using | TickFn = std::function<Result<void>(std::size_t step)> |
| Signature used by controller to advance kernel time. | |
Public Member Functions | |
| TuiController (const IKernelReadModel &readModel, TickFn tickFn, std::size_t historyCapacity=256) | |
| Constructs controller. | |
| ~TuiController () override | |
| Destroys controller. | |
| TuiController (const TuiController &)=delete | |
| Copy construction is disabled. | |
| TuiController & | operator= (const TuiController &)=delete |
| Copy assignment is disabled. | |
| TuiController (TuiController &&) noexcept | |
| Move-constructs controller state. | |
| TuiController & | operator= (TuiController &&) noexcept |
| Move-assigns controller state. | |
| Result< void > | dispatch (const TuiCommand &command) override |
| Dispatches one controller command. | |
| Result< void > | advanceAutoplay (std::uint32_t elapsedMs) override |
| Advances autoplay timer and executes due tick steps. | |
| const TuiSnapshot & | current () const noexcept override |
| Returns current UI snapshot at history cursor. | |
| TuiControllerState | state () const noexcept override |
| Returns current playback state. | |
| std::size_t | historySize () const noexcept override |
| Returns retained history entry count. | |
| std::size_t | historyCursor () const noexcept override |
| Returns current history cursor index. | |
| Public Member Functions inherited from contur::ITuiController | |
| virtual | ~ITuiController ()=default |
| Virtual destructor for interface-safe polymorphic cleanup. | |
Private Attributes | |
| std::unique_ptr< Impl > | impl_ |
Default MVC controller implementation.
Definition at line 58 of file i_tui_controller.h.
| using contur::TuiController::TickFn = std::function<Result<void>(std::size_t step)> |
Signature used by controller to advance kernel time.
Definition at line 62 of file i_tui_controller.h.
| contur::TuiController::TuiController | ( | const IKernelReadModel & | readModel, |
| TickFn | tickFn, | ||
| std::size_t | historyCapacity = 256 ) |
Constructs controller.
| readModel | Read-model adapter for snapshot capture. |
| tickFn | Callback that advances kernel by N ticks. |
| historyCapacity | Max retained history entries (0 normalizes to 1). |
Referenced by operator=(), operator=(), TuiController(), and TuiController().
|
override |
Destroys controller.
|
delete |
Copy construction is disabled.
References TuiController().
|
noexcept |
Move-constructs controller state.
References TuiController().
|
nodiscardoverridevirtual |
Advances autoplay timer and executes due tick steps.
| elapsedMs | Elapsed wall-clock milliseconds since previous call. |
Implements contur::ITuiController.
References advanceAutoplay().
Referenced by advanceAutoplay().
|
nodiscardoverridevirtualnoexcept |
Returns current UI snapshot at history cursor.
Implements contur::ITuiController.
References current().
Referenced by current().
|
nodiscardoverridevirtual |
Dispatches one controller command.
| command | Command payload. |
Implements contur::ITuiController.
References dispatch().
Referenced by dispatch().
|
nodiscardoverridevirtualnoexcept |
Returns current history cursor index.
Implements contur::ITuiController.
References historyCursor().
Referenced by historyCursor().
|
nodiscardoverridevirtualnoexcept |
Returns retained history entry count.
Implements contur::ITuiController.
References historySize().
Referenced by historySize().
|
delete |
Copy assignment is disabled.
References TuiController().
|
noexcept |
Move-assigns controller state.
References TuiController().
|
nodiscardoverridevirtualnoexcept |
Returns current playback state.
Implements contur::ITuiController.
References state().
Referenced by state().
|
private |
Definition at line 105 of file i_tui_controller.h.