Full in-memory representation of a process.
More...
#include <process_image.h>
|
| std::unique_ptr< Impl > | impl_ |
Full in-memory representation of a process.
Contains all data needed to execute a process:
- PCB for lifecycle management
- Code segment (vector<Block>) for the interpreter
- RegisterFile for CPU context save/restore
Ownership: ProcessImage owns all three components.
Definition at line 35 of file process_image.h.
◆ ProcessImage() [1/3]
Constructs a ProcessImage with the given parameters.
- Parameters
-
| id | Unique process identifier. |
| name | Human-readable process name. |
| code | The program code (vector of Blocks). |
| priority | Process priority (defaults to Normal). |
| arrivalTime | Simulation tick at creation. |
◆ ~ProcessImage()
| contur::ProcessImage::~ProcessImage |
( |
| ) |
|
◆ ProcessImage() [2/3]
| contur::ProcessImage::ProcessImage |
( |
const ProcessImage & | | ) |
|
|
delete |
◆ ProcessImage() [3/3]
| contur::ProcessImage::ProcessImage |
( |
ProcessImage && | | ) |
|
|
noexcept |
◆ code()
| const std::vector< Block > & contur::ProcessImage::code |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns a const reference to the code segment.
◆ codeSize()
| std::size_t contur::ProcessImage::codeSize |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns the size of the code segment (number of Blocks).
◆ id()
◆ name()
| std::string_view contur::ProcessImage::name |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns the process name.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ pcb() [1/2]
| const PCB & contur::ProcessImage::pcb |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns a const reference to the PCB.
◆ pcb() [2/2]
| PCB & contur::ProcessImage::pcb |
( |
| ) |
|
|
nodiscardnoexcept |
Returns a mutable reference to the PCB.
◆ priority()
| const Priority & contur::ProcessImage::priority |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns the process priority.
◆ readCode()
| const Block & contur::ProcessImage::readCode |
( |
std::size_t | offset | ) |
const |
|
nodiscard |
Reads a single Block from the code segment.
- Parameters
-
| offset | Index into the code segment. |
- Returns
- The Block at the given offset.
- Precondition
- offset < codeSize()
◆ registers() [1/2]
| const RegisterFile & contur::ProcessImage::registers |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns a const reference to the register file.
◆ registers() [2/2]
Returns a mutable reference to the register file.
◆ setCode()
| void contur::ProcessImage::setCode |
( |
std::vector< Block > | newCode | ) |
|
Replaces the code segment with new code.
- Parameters
-
| newCode | The replacement program. |
◆ state()
Returns the current process state.
◆ impl_
| std::unique_ptr<Impl> contur::ProcessImage::impl_ |
|
private |
The documentation for this class was generated from the following file: