21 explicit Scheduler(std::unique_ptr<ISchedulingPolicy> policy);
60 [[nodiscard]] std::string_view
policyName() const noexcept;
Abstract clock interface for simulation time.
Scheduler abstraction managing process state queues.
Strategy interface for scheduling algorithms.
Process Control Block — stores all metadata for a single process.
A result type that holds either a success value of type T or an ErrorCode.
Scheduler & operator=(const Scheduler &)=delete
std::vector< ProcessId > getBlockedSnapshot() const override
Snapshot of blocked queue process IDs.
Result< void > blockRunning(Tick currentTick) override
Moves running process to blocked state.
Scheduler(Scheduler &&) noexcept
Scheduler(const Scheduler &)=delete
Result< void > dequeue(ProcessId pid) override
Removes process from scheduler tracking.
Result< ProcessId > selectNext(const IClock &clock) override
Selects next process according to active policy.
std::unique_ptr< Impl > impl_
std::vector< ProcessId > getQueueSnapshot() const override
Snapshot of ready queue process IDs.
Scheduler(std::unique_ptr< ISchedulingPolicy > policy)
Constructs scheduler with initial policy.
std::string_view policyName() const noexcept
Returns active policy name.
Result< void > terminate(ProcessId pid, Tick currentTick) override
Terminates process and removes it from scheduler state.
ProcessId runningProcess() const noexcept override
Currently running process ID or INVALID_PID.
Result< void > setPolicy(std::unique_ptr< ISchedulingPolicy > policy) override
Replaces the active scheduling policy.
Result< void > unblock(ProcessId pid, Tick currentTick) override
Moves blocked process back to ready queue.
Result< void > enqueue(PCB &pcb, Tick currentTick) override
Enqueues process into ready queue.
std::uint64_t Tick
Simulation clock tick counter.
std::uint32_t ProcessId
Unique identifier for a process.