Skip to content
Start free evaluation

pdcomm::GemFormattedProgramSelectionSnapshot

Class

Immutable copy of the equipment's formatted program selection.

class GemFormattedProgramSelectionSnapshot

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

Get 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 = default

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

GemFormattedProgramSelectionSnapshot

Constructor

Takes ownership of the native handle owned by other.

GemFormattedProgramSelectionSnapshot(GemFormattedProgramSelectionSnapshot &&other) noexcept

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

Parameters

NameDescription
otherSource wrapper; it becomes empty.

GemFormattedProgramSelectionSnapshot

Constructor

Copying is disabled; the wrapper exclusively owns its native handle.

GemFormattedProgramSelectionSnapshot(const GemFormattedProgramSelectionSnapshot &) = delete

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

commandCode

Method

Returns the CCODE of one command of the selected program.

SecsItem commandCode(size_t index) const

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

Parameters

NameDescription
indexZero-based command position.

Returns

An independently owned item.

Notes

  • Throws pdcomm::Error: PDCOMM_INVALID_STATE when nothing is selected; PDCOMM_OUT_OF_RANGE for an invalid index.

commandInfo

Method

Describes one command of the selected program.

GemFormattedProgramSelectionCommandInfo commandInfo(size_t index) const

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

Parameters

NameDescription
indexZero-based command position, less than GemFormattedProgramSelectionInfo::commandCount.

Returns

Parameter count and CCODE format.

Notes

  • Throws pdcomm::Error: PDCOMM_INVALID_STATE when nothing is selected; PDCOMM_OUT_OF_RANGE for an invalid index.

id

Method

Returns the PPID of the selected program.

SecsItem id() const

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

Returns

An independently owned ASCII or Binary item.

Notes

  • Throws pdcomm::Error: PDCOMM_INVALID_STATE when nothing is selected.

info

Method

Returns the selection state captured in the snapshot.

GemFormattedProgramSelectionInfo info() const

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

Returns

State, stale reason, generations and command count.

Notes

  • Throws pdcomm::Error: PDCOMM_INVALID_ARGUMENT for an empty snapshot.

model

Method

Copies the MDLN of the selected program.

std::string model() const

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

Returns

The model text.

Notes

  • Throws pdcomm::Error: PDCOMM_INVALID_STATE when nothing is selected.

operator bool

Method

Reports whether the wrapper owns a native snapshot.

explicit operator bool() const noexcept

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

Returns

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) noexcept

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

Parameters

NameDescription
otherSource wrapper; it becomes empty.

Returns

This wrapper.

operator=

Method

Copy assignment is disabled; the wrapper exclusively owns its native handle.

GemFormattedProgramSelectionSnapshot &operator=(const GemFormattedProgramSelectionSnapshot &) = delete

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

parameter

Method

Returns one PPARM of one command of the selected program.

SecsItem parameter(size_t command, size_t index) const

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

Parameters

NameDescription
commandZero-based command position.
indexZero-based parameter position.

Returns

An independently owned item.

Notes

  • Throws pdcomm::Error: PDCOMM_INVALID_STATE when nothing is selected; PDCOMM_OUT_OF_RANGE for an invalid index.

softwareRevision

Method

Copies the SOFTREV of the selected program.

std::string softwareRevision() const

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

Returns

The software revision text.

Notes

  • Throws pdcomm::Error: PDCOMM_INVALID_STATE when nothing is selected.

~GemFormattedProgramSelectionSnapshot

Method

Releases the native handle with pdcomm_gem_formatted_program_selection_snapshot_destroy().

~GemFormattedProgramSelectionSnapshot()

Declared in: #include <pdcomm_gem_formatted_program_selections.hpp>

An empty snapshot releases nothing.