pdcomm::GemFormattedProgramStoreSnapshot
Class
Immutable copy of the equipment's formatted program store.
class GemFormattedProgramStoreSnapshotA 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 = defaultGemFormattedProgramStoreSnapshot
Constructor
Takes ownership of the native handle owned by other.
GemFormattedProgramStoreSnapshot(GemFormattedProgramStoreSnapshot &&other) noexceptParameters
| Name | Description |
|---|---|
other | Source wrapper; it becomes empty. |
GemFormattedProgramStoreSnapshot
Constructor
Copying is disabled; the wrapper exclusively owns its native handle.
GemFormattedProgramStoreSnapshot(const GemFormattedProgramStoreSnapshot &) = deletecommandCode
Method
Returns the CCODE of one command of one stored program.
SecsItem commandCode(size_t entryIndex, size_t commandIndex) constParameters
| Name | Description |
|---|---|
entryIndex | Zero-based program position. |
commandIndex | Zero-based command position. |
Returns
An independently owned item.
Notes
- Throws
pdcomm::Error:PDCOMM_OUT_OF_RANGEfor an invalid index.
commandInfo
Method
Describes one command of one stored program.
GemFormattedProgramStoreCommandInfo commandInfo(size_t entryIndex, size_t commandIndex) constParameters
| Name | Description |
|---|---|
entryIndex | Zero-based program position. |
commandIndex | Zero-based command position. |
Returns
Parameter count and CCODE format.
Notes
- Throws
pdcomm::Error:PDCOMM_OUT_OF_RANGEfor an invalid index.
entryInfo
Method
Describes one stored program.
GemFormattedProgramStoreEntryInfo entryInfo(size_t entryIndex) constParameters
| Name | Description |
|---|---|
entryIndex | Zero-based program position, less than GemFormattedProgramStoreInfo::entryCount. |
Returns
Command count and PPID format.
Notes
- Throws
pdcomm::Error:PDCOMM_OUT_OF_RANGEfor an invalid index.
id
Method
Returns the PPID of one stored program.
SecsItem id(size_t entryIndex) constParameters
| Name | Description |
|---|---|
entryIndex | Zero-based program position. |
Returns
An independently owned ASCII or Binary item.
Notes
- Throws
pdcomm::Error:PDCOMM_OUT_OF_RANGEfor an invalid index.
info
Method
Returns the counters and limits captured in the snapshot.
GemFormattedProgramStoreInfo info() constReturns
Revision, counts, sizes and limits.
Notes
- Throws
pdcomm::Error:PDCOMM_INVALID_ARGUMENTfor an empty snapshot.
model
Method
Copies the MDLN of one stored program.
std::string model(size_t entryIndex) constParameters
| Name | Description |
|---|---|
entryIndex | Zero-based program position. |
Returns
The model text.
Notes
- Throws
pdcomm::Error:PDCOMM_OUT_OF_RANGEfor an invalid index.
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.
GemFormattedProgramStoreSnapshot &operator=(GemFormattedProgramStoreSnapshot &&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.
GemFormattedProgramStoreSnapshot &operator=(const GemFormattedProgramStoreSnapshot &) = deleteparameter
Method
Returns one PPARM of one command of one stored program.
SecsItem parameter(size_t entryIndex, size_t commandIndex, size_t parameterIndex) constParameters
| Name | Description |
|---|---|
entryIndex | Zero-based program position. |
commandIndex | Zero-based command position. |
parameterIndex | Zero-based parameter position. |
Returns
An independently owned item.
Notes
- Throws
pdcomm::Error:PDCOMM_OUT_OF_RANGEfor an invalid index.
softwareRevision
Method
Copies the SOFTREV of one stored program.
std::string softwareRevision(size_t entryIndex) constParameters
| Name | Description |
|---|---|
entryIndex | Zero-based program position. |
Returns
The software revision text.
Notes
- Throws
pdcomm::Error:PDCOMM_OUT_OF_RANGEfor an invalid index.
~GemFormattedProgramStoreSnapshot
Method
Releases the native handle with pdcomm_gem_formatted_program_store_snapshot_destroy().
~GemFormattedProgramStoreSnapshot()An empty snapshot releases nothing.