Skip to content
Start free evaluation

pdcomm::GemFormattedProgramStoreSnapshot

Class

Immutable copy of the equipment's formatted program store.

class GemFormattedProgramStoreSnapshot

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

A snapshot owns a full copy of every program. It stays valid after later store changes and after the endpoint is destroyed. Get one from formattedProgramStoreSnapshot().

const auto snapshot = pdcomm::formattedProgramStoreSnapshot(equipment);
for (size_t entry = 0; entry < snapshot.info().entryCount; ++entry) {
    auto id = snapshot.id(entry);
    std::cout << snapshot.model(entry) << ' ' << snapshot.entryInfo(entry).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

GemFormattedProgramStoreSnapshot

Constructor

Creates an empty snapshot that owns no native handle.

GemFormattedProgramStoreSnapshot() noexcept = default

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

GemFormattedProgramStoreSnapshot

Constructor

Takes ownership of the native handle owned by other.

GemFormattedProgramStoreSnapshot(GemFormattedProgramStoreSnapshot &&other) noexcept

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

Parameters

NameDescription
otherSource wrapper; it becomes empty.

GemFormattedProgramStoreSnapshot

Constructor

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

GemFormattedProgramStoreSnapshot(const GemFormattedProgramStoreSnapshot &) = delete

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

commandCode

Method

Returns the CCODE of one command of one stored program.

SecsItem commandCode(size_t entryIndex, size_t commandIndex) const

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

Parameters

NameDescription
entryIndexZero-based program position.
commandIndexZero-based command position.

Returns

An independently owned item.

Notes

  • Throws pdcomm::Error: PDCOMM_OUT_OF_RANGE for an invalid index.

commandInfo

Method

Describes one command of one stored program.

GemFormattedProgramStoreCommandInfo commandInfo(size_t entryIndex, size_t commandIndex) const

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

Parameters

NameDescription
entryIndexZero-based program position.
commandIndexZero-based command position.

Returns

Parameter count and CCODE format.

Notes

  • Throws pdcomm::Error: PDCOMM_OUT_OF_RANGE for an invalid index.

entryInfo

Method

Describes one stored program.

GemFormattedProgramStoreEntryInfo entryInfo(size_t entryIndex) const

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

Parameters

NameDescription
entryIndexZero-based program position, less than GemFormattedProgramStoreInfo::entryCount.

Returns

Command count and PPID format.

Notes

  • Throws pdcomm::Error: PDCOMM_OUT_OF_RANGE for an invalid index.

id

Method

Returns the PPID of one stored program.

SecsItem id(size_t entryIndex) const

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

Parameters

NameDescription
entryIndexZero-based program position.

Returns

An independently owned ASCII or Binary item.

Notes

  • Throws pdcomm::Error: PDCOMM_OUT_OF_RANGE for an invalid index.

info

Method

Returns the counters and limits captured in the snapshot.

GemFormattedProgramStoreInfo info() const

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

Returns

Revision, counts, sizes and limits.

Notes

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

model

Method

Copies the MDLN of one stored program.

std::string model(size_t entryIndex) const

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

Parameters

NameDescription
entryIndexZero-based program position.

Returns

The model text.

Notes

  • Throws pdcomm::Error: PDCOMM_OUT_OF_RANGE for an invalid index.

operator bool

Method

Reports whether the wrapper owns a native snapshot.

explicit operator bool() const noexcept

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

Returns

true when a snapshot is owned.

operator=

Method

Releases the current handle, then takes ownership of the handle owned by other.

GemFormattedProgramStoreSnapshot &operator=(GemFormattedProgramStoreSnapshot &&other) noexcept

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

Parameters

NameDescription
otherSource wrapper; it becomes empty.

Returns

This wrapper.

operator=

Method

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

GemFormattedProgramStoreSnapshot &operator=(const GemFormattedProgramStoreSnapshot &) = delete

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

parameter

Method

Returns one PPARM of one command of one stored program.

SecsItem parameter(size_t entryIndex, size_t commandIndex, size_t parameterIndex) const

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

Parameters

NameDescription
entryIndexZero-based program position.
commandIndexZero-based command position.
parameterIndexZero-based parameter position.

Returns

An independently owned item.

Notes

  • Throws pdcomm::Error: PDCOMM_OUT_OF_RANGE for an invalid index.

softwareRevision

Method

Copies the SOFTREV of one stored program.

std::string softwareRevision(size_t entryIndex) const

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

Parameters

NameDescription
entryIndexZero-based program position.

Returns

The software revision text.

Notes

  • Throws pdcomm::Error: PDCOMM_OUT_OF_RANGE for an invalid index.

~GemFormattedProgramStoreSnapshot

Method

Releases the native handle with pdcomm_gem_formatted_program_store_snapshot_destroy().

~GemFormattedProgramStoreSnapshot()

Declared in: #include <pdcomm_gem_formatted_program_store.hpp>

An empty snapshot releases nothing.