pdcomm::GemFormattedProgramSelectionSnapshot
Class
Immutable copy of the equipment's formatted program selection.
class GemFormattedProgramSelectionSnapshotGet one from formattedProgramSelectionSnapshot() to inspect the current state, or from validateFormattedProgramSelection() for a selection that was just confirmed as ready. The snapshot owns its contents and stays valid after later changes and endpoint destruction.
auto token = pdcomm::selectFormattedProgram(equipment, id);
auto snapshot = pdcomm::formattedProgramSelectionSnapshot(equipment);
if (snapshot.info().validForExecution)
std::cout << snapshot.model() << ' ' << snapshot.info().commandCount << '\n';Notes
- Move-only RAII wrapper. Getters may run concurrently; destruction must not race with them. Getters on an empty snapshot throw pdcomm::Error with
PDCOMM_INVALID_ARGUMENT.
Members
GemFormattedProgramSelectionSnapshot
Constructor
Creates an empty snapshot that owns no native handle.
GemFormattedProgramSelectionSnapshot() noexcept = defaultGemFormattedProgramSelectionSnapshot
Constructor
Takes ownership of the native handle owned by other.
GemFormattedProgramSelectionSnapshot(GemFormattedProgramSelectionSnapshot &&other) noexceptParameters
| Name | Description |
|---|---|
other | Source wrapper; it becomes empty. |
GemFormattedProgramSelectionSnapshot
Constructor
Copying is disabled; the wrapper exclusively owns its native handle.
GemFormattedProgramSelectionSnapshot(const GemFormattedProgramSelectionSnapshot &) = deletecommandCode
Method
Returns the CCODE of one command of the selected program.
SecsItem commandCode(size_t index) constParameters
| Name | Description |
|---|---|
index | Zero-based command position. |
Returns
An independently owned item.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_STATEwhen nothing is selected;PDCOMM_OUT_OF_RANGEfor an invalidindex.
commandInfo
Method
Describes one command of the selected program.
GemFormattedProgramSelectionCommandInfo commandInfo(size_t index) constParameters
| Name | Description |
|---|---|
index | Zero-based command position, less than GemFormattedProgramSelectionInfo::commandCount. |
Returns
Parameter count and CCODE format.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_STATEwhen nothing is selected;PDCOMM_OUT_OF_RANGEfor an invalidindex.
id
Method
Returns the PPID of the selected program.
SecsItem id() constReturns
An independently owned ASCII or Binary item.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_STATEwhen nothing is selected.
info
Method
Returns the selection state captured in the snapshot.
GemFormattedProgramSelectionInfo info() constReturns
State, stale reason, generations and command count.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_ARGUMENTfor an empty snapshot.
model
Method
Copies the MDLN of the selected program.
std::string model() constReturns
The model text.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_STATEwhen nothing is selected.
operator bool
Method
Reports whether the wrapper owns a native snapshot.
explicit operator bool() const noexceptReturns
true when a snapshot is owned.
operator=
Method
Releases the current handle, then takes ownership of the handle owned by other.
GemFormattedProgramSelectionSnapshot &operator=(GemFormattedProgramSelectionSnapshot &&other) noexceptParameters
| Name | Description |
|---|---|
other | Source wrapper; it becomes empty. |
Returns
This wrapper.
operator=
Method
Copy assignment is disabled; the wrapper exclusively owns its native handle.
GemFormattedProgramSelectionSnapshot &operator=(const GemFormattedProgramSelectionSnapshot &) = deleteparameter
Method
Returns one PPARM of one command of the selected program.
SecsItem parameter(size_t command, size_t index) constParameters
| Name | Description |
|---|---|
command | Zero-based command position. |
index | Zero-based parameter position. |
Returns
An independently owned item.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_STATEwhen nothing is selected;PDCOMM_OUT_OF_RANGEfor an invalid index.
softwareRevision
Method
Copies the SOFTREV of the selected program.
std::string softwareRevision() constReturns
The software revision text.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_STATEwhen nothing is selected.
~GemFormattedProgramSelectionSnapshot
Method
Releases the native handle with pdcomm_gem_formatted_program_selection_snapshot_destroy().
~GemFormattedProgramSelectionSnapshot()An empty snapshot releases nothing.